SQL Database Connector
БесплатноНе проверенProvides unified database connectivity across MySQL, Microsoft SQL Server, Oracle, and Sybase through standardized tools for executing queries, describing schem
Описание
Provides unified database connectivity across MySQL, Microsoft SQL Server, Oracle, and Sybase through standardized tools for executing queries, describing schemas, and browsing resources.
README
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.
- ✅ MySQL: Uses
- Unicode Ready: All connections default to UTF-8 to handle special characters seamlessly.
🛠️ 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 |
|---|---|---|---|
DB_TYPE |
Type of DB: mysql, mssql, sybase, oracle |
Yes | mysql |
DB_HOST |
Hostname or IP address | Yes | localhost |
DB_USER |
Database username | Yes | root |
DB_PASSWORD |
Database password | Yes | (empty) |
DB_DATABASE |
Database name | Yes | test |
DB_PORT |
Port number | No | Auto (3306, 1433, etc.) |
DB_DSN |
Connection string (Oracle/Sybase advanced) | No | (empty) |
DB_SERVER_NAME |
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.
Установка SQL Database Connector
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/bryr0/sql-mcpFAQ
SQL Database Connector MCP бесплатный?
Да, SQL Database Connector MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для SQL Database Connector?
Нет, SQL Database Connector работает без API-ключей и переменных окружения.
SQL Database Connector — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить SQL Database Connector в Claude Desktop, Claude Code или Cursor?
Открой SQL Database Connector на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
wenb1n-dev/SmartDB_MCP
A universal database MCP server supporting simultaneous connections to multiple databases. It provides tools for database operations, health analysis, SQL optim
автор: wenb1n-devPostgres Server
This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools
автор: madhurprashPostgres
Query your database in natural language
автор: AnthropicPostgreSQL
Read-only database access with schema inspection.
автор: modelcontextprotocolCompare SQL Database Connector with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории data
