多数据库MCP服务器
一个强大的多数据库服务器,通过模型上下文协议(MCP)为AI助手提供结构化数据库访问。
快速入门
使用 Docker
- 拉取最新镜像: docker pull freepeak/db-mcp-server:latest
- 运行容器并挂载配置文件:
docker run -p 9092:9092
-v $(pwd)/config.json:/app/my-config.json
-e TRANSPORT_MODE=sse
-e CONFIG_PATH=/app/my-config.json
freepeak/db-mcp-server - 支持的平台:
- Intel/AMD:
--platform linux/amd64
- ARM64:
--platform linux/arm64
- Intel/AMD:
从源码运行
- 克隆仓库: git clone https://github.com/FreePeak/db-mcp-server.git
- 构建服务器: make build
- 启动服务器: ./bin/server -t sse -c config.json
配置文件示例
创建 config.json
文件定义数据库连接:
{
"connections": [
{
"id": "mysql1",
"type": "mysql",
"host": "localhost",
"port": 3306,
"name": "db1",
"user": "user1",
"password": "password1"
}
]
}