SQL MCP Server
Provides tools for managing MySQL databases, including listing tables, getting schemas, and executing SQL queries.
Provides tools for managing PostgreSQL databases, including listing tables, getting schemas, and executing SQL queries.
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 Serverlist tables in prod-mysql"
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
一个支持 MySQL 和 PostgreSQL 的动态 SQL MCP 服务。所有数据库连接在运行时通过 tool 参数传入,无需配置文件。
特性
支持 MySQL 和 PostgreSQL
SSE/HTTP transport,适合 Docker 远程部署
运行时动态传入数据库连接
可选 alias 注册机制,便于复用连接
提供
list_db_servers、list_database_tables、get_table_schema、query_database工具
Related MCP server: MCP Universal DB Client
快速开始
本地运行
pip install -r requirements.txt
python -m src.server --transport sse --port 3000Docker 运行
docker build -t sql-mcp .
docker run -p 3000:3000 sql-mcpMCP Tools
register_database
注册一个数据库连接别名。
{
"alias": "prod-mysql",
"connection": {
"type": "mysql",
"host": "localhost",
"port": 3306,
"user": "root",
"password": "secret",
"database": "mydb"
}
}list_db_servers
列出已注册的数据库连接(不返回密码)。
list_database_tables
列出数据库表。支持 alias 或完整 connection 对象。
{
"alias": "prod-mysql"
}get_table_schema
获取表结构。
{
"alias": "prod-mysql",
"table_name": "users"
}query_database
执行 SQL 查询。默认只读,可通过 allow_write: true 允许写入操作。
{
"alias": "prod-mysql",
"sql": "SELECT * FROM users LIMIT 10"
}安全提示
当前版本通过 tool 参数明文传入数据库凭据,适用于受控内网或开发环境。生产环境建议:
启用 SSE TLS
服务端通过环境变量加载凭据模板,tool 参数只传 alias
限制可访问的源 IP
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.
Latest Blog Posts
- 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/imShire/sql-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server