Labsco
synechron-code logo

Synechron Text2SQL MCP Server

โ˜… 5

from synechron-code

Provides natural language access to relational databases using advanced language models, supporting multiple database types.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredNeeds API keys

Synechron Text2SQL MCP Server

Synechron's Text2SQL MCP Server is a Model Context Protocol (MCP) server. It provides MCP clients like Cursor, VSCode, and Claude Desktop, with natural language access to relational databases of various types โ€“ enabling users to ask questions of their data using natural language capabilities.

The server optimizes the quality of the results it generates by using a combination of schema and row-aware semantic search. Schemas and a sample of rows are indexed, enabling the server to more effectively generate suitable queries.

Features and Capabilities

The Text2SQL MCP server provides the following capabilities:

  • Natural Language to SQL: Natural language questions are converted into optimized SQL queries using advanced language models.
  • Multi-Database Support: Compatibility with PostgreSQL, MySQL, SQLite and Microsoft Fabric databases.
  • Retrieval Augmented Generation (RAG): Enhanced query generation by combining schema metadata and sampled row content.
  • Table Indexing: Enables embedding for database schemas and sample data, improving query relevance.
  • Response Synthesis: Generates natural language summaries of query results.
  • Markdown Formatting: Creates more readable responses.
  • Multiple Model Support: Works with OpenAI, Azure OpenAI, AWS Bedrock, and Ollama models.

Sample Data

The server ships with two example datasets.

  • Cyber Threats
  • ESG Ratings

Sample Client

A sample REPL is also included.


Using the Server with an Existing MCP Client

The server should be run with Docker. Use either of the following configurations to add it to a MCP client:

{
  "servers": {
    "text2sql": {
      "type": "streamable-http",
      "url": "http://localhost:8000/mcp"
    }
  }
}
{
  "mcpServers": {
    "text2sql": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--env-file",
        ".env",
        "709825985650.dkr.ecr.us-east-1.amazonaws.com/synechron/mcp-text2sql:0.0.10-2025.07.04-rc3",
        "server"
      ]
    }
  }
}

Tools

The Text2SQL MCP server dynamically creates MCP Tools and Prompts for the configured databases in the following format:

  • Text2Sql_DatabaseName: Query a specific database using natural language
    • Parameters:
      • query: Natural language query to execute against the database