Files
wehub-resource-sync 1443d3fdf9
Ruff Format Check / Ruff Format & Lint (push) Failing after 7m39s
Deploy VitePress site to Pages / build (push) Failing after 9m11s
Deploy VitePress site to Pages / Deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:32:26 +08:00

52 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# MCP 集成
MCPModel Context Protocol)是扩展智能体能力的重要方式。系统支持通过管理界面动态配置 MCP 服务器,无需修改代码。
内置 MCP 服务器以代码为事实源:系统启动时会自动补齐缺失项,并用代码中的最新连接与展示字段覆盖数据库定义;是否“已添加”以及工具级禁用列表仍保留数据库状态。
## 支持的传输协议
| 协议 | 说明 | 适用场景 |
|------|------|----------|
| Streamable HTTP | 流式 HTTP 连接 | 远程 MCP 服务 |
| SSE | Server-Sent Events | 标准 HTTP 长连接 |
| Stdio | 标准输入输出 | 本地进程 |
## 配置示例
### 远程 MCP 服务
```json
{
"name": "custom-remote-mcp",
"transport": "streamable_http",
"url": "https://example.com/mcp"
}
```
### 本地 Python 进程
```json
{
"name": "mysql-mcp-server",
"transport": "stdio",
"command": "uvx",
"args": ["mysql_mcp_server"],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_DATABASE": "your_database"
}
}
```
## 服务器管理
管理界面使用“添加 / 移除”语义管理 MCP 服务器:
- 已添加:`enabled=true`,会加载到运行时缓存并可供 Agent 使用
- 可添加:`enabled=false`,记录保留但不会进入运行时
## 工具管理
MCP 工具支持粒度控制:管理员可以单独启用或禁用某个 MCP 服务器下的特定工具,实现精细化的权限管理。