Skip to main content
Glama

mcp-sql-api/ ├── app/ │ ├── main.py # FastAPI entry point │ ├── api/ # Endpoint layer │ │ ├── sql.py # Raw SQL execution (step 1) │ │ ├── query.py # Query execution API (step 3) │ │ └── agent.py # GPT integration (step 2) │ │ │ ├── core/ # Core logic │ │ ├── db.py # DB connection (PostgreSQL) │ │ └── security.py # SQL control (SELECT restrictions, etc.) │ │ │ ├── services/ # Business logic │ │ ├── sql_executor.py # SQL execution engine │ │ ├── query_service.py # Template query execution │ │ ├── llm_service.py # SQL generation with GPT │ │ └── ir_service.py # Intermediate representation → SQL conversion (step 4) │ │ │ ├── models/ # Data models │ │ ├── schema.py # DB schema definition │ │ ├── query.py # Query definition (with semantics) │ │ └── ir.py # Intermediate representation (crucial) │ │ │ ├── repositories/ # DB access layer │ │ └── base.py │ │ │ └── utils/ │ ├── logger.py │ └── validator.py │ ├── metadata/ # ← Core of MCP │ ├── schema.yaml # Table definitions (for LLM) │ ├── metrics.yaml # KPI definitions │ └── queries.yaml # Semantic API definitions │ ├── prompts/ # Prompts for GPT │ ├── sql_generation.txt │ └── ir_generation.txt │ ├── tests/ │ ├── test_sql.py │ ├── test_query.py │ └── test_ir.py │ ├── requirements.txt └── README.md

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI assistants to query databases using natural language, with automatic schema discovery and SQL compilation.
    1,042 npm
    3,168
    Apache 2.0
  • A
    license
    A
    quality
    D
    maintenance
    Enables safe, AI-driven database interactions with schema discovery, intent validation, and session memory, supporting multiple databases.
    14
    26 PyPI
    2
    AGPL 3.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables natural language querying of SQL databases using AI, supporting multiple database types and automatic schema discovery.
    1
    MIT