SchemaFlow MCP Server is an open-source project designed to provide AI-integrated development environments (AI-IDEs) with real-time context of PostgreSQL and Supabase database schemas through the Model Context Protocol (MCP). It is part of the SchemaFlow platform and helps developers obtain accurate database structure information during code generation.
Purpose
The main purpose of this server is to enable AI assistants in AI-IDEs (such as Cursor, Windsurf, VS Code + Cline) to access database schemas in real time, thereby generating smarter code that better matches the actual database structure. It solves the problem of AI potentially generating incorrect code when lacking database context.
Key Capabilities
- Real-time schema access: Through the MCP protocol, AI assistants can query complete database schema information, including tables, columns, relationships, functions, triggers, enums, and indexes.
- Available MCP tools:
get_schema(inferred from the description): Retrieve complete database schema information, with support for filtering specific information via thequery_typeparameter (tables, columns, relationships, functions, triggers, enums, indexes, all).analyze_database: Perform comprehensive database analysis, including performance insights, security assessment, and structural recommendations.check_schema_alignment: Validate the schema against best practices, identify potential issues, and provide actionable recommendations.
- Schema caching: After a schema is loaded in the SchemaFlow dashboard, it is automatically cached for MCP access.
- Secure connection: Uses token-based authentication, with a unique and revocable token for each user; all MCP communication is encrypted; only the user's own cached schema data is accessed.
- Metadata only: Does not access or store actual data; processes only schema metadata.
Usage
- Obtain an MCP token: Visit the SchemaFlow dashboard, connect a PostgreSQL or Supabase database, load and cache the schema, and generate an MCP token.
- Configure the AI-IDE: Taking Cursor as an example, open Settings, go to Features → MCP, click "Add New MCP Server", and add the server using the provided configuration. For Cline, configure it in its MCP settings. For specific configuration details, refer to the official documentation.
- Query using AI: Once configured, you can use natural language queries in the AI assistant, such as "Show my database schema", "What tables do I have?", "Show all relationships", "List database functions", "Analyze my database performance", "Check database security", "Check schema alignment", etc.
Use Cases
- Developers using AI-IDEs for development who need database schema context.
- Projects using PostgreSQL or Supabase databases.
- Scenarios requiring quick understanding of database structure, performance analysis, or security analysis.
- Teams that want to ensure their database schema follows best practices.
Limitations
- Only supports PostgreSQL and Supabase databases.
- Requires a SchemaFlow platform account and an MCP token.
- Accesses only schema metadata and does not involve actual data.
- Specific configuration steps and advanced features require reference to the official documentation (schemaflow.dev/mcp-guide).
- The project uses the MIT license.