SQL MCP Server
Provides standardized tools for inspecting, querying, and interacting with MySQL databases, including executing queries, describing table structures, and retrieving database version information.
Enables connection to SAP IQ (Sybase) databases with intelligent handling of schema prefixes and server names, supporting query execution and database inspection.
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., "@SQL MCP Servershow me the top 10 customers by total orders"
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.
SQL MCP Server
The SQL MCP Server is a unified agentic interface that allows AI models (like Claude) to inspect, query, and interact with multiple types of databases through a single, standardized set of tools.
Instead of installing and configuring separate servers for MySQL, SQL Server, Oracle, etc., this single package handles them all by dynamically loading the correct "adapter" based on your configuration.
🚀 Features
Standardized Toolset: The AI always sees the same tools (
execute_query,describe_table,get_db_version), no matter if it's talking to Oracle or MySQL. This reduces hallucinations and improves query accuracy.Resources: Automatically exposes database tables as MCP Resources for easy inspection.
Smart Adapters:
✅ MySQL: Uses
mysql-connector-pythonwith connection pooling.✅ MSSQL: Uses
pymssqland auto-detects schema names (e.g.,dbo.Users).✅ Sybase / SAP IQ: Uses
pyodbcand intelligently handlesdba.prefixes and server names.✅ Oracle: Uses
oracledb(Thin mode) for easy connectivity without complex driver installs.
Unicode Ready: All connections default to UTF-8 to handle special characters seamlessly.
Related MCP server: Universal SQL MCP Server
🛠️ Installation
Clone the repository:
git clone https://github.com/BryR0/sql-mcp.git cd sql-mcpCreate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: .\venv\Scripts\activateInstall dependencies:
pip install -e .
⚙️ Configuration
You define which database to use via the DB_TYPE environment variable.
Supported Environment Variables
Variable | Description | Required | Default |
| Type of DB: | Yes |
|
| Hostname or IP address | Yes |
|
| Database username | Yes |
|
| Database password | Yes | (empty) |
| Database name | Yes |
|
| Port number | No | Auto (3306, 1433, etc.) |
| Connection string (Oracle/Sybase advanced) | No | (empty) |
| Explicit Server Name (Sybase only) | No | (empty) |
Claude Desktop Config Example
Add this to your claude_desktop_config.json. Note that DB_PORT is optional and will default to the standard port for the chosen DB type if omitted.
{
"mcpServers": {
"sql_mcp_mysql": {
"command": "C:\\path\\to\\venv\\python.exe",
"args": ["-m", "sql_mcp"],
"env": {
"DB_TYPE": "mysql",
"DB_HOST": "localhost",
"DB_USER": "root",
"DB_PASSWORD": "password",
"DB_DATABASE": "my_db"
}
},
"sql_mcp_mssql": {
"command": "C:\\path\\to\\venv\\python.exe",
"args": ["-m", "sql_mcp"],
"env": {
"DB_TYPE": "mssql",
"DB_HOST": "192.168.1.50",
"DB_USER": "sa",
"DB_PASSWORD": "password",
"DB_DATABASE": "DataWarehouse"
}
}
}
}🏗️ Architecture
The project uses an Adapter Pattern:
Server receives a request (e.g.,
execute_query).Factory checks
DB_TYPEand instantiates the correct class (e.g.,MSSQLAdapter).Adapter translates the generic request into specific driver calls (
pymssql,pyodbc, etc.).Response is formatted back to a standard JSON structure for the AI.
This means you can switch databases just by changing the config, without changing the AI's prompts or logic.
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.
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
- AlicenseBqualityDmaintenanceEnables AI models to perform MySQL database operations through a standardized interface, supporting secure connections, query execution, and comprehensive schema management.Last updated78533MIT
- Alicense-qualityDmaintenanceEnables secure interaction with multiple SQL database engines (MySQL, PostgreSQL, SQLite, SQL Server) through a standardized interface. Supports schema inspection, safe query execution, and controlled write operations with built-in security restrictions.Last updated5MIT
- AlicenseAqualityAmaintenanceEnables LLMs to interact with MySQL databases through standardized protocol, supporting database management, table operations, data queries, and modifications with configurable permission controls.Last updated15871MIT
- Alicense-qualityDmaintenanceProvides universal database operations for AI assistants through MCP, supporting 40+ databases including PostgreSQL, MySQL, MongoDB, Redis, and SQLite with built-in introspection tools for schema exploration.Last updated40MIT
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
SaaS intelligence for AI agents. 5 unified tools cover 1,000+ services with 91-96% token savings.
Universal AI API Orchestrator — 1,554 tools, 96 services. One install.
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/BryR0/sql-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server