Skip to content

feat: 接入独立 MCP Agent 与进度回调#1154

Closed
xiongxz wants to merge 1 commit into
nextlevelbuilder:devfrom
xiongxz:dev_juntao
Closed

feat: 接入独立 MCP Agent 与进度回调#1154
xiongxz wants to merge 1 commit into
nextlevelbuilder:devfrom
xiongxz:dev_juntao

Conversation

@xiongxz
Copy link
Copy Markdown

@xiongxz xiongxz commented May 19, 2026

提交理由

这次改动是为了让 GoClaw 能更稳定地接入外部 MCP 工具服务,并为耗时较长的工具调用提供统一的进度回传能力。之前外部工具执行期间主要依赖最终结果,GoClaw UI 和外部渠道很难持续感知中间状态;现在可以通过统一的 progress / ask_user / result / error 语义,让运行时、前端和外部渠道都按同一套协议处理长任务反馈。

主要改动

  • 新增独立 MCP Agent 运行入口,便于将外部工具服务作为独立进程或容器部署。
  • 支持 MCP notifications/progress 回传到 GoClaw,并转成 AgentEventActivity phase=mcp_progress
  • 新增 DirectReturn 工具结果路径,避免结构化工具结果被模型二次改写。
  • 新增外部 gateway progress callback,可将 GoClaw 内部 progress 按统一协议 POST 到外部渠道服务。
  • 支持 gateway metadata 透传:gateway_context_id / channel / internal_session_id / conversation_id / message_id / out_track_id / reply_mode
  • 补充异步长任务执行和可复用工作区打开能力,减少长任务阻塞和一次性环境销毁带来的体验问题。
  • 新增 MCP Agent Dockerfile 与 docker-compose 配置,方便独立部署和本地联调。
  • 将部分部署参数从硬编码改为环境变量配置。

影响范围

  • GoClaw 主流程:MCP 工具调用、工具进度事件、最终回复处理。
  • 外部渠道:可通过 progress callback 接收中间状态并自行渲染。
  • 部署:新增独立 MCP Agent compose 服务,不强制改动原有 GoClaw 服务启动方式。

验证

  • go test ./cmd/... ./internal/channels ./internal/gateway/methods ./internal/mcp ./internal/agent ./internal/pipeline ./internal/tools
  • docker compose -f docker-compose.mcp-agent.yml config --services
  • docker compose -f docker-compose.yml -f docker-compose.mcp-agent.yml config --services | rg '^(goclaw|mcp-agent)$'
  • docker compose -f docker-compose.mcp-agent.yml up -d --build mcp-agent
  • curl -fsS http://127.0.0.1:8090/healthz
  • MCP initialize smoke test against http://127.0.0.1:8090/mcp

@chloeassistant
Copy link
Copy Markdown

📋 Code Review Requested (P2)

This is a large-scope feature PR from external contributor @xiongxz — standalone MCP sandbox agent binary.

Scope: 41 files, +5,384/-87 lines — new binary, Dockerfile, docker-compose, MCP forwarding.
Status: Draft — PR still in progress.

Recommendations:

  • Data assigned for thorough code review once marked ready
  • Review focus areas: sandbox isolation boundary, MCP protocol handling, new Docker service configuration, forward-compatibility with existing gateway

⚠️ PR is currently a draft — author may push more commits. Will re-assess when marked ready for review.

@xiongxz xiongxz changed the title feat: add standalone MCP sandbox agent feat: 接入独立 MCP Agent 与进度回调 May 20, 2026
@xiongxz xiongxz marked this pull request as ready for review May 20, 2026 02:25
@xiongxz xiongxz marked this pull request as draft May 20, 2026 02:41
@xiongxz
Copy link
Copy Markdown
Author

xiongxz commented May 20, 2026

先临时关闭,避免包含内部实现细节;后续如需提交,会重新整理成通用、可公开 review 的版本。

@xiongxz xiongxz closed this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants