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.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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: Turbular
🛠️ 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 deployed
Maintenance
Related MCP Connectors
- dataOAuthco.thinair
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
PostgreSQL, MySQL, OpenAPI/Swagger, and shared Agent Memory with scoped access.
- mcpOAuthcom.gibsonai
GibsonAI MCP server: manage your databases with natural language
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceEnables LLM agents to connect to and query multiple database types through a unified API, with schema normalization, query transformation, and support for PostgreSQL, MySQL, SQLite, BigQuery, Oracle, MS SQL, and Redshift.-
- FlicenseNot gradedqualityAmaintenanceEnables LLM agents to connect to and retrieve data from multiple database types through a unified API, including PostgreSQL, MySQL, SQLite, BigQuery, Oracle, MS SQL, and Redshift. It supports schema normalization and query transformation to make database access more compatible with natural-language workflows.-
- FlicenseNot gradedqualityAmaintenanceEnables LLM agents to connect to and query many database types—including PostgreSQL, MySQL, SQLite, BigQuery, Oracle, MS SQL, and Redshift—through a single unified API. It provides schema retrieval and optimized query execution with normalized schemas for easier natural-language-driven data access.-
- FlicenseNot gradedqualityAmaintenanceEnables LLM agents and AI applications to connect to and retrieve data from multiple database types such as PostgreSQL, MySQL, SQLite, BigQuery, Oracle, MS SQL, and Redshift through a unified API with schema normalization and query transformation.-