mcp-sql-api
Allows interaction with a PostgreSQL database, enabling SQL queries and data retrieval through an MCP interface.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-sql-apishow me the top 5 customers by revenue"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to query databases using natural language, with automatic schema discovery and SQL compilation.1,1183,146Apache 2.0

Bollard MCPofficial
AlicenseAqualityBmaintenanceEnables safe, AI-driven database interactions with schema discovery, intent validation, and session memory, supporting multiple databases.142AGPL 3.0- AlicenseNot gradedqualityDmaintenanceEnables natural language querying of SQL databases using AI, supporting multiple database types and automatic schema discovery.1MIT
- AlicenseAqualityBmaintenanceEnables natural-language querying of databases via SQLBot, with datasource discovery, metadata inspection, and report generation.5MIT
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
The grounded data layer for any LLM: governed SQL, metrics, lineage and catalog over your data.
GibsonAI MCP server: manage your databases with natural language
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/o-kunimatsu/sql_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server