Universal MCP
Allows interaction with MySQL databases, providing tools for executing queries, retrieving schema, listing tables, describing tables, and fetching paginated data.
Integrates OpenAI's GPT models to translate natural language questions into SQL queries, with conversation memory and security validation.
Allows interaction with PostgreSQL databases, providing tools for executing queries, retrieving schema, listing tables, describing tables, and fetching paginated data.
Allows interaction with SQLite databases, providing tools for executing queries, retrieving schema, listing tables, describing tables, and fetching paginated data.
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., "@Universal MCPShow me all customers from New York"
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.
Universal MCP
A database gateway that exposes a relational database to LLM clients through two paths: a set of MCP tools for direct, deterministic access, and a REST endpoint that translates natural language into validated SQL with conversation memory. Client-supplied SQL on either path goes through the same validator, so no query reaches the database without passing the same check.
Built on FastMCP and FastAPI, with GPT-4o for text-to-SQL and MySQL as the backing store.
Two access paths, and why
An MCP client and a person asking a question need different things from the same database, and collapsing them into one interface makes both worse.
MCP tools — deterministic access. An MCP client already knows what it wants: list the tables, describe one, page through rows, run a query. These are exposed as typed tools with no model in the loop, so the result is reproducible and cheap.
REST endpoint — natural language. A person asking "who are the five highest-paid engineers?" has no schema in hand. That path sends the schema to the model as context, gets SQL back, validates it, and executes it — with session history so follow-up questions resolve against what was just asked.
Related MCP server: mcp-ohmy-sql
Natural language pipeline
Schema as context — the database schema is serialized to YAML and cached, then supplied to the model so it generates SQL against real table and column names.
Generation — GPT-4o receives the schema, the session's prior turns, and the question at
temperature=0, constrained by prompt to emit a single rawSELECT.Validation — the generated SQL is parsed with
sqlparseand rejected unless it is exactly one statement of typeSELECT. Prompt rules are not treated as a security boundary; this check is.Execution — the validated query runs through the async SQLAlchemy engine with bound parameters.
Memory — the question, the SQL, and a summary of the result set are appended to a per-session JSON file, so context carries forward without replaying full result sets into the prompt.
MCP tools
Tool | Description |
| Execute a client-supplied query; rejected unless it parses to a single |
| List every table in the database |
| Table listing for client discovery |
| Column names, types, keys and nullability for one table |
| Paginated row access via |
| Check a query against the read-only policy before running it |
REST API
Endpoint | Method | Description |
|
| Takes |
|
| Liveness check that issues a real query against the database |
|
| Service banner |
An interactive terminal client (scripts/chat.py) drives the NLQ endpoint, rendering generated SQL with syntax highlighting and results as a formatted table.
Security
Read-only by construction. Every query originating outside the server — whether typed by an MCP client or generated by the model — is parsed and must resolve to a single
SELECTstatement.INSERT,UPDATE,DELETEandDROPnever pass validation. Internal introspection queries (SHOW TABLES,DESCRIBE) are server-constructed and bypass the check by design.No statement chaining. Multi-statement input is rejected at parse time, closing off
SELECT ...; DROP TABLE ...style payloads.Bound parameters. Pagination and other server-constructed queries pass values as bound parameters rather than string interpolation.
Fail closed. A parse error, an empty query, or an LLM error resolves to rejection, not to execution.
Project layout
api/ FastAPI app — NLQ route, health check
core/
mcp/ FastMCP server and tool definitions
database/ Async engine, connection manager, query executor
schema/ Schema-to-YAML generation
security/ SQL validation
services/ LLM, schema, and query orchestration
storage/ File-backed session store for conversation history
scripts/ Database setup, interactive chat client
tests/ Unit and integration testsQuick start
Prerequisites: Python 3.11+, a running MySQL server, an OpenAI API key.
git clone https://github.com/nandeshkanagaraju/mcp-server-bridge.git
cd mcp-server-bridge
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # add OPENAI_API_KEY and your MySQL credentialsCreate the database and user, then seed it with sample tables and generated data:
mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS company_db;"
python -m scripts.setup_databaseRun the REST API, and the chat client in a second terminal:
uvicorn api.main:app --reload --port 8000
python scripts/chat.pyThe MCP server runs separately, over stdio, for MCP-capable clients:
python -m core.mcp.serverConfiguration
All settings load from .env via pydantic-settings.
Variable | Purpose | Default |
| Text-to-SQL generation | required |
| MySQL target |
|
| MySQL credentials | — |
| Query timeout in seconds |
|
| Maximum accepted query length |
|
| Log verbosity |
|
Logs stream to the console and to mcp_server.log.
Technology stack
Layer | Technology |
MCP server | FastMCP, MCP Python SDK |
REST API | FastAPI, Uvicorn |
Language model | OpenAI GPT-4o |
Database access | SQLAlchemy (async), aiomysql, PyMySQL |
Validation |
|
Configuration |
|
Terminal client |
|
Sample data | Faker |
Testing | pytest, |
Testing
pytest tests/unit/ # SQL validation rules
pytest tests/integration/ # NLQ endpoint, mocked LLMDesign decisions
Validation sits outside the prompt. The model is asked for read-only SQL, but a parser decides what actually executes. A prompt is guidance; a parse tree is enforcement.
One validator for both paths. The MCP tool and the NLQ endpoint route client-supplied SQL through the same parser check, so the read-only rule cannot drift between interfaces. They still execute over separate connection stacks — consolidating those is open work.
Summarized history, not stored result sets. Conversation memory keeps the question, the SQL, and a row-count summary — enough for follow-ups without growing the prompt with data.
Schema cached, not re-read per request. Schema changes rarely; regenerating YAML on every question would add latency for nothing.
Sessions on disk. A file-backed store keeps history across restarts with no extra infrastructure at development scale.
Limitations and next steps
MySQL only. The adapter package is scaffolded for PostgreSQL and SQLite, but only MySQL is implemented.
Schema source is a fixture.
services/schema_service.pyreturns a hardcoded schema; live introspection against the connected database is the next step.MCP tools use their own connection path. They connect directly rather than through the shared async engine, and should be consolidated onto it.
Table names are interpolated, not bound.
describe_tableand the pagination query build SQL by f-string ontable_name, which is client-supplied. An identifier allowlist check is needed.Test coverage is narrow. Validation and the NLQ endpoint are covered; the tool layer and adapters are not.
No rate limiting or auth on the REST API. Both are scaffolded and unimplemented.
Nandesh Kanagaraju — github.com/nandeshkanagaraju
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
- Alicense-quality-maintenanceA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.11
- -license-qualityCmaintenanceAn MCP server that bridges AI assistants with SQL databases, enabling natural language querying across multiple database types with built-in optimization and security.3
- Alicense-qualityDmaintenanceA unified MCP server for querying and managing multiple database types (PostgreSQL, MySQL, SQL Server, etc.) via natural language through AI assistants.GPL 3.0
- AlicenseBqualityDmaintenanceA powerful MCP server for Microsoft SQL Server that connects AI assistants directly to your SQL Server databases with enterprise-grade security controls.38853MIT
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
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/nandeshkanagaraju/mcp-server-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server