内容
<p align="center">
<img src="assets/logo.png" alt="Universal DB MCP Logo" width="200">
</p>
<h1 align="center">Universal DB MCP</h1>
<p align="center">
<strong>将 AI 连接到您的数据库,使用自然语言</strong>
</p>
<p align="center">
一个通用的数据库连接器,实现了模型上下文协议(MCP)和 HTTP API,使 AI 助手能够使用自然语言查询和分析您的数据库。与 Claude Desktop、Cursor、Windsurf、VS Code、ChatGPT 和 50 多个其他平台兼容。
</p>
<p align="center">
<a href="https://www.npmjs.com/package/universal-db-mcp"><img src="https://img.shields.io/npm/v/universal-db-mcp.svg?style=flat-square&color=blue" alt="npm version"></a>
<a href="https://www.npmjs.com/package/universal-db-mcp"><img src="https://img.shields.io/npm/dm/universal-db-mcp.svg?style=flat-square&color=green" alt="npm downloads"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square" alt="License: MIT"></a>
<a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen?style=flat-square" alt="Node.js Version"></a>
<a href="https://github.com/Anarkh-Lee/universal-db-mcp/stargazers"><img src="https://img.shields.io/github/stars/Anarkh-Lee/universal-db-mcp?style=flat-square" alt="GitHub Stars"></a>
</p>
<p align="center">
<a href="#-features">功能</a> •
<a href="#-quick-start">快速开始</a> •
<a href="#-supported-databases">数据库</a> •
<a href="#-documentation">文档</a> •
<a href="#-contributing">贡献</a>
</p>
<p align="center">
<a href="./README.md">English</a> | <a href="./README.zh-CN.md">中文文档</a>
</p>
---
## 为什么选择 Universal DB MCP?
想象一下,您可以问您的 AI 助手:“显示本月按订单价值排名前 10 的客户”,而无需编写 SQL 即可从数据库中获得即时结果。Universal DB MCP 通过模型上下文协议(MCP)和 HTTP API 将 AI 助手与您的数据库连接起来,从而使这一切成为可能。
```
您:“最近 30 天注册的用户平均订单价值是多少?”
AI:让我查询一下……
┌─────────────────────────────────────┐
│ 平均订单价值:$127.45 │
│ 新用户总数:1,247 │
│ 有订单的用户:892 (71.5%) │
└─────────────────────────────────────┘
```
## ✨ 功能
- **支持 17 种数据库** - MySQL、PostgreSQL、Redis、Oracle、SQL Server、MongoDB、SQLite 和 10 种中国国产数据库
- **支持 55+ 平台** - 与 Claude Desktop、Cursor、VS Code、ChatGPT、Dify 和 [50+ 其他平台](#-supported-platforms) 兼容
- **灵活的架构** - 2 种启动模式(stdio/http)和 4 种访问方式:MCP stdio、MCP SSE、MCP Streamable HTTP 和 REST API
- **安全第一** - 默认只读模式,防止意外数据修改
- **智能缓存** - 带有可配置 TTL 的模式缓存,实现极快的性能
- **批量查询优化** - 大型数据库的模式检索速度最高可达 100 倍
- **模式增强** - 表注释、隐含关系推理,以提高 Text2SQL 的准确性
- **多模式支持** - 自动发现所有用户模式(PostgreSQL、SQL Server、Oracle、DM 等)
- **数据掩码** - 自动保护敏感数据(电话、电子邮件、身份证、银行卡等)
- **连接稳定性** - 连接池、TCP Keep-Alive 和长会话自动重新连接
### 性能改进
| 表数量 | 之前 | 之后 | 改进 |
|--------|--------|-------|-------------|
| 50 张表 | ~5s | ~200ms | **25 倍快** |
| 100 张表 | ~10s | ~300ms | **33 倍快** |
| 500 张表 | ~50s | ~500ms | **100 倍快** |
## 🚀 快速开始
### 安装
```bash
npm install -g universal-db-mcp
```
### MCP 模式(Claude Desktop)
将以下内容添加到您的 Claude Desktop 配置文件中:
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
```json
{
"mcpServers": {
"my-database": {
"command": "npx",
"args": [
"universal-db-mcp",
"--type", "mysql",
"--host", "localhost",
"--port", "3306",
"--user", "root",
"--password", "your_password",
"--database", "your_database"
]
}
}
}
```
重启 Claude Desktop 并开始提问:
- *"显示 users 表的结构"*
- *"统计过去 7 天的订单"*
- *"查找销售排名前 5 的产品"*
### HTTP API 模式
```bash
# 设置环境变量
export MODE=http
export HTTP_PORT=3000
export API_KEYS=your-secret-key
# 启动服务器
npx universal-db-mcp
```
```bash
# 测试 API
curl http://localhost:3000/api/health
```
### MCP SSE 模式(Dify 和远程访问)
在 HTTP 模式下运行服务器时,还会通过 SSE(Server-Sent Events)和 Streamable HTTP 暴露 MCP 协议端点。这允许像 Dify 这样的平台直接使用 MCP 协议连接。
**SSE 端点(旧版):**
```
GET http://localhost:3000/sse?type=mysql&host=localhost&port=3306&user=root&password=xxx&database=mydb
```
**Streamable HTTP 端点(MCP 2025 规范,推荐):**
```
POST http://localhost:3000/mcp
Headers:
X-DB-Type: mysql
X-DB-Host: localhost
X-DB-Port: 3306
X-DB-User: root
X-DB-Password: your_password
X-DB-Database: your_database
Body: MCP JSON-RPC 请求
```
| 端点 | 方法 | 描述 |
|----------|--------|-------------|
| `/sse` | GET | 建立 SSE 连接(旧版) |
| `/sse/message` | POST | 向 SSE 会话发送消息 |
| `/mcp` | POST | Streamable HTTP 端点(推荐) |
| `/mcp` | GET | Streamable HTTP 的 SSE 流 |
| `/mcp` | DELETE | 关闭会话 |
参阅 [Dify 集成指南](./docs/integrations/DIFY.md) 以获取详细的设置说明。
## 📊 支持的数据库
| 数据库 | 类型 | 默认端口 | 类别 |
|----------|------|--------------|----------|
| MySQL | `mysql` | 3306 | 开源 |
| PostgreSQL | `postgres` | 5432 | 开源 |
| Redis | `redis` | 6379 | NoSQL |
| Oracle | `oracle` | 1521 | 商业 |
| SQL Server | `sqlserver` | 1433 | 商业 |
| MongoDB | `mongodb` | 27017 | NoSQL |
| SQLite | `sqlite` | - | 嵌入式 |
| Dameng (达梦) | `dm` | 5236 | 中国国产 |
| KingbaseES | `kingbase` | 54321 | 中国国产 |
| GaussDB | `gaussdb` | 5432 | 中国国产(华为) |
| OceanBase | `oceanbase` | 2881 | 中国国产(蚂蚁) |
| TiDB | `tidb` | 4000 | 分布式 |
| ClickHouse | `clickhouse` | 8123 | OLAP |
| PolarDB | `polardb` | 3306 | 云(阿里巴巴) |
| Vastbase | `vastbase` | 5432 | 中国国产 |
| HighGo | `highgo` | 5866 | 中国国产 |
| GoldenDB | `goldendb` | 3306 | 中国国产(ZTE) |
## 🏗️ 架构
```
┌─────────────────────────────────────────────────────────────────────────┐
│ Universal DB MCP │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ 启动模式: │
│ ┌────────────────────────────┬────────────────────────────────────┐ │
│ │ stdio 模式 │ http 模式 │ │
│ │ (npm run start:mcp) │ (npm run start:http) │ │
│ └─────────────┬──────────────┴───────────────┬────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────────────────┐ ┌───────────────────────────────────┐ │
│ │ MCP 协议 │ │ HTTP 服务器 │ │
│ │ (stdio 传输) │ │ │ │
│ │ │ │ ┌─────────────────────────────┐ │ │
│ │ 工具: │ │ │ MCP 协议 │ │ │
│ │ • 执行查询 │ │ │ (SSE / Streamable HTTP) │ │ │
│ │ • 获取模式 │ │ │ │ │ │
│ │ • 获取表信息 │ │ │ 工具:(与 stdio 相同) │ │ │
│ │ • 清除缓存 │ │ │ • 执行查询 │ │ │
│ │ • 获取枚举值 │ │ │ • 获取模式 │ │ │
│ │ • 获取样本数据 │ │ │ • 获取表信息 │ │ │
│ │ • 连接数据库 │ │ │ • 清除缓存 │ │ │
│ │ • 断开数据库连接 │ │ │ • 获取枚举值 │ │ │
│ │ • 获取连接状态 │ │ │ • 获取样本数据 │ │ │
│ │ │ │ │ • 连接数据库 │ │ │
│ │ 适用于:Claude Desktop、 │ │ │ • 断开数据库连接 │ │ │
│ │ Cursor 等 │ │ │ • 获取连接状态 │ │ │
│ └─────────────┬───────────┘ │ │ │ │ │
│ │ │ │ 适用于:Dify、远程访问 │ │ │
│ │ │ └──────────────┬──────────────┘ │ │
│ │ │ │ │ │
│ │ │ ┌──────────────┴──────────────┐ │ │
│ │ │ │ REST API │ │ │
│ │ │ │ │ │ │
│ │ │ │ 端点: │ │ │
│ │ │ │ • /api/connect │ │ │
│ │ │ │ • /api/query │ │ │
│ │ │ │ • /api/schema │ │ │
│ │ │ │ • ... (10+ 端点) │ │ │
│ │ │ │ │ │ │
│ │ │ │ 适用于:Coze、n8n、自定义 │ │ │
│ │ │ └──────────────┬──────────────┘ │ │
│ │ └─────────────────┼─────────────────┘ │
│ │ │ │
│ └──────────────────┬───────────────┘ │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ 核心业务逻辑 │ │
│ │ • 查询执行 • 模式缓存 │ │
│ │ • 安全验证 • 连接管理 │ │
│ └──────────────────────────────────┬───────────────────────────────┘ │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ 数据库适配层 │ │
│ │ MySQL │ PostgreSQL │ Redis │ Oracle │ MongoDB │ SQLite │ ... │ │
│ │ (连接池 + TCP Keep-Alive + 自动重试) │ │
│ └──────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘
```
## 🔒 安全
默认情况下,Universal DB MCP 以 **只读模式** 运行,阻止所有写操作(INSERT、UPDATE、DELETE、DROP 等)。
### 权限模式
支持细粒度权限控制,配置灵活:
| 模式 | 允许操作 | 描述 |
|------|-------------------|-------------|
| `safe`(默认) | SELECT | 只读,最安全 |
| `readwrite` | SELECT、INSERT、UPDATE | 读写但不删除 |
| `full` | 所有操作 | 完全控制(危险!) |
| `custom` | 自定义组合 | 通过 `--permissions` 指定 |
**权限类型:**
- `read` - SELECT 查询(始终包含)
- `insert` - INSERT、REPLACE
- `update` - UPDATE
- `delete` - DELETE、TRUNCATE
- `ddl` - CREATE、ALTER、DROP、RENAME
**使用示例:
```bash
# 只读模式(默认)
npx universal-db-mcp --type mysql ...
# 读写但不删除
npx universal-db-mcp --type mysql --permission-mode readwrite ...
# 自定义:仅读和插入
npx universal-db-mcp --type mysql --permissions read,insert ...
# 完全控制(等同于 --danger-allow-write)
npx universal-db-mcp --type mysql --permission-mode full ...
```
**按传输方式配置权限:
> ⚠️ 不同的传输方式使用不同的参数命名约定!
| 传输方式 | 参数位置 | 权限模式 | 自定义权限 |
|-----------|-------------------|-----------------|-------------------|
| STDIO(Claude Desktop) | 命令行参数 | `--permission-mode` | `--permissions` |
| SSE(Dify 等) | URL 查询 | `permissionMode` | `permissions` |
| Streamable HTTP | HTTP 头 | `X-DB-Permission-Mode` | `X-DB-Permissions` |
| REST API | JSON 正文 | `permissionMode` | `permissions` |
**最佳实践:**
- 永远不要在生产环境中启用写模式
- 使用专用的只读数据库账户
- 通过 VPN 或堡垒主机连接
- 定期审计查询日志
## 🔌 支持的平台
Universal DB MCP 与任何支持 MCP 协议或 REST API 的平台合作。以下是综合列表:
### AI 驱动的代码编辑器和 IDE
| 平台 | 访问方式 | 描述 | 指南 |
|----------|---------------|-------------|-------|
| [Cursor](https://cursor.sh/) | MCP stdio | 带有内置 MCP 支持的 AI 驱动代码编辑器 | [EN](./docs/integrations/CURSOR.md) / [中文](./docs/integrations/CURSOR.zh-CN.md) |
| [Windsurf](https://codeium.com/windsurf) | MCP stdio | Codeium 的 AI IDE,带有 Cascade 代理 | [EN](./docs/integrations/WINDSURF.md) / [中文](./docs/integrations/WINDSURF.zh-CN.md) |
| [VS Code](https://code.visualstudio.com/) | MCP stdio / REST API | 通过 GitHub Copilot 代理模式或 Cline/Continue 扩展 | [EN](./docs/integrations/VSCODE.md) / [中文](./docs/integrations/VSCODE.zh-CN.md) |
| [Zed](https://zed.dev/) | MCP stdio | 高性能开源代码编辑器 | [EN](./docs/integrations/ZED.md) / [中文](./docs/integrations/ZED.zh-CN.md) |
| [IntelliJ IDEA](https://www.jetbrains.com/idea/) | MCP stdio | 带有 MCP 支持的 JetBrains IDE(2025.1+) | [EN](./docs/integrations/JETBRAINS.md) / [中文](./docs/integrations/JETBRAINS.zh-CN.md) |
| [PyCharm](https://www.jetbrains.com/pycharm/) | MCP stdio | JetBrains Python IDE | [EN](./docs/integrations/JETBRAINS.md) / [中文](./docs/integrations/JETBRAINS.zh-CN.md) |
| [WebStorm](https://www.jetbrains.com/webstorm/) | MCP stdio | JetBrains JavaScript IDE | [EN](./docs/integrations/JETBRAINS.md) / [中文](./docs/integrations/JETBRAINS.zh-CN.md) |
| [Android Studio](https://developer.android.com/studio) | MCP stdio | 通过 JetBrains MCP 插件 | [EN](./docs/integrations/JETBRAINS.md) / [中文](./docs/integrations/JETBRAINS.zh-CN.md) |
| [Neovim](https://neovim.io/) | MCP stdio | 通过 MCPHub.nvim 插件 | [EN](./docs/integrations/NEOVIM.md) / [中文](./docs/integrations/NEOVIM.zh-CN.md) |
| [Emacs](https://www.gnu.org/software/emacs/) | MCP stdio | 通过 mcp.el 包 | [EN](./docs/integrations/EMACS.md) / [中文](./docs/integrations/EMACS.zh-CN.md) |
### AI 编码助手
| 平台 | 访问方式 | 描述 | 指南 |
|----------|---------------|-------------|-------|
| [Claude Code](https://claude.ai/code) | MCP stdio | Anthropic 的智能编码工具 | [EN](./docs/integrations/CLAUDE-CODE.md) / [中文](./docs/integrations/CLAUDE-CODE.zh-CN.md) |
| [GitHub Copilot](https://github.com/features/copilot) | MCP stdio | VS Code/JetBrains 中的代理模式 | [EN](./docs/integrations/GITHUB-COPILOT.md) / [中文](./docs/integrations/GITHUB-COPILOT.zh-CN.md) |
| [Cline](https://github.com/cline/cline) | MCP stdio / REST API | VS Code 的自主编码代理 | [EN](./docs/integrations/CLINE.md) / [中文](./docs/integrations/CLINE.zh-CN.md) |
| [Continue](https://continue.dev/) | MCP stdio | 开源 AI 代码助手 | [EN](./docs/integrations/CONTINUE.md) / [中文](./docs/integrations/CONTINUE.zh-CN.md) |
| [Roo Code](https://github.com/roovet/roo-code) | MCP stdio | Cline 的 VS Code 分叉 | [EN](./docs/integrations/ROO-CODE.md) / [中文](./docs/integrations/ROO-CODE.zh-CN.md) |
| [Sourcegraph Cody](https://sourcegraph.com/cody) | MCP stdio | AI 编码助手 | [EN](./docs/integrations/SOURCEGRAPH-CODY.md) / [中文](./docs/integrations/SOURCEGRAPH-CODY.zh-CN.md) |
| [Amazon Q Developer](https://aws.amazon.com/q/developer/) | MCP stdio | AWS AI 编码助手 | [EN](./docs/integrations/AMAZON-Q-DEVELOPER.md) / [中文](./docs/integrations/AMAZON-Q-DEVELOPER.zh-CN.md) |
| [Devin](https://devin.ai/) | MCP stdio | AI 软件工程师 | [EN](./docs/integrations/DEVIN.md) / [中文](./docs/integrations/DEVIN.zh-CN.md) |
| [Goose](https://github.com/block/goose) | MCP stdio | Block 的 AI 编码代理 | [EN](./docs/integrations/GOOSE.md) / [中文](./docs/integrations/GOOSE.zh-CN.md) |
| [Gemini CLI](https://github.com/google-gemini/gemini-cli) | MCP stdio | Google 的命令行 AI 工具 | [EN](./docs/integrations/GEMINI-CLI.md) / [中文](./docs/integrations/GEMINI-CLI.zh-CN.md) |
### 桌面端 AI 聊天应用
| 平台 | 访问方式 | 描述 | 指南 |
|----------|---------------|-------------|-------|
| [Claude 桌面端](https://claude.ai/download) | MCP stdio | Anthropic 官方桌面端应用 | [英文](./docs/integrations/CLAUDE-DESKTOP.md) / [中文](./docs/integrations/CLAUDE-DESKTOP.zh-CN.md) |
| [ChatGPT 桌面端](https://openai.com/chatgpt/desktop/) | MCP SSE/Streamable HTTP | OpenAI 桌面端应用,支持 MCP 连接器 | [英文](./docs/integrations/CHATGPT.md) / [中文](./docs/integrations/CHATGPT.zh-CN.md) |
| [Cherry Studio](https://github.com/kangfenmao/cherry-studio) | MCP stdio | 多模型桌面端聊天应用 | [英文](./docs/integrations/CHERRY-STUDIO.md) / [中文](./docs/integrations/CHERRY-STUDIO.zh-CN.md) |
| [LM Studio](https://lmstudio.ai/) | MCP stdio | 运行本地大型语言模型,支持 MCP | [英文](./docs/integrations/LM-STUDIO.md) / [中文](./docs/integrations/LM-STUDIO.zh-CN.md) |
| [Jan](https://jan.ai/) | MCP stdio | 开源 ChatGPT 替代品 | [英文](./docs/integrations/JAN.md) / [中文](./docs/integrations/JAN.zh-CN.md) |
| [Msty](https://msty.app/) | MCP stdio | 桌面端 AI 聊天应用 | [英文](./docs/integrations/MSTY.md) / [中文](./docs/integrations/MSTY.zh-CN.md) |
| [LibreChat](https://github.com/danny-avila/LibreChat) | MCP stdio | 开源聊天界面 | [英文](./docs/integrations/LIBRECHAT.md) / [中文](./docs/integrations/LIBRECHAT.zh-CN.md) |
| [Witsy](https://witsy.app/) | MCP stdio | 桌面端 AI 助手 | [英文](./docs/integrations/WITSY.md) / [中文](./docs/integrations/WITSY.zh-CN.md) |
| [5ire](https://github.com/5ire-tech/5ire) | MCP stdio | 跨平台 AI 聊天 | [英文](./docs/integrations/5IRE.md) / [中文](./docs/integrations/5IRE.zh-CN.md) |
| [ChatMCP](https://github.com/daodao97/chatmcp) | MCP stdio | MCP 聚焦的聊天界面 | [英文](./docs/integrations/CHATMCP.md) / [中文](./docs/integrations/CHATMCP.zh-CN.md) |
| [HyperChat](https://github.com/BigSweetPotatoStudio/HyperChat) | MCP stdio | 跨平台聊天应用 | [英文](./docs/integrations/HYPERCHAT.md) / [中文](./docs/integrations/HYPERCHAT.zh-CN.md) |
| [Tome](https://github.com/runebook/tome) | MCP stdio | macOS 应用,用于本地大型语言模型 | [英文](./docs/integrations/TOME.md) / [中文](./docs/integrations/TOME.zh-CN.md) |
### 基于 Web 的 AI 平台
| 平台 | 访问方式 | 描述 | 指南 |
|----------|---------------|-------------|-------|
| [Claude.ai](https://claude.ai/) | MCP SSE/Streamable HTTP | Anthropic 的 Web 界面 | [英文](./docs/integrations/CLAUDE-AI.md) / [中文](./docs/integrations/CLAUDE-AI.zh-CN.md) |
| [ChatGPT](https://chat.openai.com/) | MCP SSE/Streamable HTTP | 通过自定义连接器 | [英文](./docs/integrations/CHATGPT.md) / [中文](./docs/integrations/CHATGPT.zh-CN.md) |
| [Dify](https://dify.ai/) | MCP SSE/Streamable HTTP | LLM 应用开发平台 | [英文](./docs/integrations/DIFY.md) / [中文](./docs/integrations/DIFY.zh-CN.md) |
| [Coze](https://www.coze.com/) | REST API | 字节跳动的 AI 机器人平台 | [英文](./docs/integrations/COZE.md) / [中文](./docs/integrations/COZE.zh-CN.md) |
| [n8n](https://n8n.io/) | REST API / MCP | 工作流自动化平台 | [英文](./docs/integrations/N8N.md) / [中文](./docs/integrations/N8N.zh-CN.md) |
| [Replit](https://replit.com/) | MCP stdio | 在线 IDE,支持 AI 代理 | [英文](./docs/integrations/REPLIT.md) / [中文](./docs/integrations/REPLIT.zh-CN.md) |
| [MindPal](https://mindpal.io/) | MCP SSE/Streamable HTTP | 无代码 AI 代理构建器 | [英文](./docs/integrations/MINDPAL.md) / [中文](./docs/integrations/MINDPAL.zh-CN.md) |
### 代理框架和 SDK
| 平台 | 访问方式 | 描述 | 指南 |
|----------|---------------|-------------|-------|
| [LangChain](https://langchain.com/) | MCP stdio | 流行的 LLM 框架 | [英文](./docs/integrations/LANGCHAIN.md) / [中文](./docs/integrations/LANGCHAIN.zh-CN.md) |
| [Smolagents](https://github.com/huggingface/smolagents) | MCP stdio | Hugging Face 代理库 | [英文](./docs/integrations/SMOLAGENTS.md) / [中文](./docs/integrations/SMOLAGENTS.zh-CN.md) |
| [OpenAI 代理 SDK](https://platform.openai.com/) | MCP SSE/Streamable HTTP | OpenAI 的代理框架 | [英文](./docs/integrations/OPENAI-AGENTS-SDK.md) / [中文](./docs/integrations/OPENAI-AGENTS-SDK.zh-CN.md) |
| [Amazon Bedrock 代理](https://aws.amazon.com/bedrock/) | MCP SSE/Streamable HTTP | AWS AI 代理服务 | [英文](./docs/integrations/AMAZON-BEDROCK-AGENTS.md) / [中文](./docs/integrations/AMAZON-BEDROCK-AGENTS.zh-CN.md) |
| [Google ADK](https://cloud.google.com/) | MCP stdio | Google 的代理开发工具包 | [英文](./docs/integrations/GOOGLE-ADK.md) / [中文](./docs/integrations/GOOGLE-ADK.zh-CN.md) |
| [Vercel AI SDK](https://sdk.vercel.ai/) | MCP stdio | Vercel 的 AI 开发工具包 | [英文](./docs/integrations/VERCEL-AI-SDK.md) / [中文](./docs/integrations/VERCEL-AI-SDK.zh-CN.md) |
| [Spring AI](https://spring.io/projects/spring-ai) | MCP stdio | Java/Spring AI 框架 | [英文](./docs/integrations/SPRING-AI.md) / [中文](./docs/integrations/SPRING-AI.zh-CN.md) |
### 命令行工具和终端
| 平台 | 访问方式 | 描述 | 指南 |
|----------|---------------|-------------|-------|
| [Claude Code CLI](https://claude.ai/code) | MCP stdio | 基于终端的编码代理 | [英文](./docs/integrations/CLAUDE-CODE.md) / [中文](./docs/integrations/CLAUDE-CODE.zh-CN.md) |
| [Warp](https://www.warp.dev/) | MCP stdio | AI 驱动的终端 | [英文](./docs/integrations/WARP.md) / [中文](./docs/integrations/WARP.zh-CN.md) |
| [Oterm](https://github.com/ggozad/oterm) | MCP stdio | 通过 CLI 与 Ollama 聊天 | [英文](./docs/integrations/OTERM.md) / [中文](./docs/integrations/OTERM.zh-CN.md) |
| [MCPHost](https://github.com/mark3labs/mcphost) | MCP stdio | 与大型语言模型聊天的 CLI | [英文](./docs/integrations/MCPHOST.md) / [中文](./docs/integrations/MCPHOST.zh-CN.md) |
### 生产力和自动化
| 平台 | 访问方式 | 描述 | 指南 |
|----------|---------------|-------------|-------|
| [Raycast](https://raycast.com/) | MCP stdio | macOS 生产力启动器 | [英文](./docs/integrations/RAYCAST.md) / [中文](./docs/integrations/RAYCAST.zh-CN.md) |
| [Notion](https://notion.so/) | MCP SSE/Streamable HTTP | 支持 AI 集成的 workspace | [英文](./docs/integrations/NOTION.md) / [中文](./docs/integrations/NOTION.zh-CN.md) |
| [Obsidian](https://obsidian.md/) | MCP stdio | 通过 MCP Tools 插件 | [英文](./docs/integrations/OBSIDIAN.md) / [中文](./docs/integrations/OBSIDIAN.zh-CN.md) |
| [Home Assistant](https://www.home-assistant.io/) | MCP stdio | 家庭自动化平台 | [英文](./docs/integrations/HOME-ASSISTANT.md) / [中文](./docs/integrations/HOME-ASSISTANT.zh-CN.md) |
### 消息平台集成
| 平台 | 访问方式 | 描述 | 指南 |
|----------|---------------|-------------|-------|
| [Slack](https://slack.com/) | MCP stdio / REST API | 通过 Slack MCP 机器人 | [英文](./docs/integrations/SLACK.md) / [中文](./docs/integrations/SLACK.zh-CN.md) |
| [Discord](https://discord.com/) | MCP stdio / REST API | 通过 Discord MCP 机器人 | [英文](./docs/integrations/DISCORD.md) / [中文](./docs/integrations/DISCORD.zh-CN.md) |
| [Mattermost](https://mattermost.com/) | MCP stdio | 开源消息平台 | [英文](./docs/integrations/MATTERMOST.md) / [中文](./docs/integrations/MATTERMOST.zh-CN.md) |
### 本地大型语言模型运行器
| 平台 | 访问方式 | 描述 | 指南 |
|----------|---------------|-------------|-------|
| [Ollama](https://ollama.ai/) | MCP stdio | 运行本地大型语言模型 | [英文](./docs/integrations/OLLAMA.md) / [中文](./docs/integrations/OLLAMA.zh-CN.md) |
| [LM Studio](https://lmstudio.ai/) | MCP stdio | 本地大型语言模型桌面应用 | [英文](./docs/integrations/LM-STUDIO.md) / [中文](./docs/integrations/LM-STUDIO.zh-CN.md) |
| [Jan](https://jan.ai/) | MCP stdio | 离线 ChatGPT 替代品 | [英文](./docs/integrations/JAN.md) / [中文](./docs/integrations/JAN.zh-CN.md) |
### 开发和测试工具
| 平台 | 访问方式 | 描述 | 指南 |
|----------|---------------|-------------|-------|
| [MCP Inspector](https://github.com/modelcontextprotocol/inspector) | MCP stdio | 官方 MCP 调试工具 | [英文](./docs/integrations/MCP-INSPECTOR.md) / [中文](./docs/integrations/MCP-INSPECTOR.zh-CN.md) |
| [Postman](https://postman.com/) | REST API / MCP | API 测试平台 | [英文](./docs/integrations/POSTMAN.md) / [中文](./docs/integrations/POSTMAN.zh-CN.md) |
> **注意**: 任何兼容 MCP 的客户端都可以通过 stdio(本地)或 SSE/Streamable HTTP(远程)连接。任何 HTTP 客户端都可以使用 REST API。
## 📚 文档
### 入门指南
- [安装指南](./docs/getting-started/installation.md)
- [快速开始](./docs/getting-started/quick-start.md)
- [配置](./docs/getting-started/configuration.md)
- [使用示例](./docs/getting-started/examples.md)
### 部署
- [部署概述](./docs/deployment/README.md)
- [本地部署](./docs/deployment/local.md)
- [Docker 部署](./docs/deployment/docker.md)
- [云部署](./docs/deployment/cloud/)
### 数据库指南
- [数据库支持概述](./docs/databases/README.md)
- [MySQL](./docs/databases/mysql.md)
- [PostgreSQL](./docs/databases/postgresql.md)
- [更多数据库...](./docs/databases/)
### HTTP API
- [API 参考](./docs/http-api/API_REFERENCE.md)
- [部署指南](./docs/http-api/DEPLOYMENT.md)
### 集成
**AI 编辑器和 IDE:**
[Cursor](./docs/integrations/CURSOR.md) |
[VS Code](./docs/integrations/VSCODE.md) |
[JetBrains](./docs/integrations/JETBRAINS.md) |
[Windsurf](./docs/integrations/WINDSURF.md) |
[Zed](./docs/integrations/ZED.md) |
[Neovim](./docs/integrations/NEOVIM.md) |
[Emacs](./docs/integrations/EMACS.md)
**AI 助手:**
[Claude 桌面端](./docs/integrations/CLAUDE-DESKTOP.md) |
[Claude Code](./docs/integrations/CLAUDE-CODE.md) |
[GitHub Copilot](./docs/integrations/GITHUB-COPILOT.md) |
[Cline](./docs/integrations/CLINE.md) |
[Continue](./docs/integrations/CONTINUE.md)
**AI 平台:**
[Dify](./docs/integrations/DIFY.md) |
[Coze](./docs/integrations/COZE.md) |
[n8n](./docs/integrations/N8N.md) |
[ChatGPT](./docs/integrations/CHATGPT.md) |
[LangChain](./docs/integrations/LANGCHAIN.md)
**桌面应用:**
[Cherry Studio](./docs/integrations/CHERRY-STUDIO.md) |
[LM Studio](./docs/integrations/LM-STUDIO.md) |
[Jan](./docs/integrations/JAN.md) |
[Ollama](./docs/integrations/OLLAMA.md)
**消息平台:**
[Slack](./docs/integrations/SLACK.md) |
[Discord](./docs/integrations/DISCORD.md)
**工具:**
[MCP Inspector](./docs/integrations/MCP-INSPECTOR.md) |
[Postman](./docs/integrations/POSTMAN.md)
> 📁 [查看所有 55 个集成指南](./docs/integrations/) | 中文版本请在对应文档名后加 `.zh-CN`
### 高级
- [安全指南](./docs/guides/security.md)
- [多租户指南](./docs/guides/multi-tenant.md)
- [架构](./docs/development/architecture.md)
- [故障排除](./docs/operations/troubleshooting.md)
## 🤝 贡献
欢迎贡献!请在提交拉取请求前阅读我们的[贡献指南](./CONTRIBUTING.md)。
```bash
# 克隆仓库
git clone https://github.com/Anarkh-Lee/universal-db-mcp.git
# 安装依赖
npm install
# 构建
npm run build
# 运行测试
npm test
```
## 📄 许可证
该项目在 [MIT 许可证](./LICENSE) 下获得许可。
## 🌟 星历史
如果您觉得这个项目有帮助,请考虑给它一个星星!您的支持帮助我们继续改进 Universal DB MCP。
[](https://star-history.com/#Anarkh-Lee/universal-db-mcp&Date)
## 📝 更新日志
请参阅 [CHANGELOG.md](./CHANGELOG.md) 以获取详细的版本历史。
---
<p align="center">
由 <a href="https://github.com/Anarkh-Lee">Anarkh-Lee</a> 用 ❤️ 制作
</p>
MCP 配置
以下是此 MCP Server 的配置信息,可直接复制到 Cursor 或其他 MCP 客户端中使用。
mcp.json
连接信息
猜你喜欢
暂无推荐服务器