ForcePilot/docs/latest/agents/mcp-integration.md

43 lines
1023 B
Markdown
Raw Normal View History

2026-03-10 13:55:19 +08:00
# MCP 集成
MCPModel Context Protocol是扩展智能体能力的重要方式。系统支持通过管理界面动态配置 MCP 服务器,无需修改代码。
## 支持的传输协议
| 协议 | 说明 | 适用场景 |
|------|------|----------|
| Streamable HTTP | 流式 HTTP 连接 | 远程 MCP 服务 |
| SSE | Server-Sent Events | 标准 HTTP 长连接 |
| Stdio | 标准输入输出 | 本地进程 |
## 配置示例
### 远程 MCP 服务
```json
{
"name": "sequentialthinking",
"transport": "streamable_http",
"url": "https://remote.mcpservers.org/sequentialthinking/mcp"
}
```
### 本地 Python 进程
```json
{
"name": "mysql-mcp-server",
"transport": "stdio",
"command": "uvx",
"args": ["mysql_mcp_server"],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_DATABASE": "your_database"
}
}
```
## 工具管理
MCP 工具支持粒度控制:管理员可以单独启用或禁用某个 MCP 服务器下的特定工具,实现精细化的权限管理。