通用数据库 MCP 服务器
@xiaoshi7915
About 通用数据库 MCP 服务器
一个通用数据库 MCP服务器,支持连接到各种关系型数据库系统并提供数据库结构信息和执行只读 SQL 查询
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"db": {
"command": "/path/to/start.sh",
"args": [
"--db-host",
"localhost",
"--db-user",
"root",
"--db-password",
"password",
"--db-name",
"mydatabase"
],
"env": {
"DB_TYPE": "mysql"
}
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
什么是通用数据库 MCP 服务器?
通用数据库 MCP 服务器是一个基于 Model Context Protocol 的服务器,用于连接多种关系型数据库并提供数据库结构信息和执行只读 SQL 查询。它面向需要与大语言模型安全交互数据库的开发者和数据分析师。
如何配置通用数据库 MCP 服务器?
可通过命令行参数或环境变量配置数据库连接(如 --db-host、--db-user、--db-password、--db-name)和服务器监听地址(--host、--port)。支持直接安装运行 start.sh,也支持 Docker 和 Docker Compose 部署。与 Claude 集成时需在 claude_desktop_config.json 中配置。
通用数据库 MCP 服务器的核心功能
- 支持 MySQL、PostgreSQL、Oracle、SQL Server 和 SQLite 数据库
- 获取数据库表结构、字段注释、主键、索引和外键信息
- 快速查看各表的样例数据
- 安全执行任意只读 SQL 查询
- 自动掩码敏感信息,保护隐私数据
通用数据库 MCP 服务器的主要应用场景
- 为大语言模型提供只读的数据库查询能力
- 在 AI 对话中获取数据库表结构和数据样本
- 自动化数据探索和报表生成
- 安全地暴露数据库元数据给 AI 代理
关于通用数据库 MCP 服务器的常见问题
通用数据库 MCP 服务器支持哪些数据库类型?
支持 MySQL、PostgreSQL、Oracle、SQL Server 和 SQLite。
如何配置数据库连接?
可以通过命令行参数(如 --db-host localhost)或环境变量(如 DB_HOST=localhost)配置。具体参数包括数据库类型、主机、端口、用户名、密码和数据库名称。
服务器是否允许写入操作?
不允许。服务器仅支持只读 SQL 查询,禁止修改数据库的操作。
如何与 Claude 桌面版集成?
在 claude_desktop_config.json 中添加 mcpServers.db 配置,指定 start.sh 路径和数据库连接参数。
服务器使用什么传输协议?
使用服务器推送事件(SSE)传输,不依赖 WebSocket。
Basic information
More Databases MCP servers
Dbhub
bytebaseZero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.

PostgreSQL
modelcontextprotocolModel Context Protocol Servers

Sqlite
modelcontextprotocolModel Context Protocol Servers
MCP Alchemy
runekaagaardA MCP (model context protocol) server that gives the LLM access to and knowledge about relational databases like SQLite, Postgresql, MySQL & MariaDB, Oracle, and MS-SQL.
Multi Database MCP Server
FreePeakA powerful multi-database server implementing the Model Context Protocol (MCP) to provide AI assistants with structured access to databases.
Comments