refactor(mcp): remove standalone HTTP mode, keep only built-in endpoint and stdio
Build and Deploy / build-and-push (push) Successful in 54s
Build and Deploy / build-and-push (push) Successful in 54s
- MCP Server is now only available via built-in /mcp endpoint or stdio - Remove --http flag and standalone HTTP server code - Simplify documentation and frontend settings
This commit is contained in:
+12
-86
@@ -14,17 +14,17 @@ TaskPool 提供官方 **MCP Server**,让 Hermes、OpenClaw、Cursor 等 AI Age
|
||||
|
||||
## 内置 MCP 端点
|
||||
|
||||
MCP Server 已**内置在后端服务中**,无需单独启动进程。启用 OpenAPI 后,MCP 端点自动可用:
|
||||
MCP Server 已**内置在后端服务中**,无需单独进程。启用 OpenAPI 后,MCP 端点自动可用:
|
||||
|
||||
```
|
||||
http://your-server:8052/mcp
|
||||
```
|
||||
|
||||
## Agent 配置示例
|
||||
## Agent 配置
|
||||
|
||||
### HTTP 模式(推荐)
|
||||
|
||||
远程 Agent 直接访问内置端点,无需本地安装二进制。
|
||||
远程 Agent 直接访问内置端点,无需本地安装。
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -39,98 +39,24 @@ http://your-server:8052/mcp
|
||||
}
|
||||
```
|
||||
|
||||
适用于:Hermes、OpenClaw 等支持 HTTP URL 的 Agent。
|
||||
|
||||
### stdio 模式
|
||||
|
||||
本地 Agent 需要安装 `taskpool` 二进制(Claude Desktop、Cursor)。
|
||||
|
||||
```bash
|
||||
export TASKPOOL_URL=http://your-server:8052
|
||||
export TASKPOOL_TOKEN=你的OpenAPI_Token
|
||||
taskpool mcp
|
||||
```
|
||||
|
||||
Agent 配置:
|
||||
本地 Agent 需要安装 `taskpool` 二进制。
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"taskpool": {
|
||||
"command": "taskpool",
|
||||
"args": ["mcp"],
|
||||
"env": {
|
||||
"TASKPOOL_URL": "http://your-server:8052",
|
||||
"TASKPOOL_TOKEN": "你的OpenAPI_Token"
|
||||
}
|
||||
"args": ["mcp"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 独立 HTTP 服务模式(可选)
|
||||
|
||||
如果需要单独部署 MCP 服务(如不同的端口或机器):
|
||||
|
||||
```bash
|
||||
# 监听默认端口 :8053
|
||||
taskpool mcp --http
|
||||
|
||||
# 指定端口
|
||||
taskpool mcp --http :9000
|
||||
|
||||
# 或通过环境变量
|
||||
export MCP_HTTP_ADDR=:8053
|
||||
taskpool mcp --http
|
||||
```
|
||||
|
||||
独立模式暴露端点:
|
||||
- `POST /mcp` - MCP 协议端点
|
||||
- `GET /health` - 健康检查
|
||||
|
||||
## Agent 配置示例
|
||||
|
||||
### stdio 模式(Claude Desktop / Cursor)
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"taskpool": {
|
||||
"command": "taskpool",
|
||||
"args": ["mcp"],
|
||||
"env": {
|
||||
"TASKPOOL_URL": "http://127.0.0.1:8052",
|
||||
"TASKPOOL_TOKEN": "替换为设置页 Token"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
若二进制不在 PATH:
|
||||
|
||||
```json
|
||||
{
|
||||
"command": "/path/to/taskpool",
|
||||
"args": ["mcp"],
|
||||
"env": {
|
||||
"TASKPOOL_URL": "https://你的面板地址",
|
||||
"TASKPOOL_TOKEN": "xxx"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### HTTP 模式(Hermes / OpenClaw)
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"taskpool": {
|
||||
"url": "http://your-server:8053/mcp"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Docker 部署时,把 `TASKPOOL_URL` 写成 Agent 能访问的地址(宿主机映射端口或内网域名)。
|
||||
适用于:Claude Desktop、Cursor 等只支持 stdio 的本地 Agent。
|
||||
|
||||
## 工具清单(Tools)
|
||||
|
||||
@@ -197,7 +123,7 @@ Skill 是说明书;**真正执行依赖 MCP Tools**。两者一起用效果最
|
||||
|
||||
| 现象 | 处理 |
|
||||
|------|------|
|
||||
| `TASKPOOL_TOKEN 未配置` | 设置 env 或配置里的 Token |
|
||||
| `无效的 OpenAPI 令牌` | 设置页启用 OpenAPI 并重新生成 |
|
||||
| 连接失败 | 检查 `TASKPOOL_URL`、防火墙、容器网络 |
|
||||
| Agent 看不到 tools | 确认 `command` 路径正确,重启 Agent Gateway |
|
||||
| `OpenAPI Token 未配置` | 设置页启用 OpenAPI 并生成 Token |
|
||||
| `无效的 OpenAPI 令牌` | 设置页重新生成 Token |
|
||||
| 连接失败 | 检查服务器地址、防火墙、容器网络 |
|
||||
| Agent 看不到 tools | 确认配置正确,Token 有效 |
|
||||
|
||||
Reference in New Issue
Block a user