Complete MCP Integration Guide
Learn how to connect your AI-IDE to SchemaFlow using Model Context Protocol for real-time database schema access and enhanced code generation.
Model Context Protocol (MCP) is an open standard that enables AI applications to securely access external data sources in real-time. SchemaFlow implements MCP to provide your AI-IDE with live access to your database schema, eliminating the need for manual exports and ensuring your AI assistant always has current information.
SchemaFlow uses Server-Sent Events (SSE) for MCP connections, providing a reliable, real-time communication channel between your AI-IDE and the schema data. This ensures instant access to your database structure without polling or manual refreshes.
Traditional Approach
Manual Export/Import
Export schema files and manually add them to your project
Outdated Information
Schema changes require manual updates
Team Coordination
Everyone needs to update their schema files
MCP Approach
Real-time Connection
Direct protocol connection to live schema data
Always Current
Automatic updates when schema changes
Secure Access
Token-based authentication and encryption
1. Schema Caching
When you load your schema in SchemaFlow, it's automatically cached for MCP access
2. Secure Connection
Your AI-IDE connects using MCP with secure token authentication
3. Real-time Access
Your AI assistant can query schema data in real-time for better code generation
get_schema
Retrieves complete database schema including tables, columns, relationships, functions, triggers, enums, and indexes. Your AI can filter specific information using the query_type parameter.
Example AI Queries:
Query Types Available:
analyze_database
Performs comprehensive analysis including performance insights, security assessment, and structural recommendations.
Example AI Queries:
check_schema_alignment
Validates your schema against best practices and identifies potential issues with actionable recommendations.
Example AI Queries:
Connect Your Database
Start by connecting your PostgreSQL database to SchemaFlow and loading your schema.
What happens:
- • SchemaFlow analyzes your database structure
- • Schema data is cached in browser localStorage for dashboard access
- • Schema is simultaneously cached on our servers for MCP access
- • All tables, relationships, and metadata are indexed
- • Whenever you refresh the schema in SchemaFlow dashboard, the MCP cache is automatically updated
Generate MCP Token
Create a secure MCP token that your AI-IDE will use to access your schema data.
Security features:
- • Unique token per user
- • Can be revoked anytime
- • Only accesses schema metadata (no actual data)
- • Encrypted connections
Configure Your AI-IDE
Add the MCP server configuration to your AI-IDE settings.
For Cursor IDE:
- 1. Open Cursor Settings
- 2. Go to Features → MCP
- 3. Click "Add New MCP Server"
- 4. Use the configuration provided in your dashboard
{ "name": "schema-sync", "type": "sse", "url": "https://api.schemaflow.dev/mcp/?token=your-token-here" }
Start Using MCP
Your AI assistant now has real-time access to your database schema!
- • "Show me my database schema"
- • "What tables are related to users?"
- • "Analyze my database performance"
- • "Check for any schema issues"
Enhanced Code Generation
AI generates more accurate code with real-time schema context
Always Up-to-Date
No more outdated schema files or manual updates
Secure Access
Token-based authentication with encrypted connections
Comprehensive Analysis
AI can analyze performance, security, and best practices
Team Collaboration
Everyone on your team has access to the same schema context
Time Savings
Eliminate manual schema export/import workflows