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.

What is Model Context Protocol (MCP)?
Understanding the technology that powers real-time AI-IDE integration

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's MCP Implementation

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

How MCP Works with SchemaFlow
The technical architecture behind seamless AI-IDE integration

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

Available MCP Tools
Three powerful tools your AI assistant can use to understand your database

get_schema

Core Tool

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:

"Show me my database schema"
"What tables do I have?"
"Show me all relationships"
"List database functions"

Query Types Available:

tables
columns
relationships
functions
triggers
enums
indexes
all

analyze_database

Analysis Tool

Performs comprehensive analysis including performance insights, security assessment, and structural recommendations.

Example AI Queries:

"Analyze my database performance"
"Check database security"
"Review database structure"
"Give me a database overview"

check_schema_alignment

Validation Tool

Validates your schema against best practices and identifies potential issues with actionable recommendations.

Example AI Queries:

"Check schema alignment"
"Validate my database"
"Any schema issues?"
"Check naming conventions"
Step-by-Step Setup Guide
Complete instructions to get MCP working with your AI-IDE
1

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
2

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
3

Configure Your AI-IDE

Add the MCP server configuration to your AI-IDE settings.

For Cursor IDE:

Configuration Steps:
  1. 1. Open Cursor Settings
  2. 2. Go to Features → MCP
  3. 3. Click "Add New MCP Server"
  4. 4. Use the configuration provided in your dashboard
Example Configuration:
{
  "name": "schema-sync",
  "type": "sse",
  "url": "https://api.schemaflow.dev/mcp/?token=your-token-here"
}
4

Start Using MCP

Your AI assistant now has real-time access to your database schema!

Try these example queries:
  • • "Show me my database schema"
  • • "What tables are related to users?"
  • • "Analyze my database performance"
  • • "Check for any schema issues"
Why Use MCP with SchemaFlow?
The advantages of real-time schema integration for AI-powered development

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

Ready to Get Started?

Connect your database to SchemaFlow and start using MCP integration with your AI-IDE today. Experience the power of real-time schema access for enhanced development.