zai-org / zai-org/feedback

[Bug]ZCode 客户端与 MCP server 传输含 `data:` URL 的消息时连接断开

Open
#252 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2 status: 待评估 type: Bug
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

提交前确认 · Pre-submission checklist
  • 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
  • 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category

工具调用 / MCP · Tool use / MCP

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

严重程度 · Severity

影响体验 · Major (功能可用但体验受损 / works but degraded)

复现频率 · Reproducibility

必现 · Always

问题描述 · Description

ZCode 客户端与 MCP server 之间通过 stdio 传输消息时,只要 JSON-RPC 参数里包含 data: 前缀的 URL(base64 data URL),连接就会断开(表现为 30 秒超时或 Connection closed)。普通 http(s) URL 消息正常。

实测对象:插件 qwen-mm-pluginsQwenMM/Qwen-MM-Plugins,v1.0.1)的 api 包,通过 uvx --from "qwen-mm-plugins[api] @ git+..." 启动为 MCP stdio server。

已排除的变量:

  • API key 有效(DashScope 直调返回 200,模型正常回答)
  • 网络正常(端点 0.5s 可达)
  • MCP server 本身正常(手动以 stdio JSON-RPC 直连同一个 server,传相同 data URL,秒回正常响应
  • 与消息大小无关(1×1 像素、约 150 字节的微型 data URL 同样断连)
复现步骤 · Steps to reproduce
  1. 安装 qwen-mm-plugins 插件(api 包),在 ~/.qwen-mm-plugins/config 配置有效的 DASHSCOPE_API_KEY
  2. 在 ZCode 会话中调用 mcp__plugin_qwen-mm-plugins-api__vision_chat
  3. images 参数传入任意 data:image/png;base64,<...> 的 URL(本地图片路径亦可——插件会自动 base64 编码为 data URL)。
  4. 观察结果。
    对照实验(关键):
  • 同一会话、同一 server,images 传普通 https://... URL → 秒回(服务端返回 400 或正常结果)。
  • 同一 server,通过手动 stdio JSON-RPC 客户端传相同的 data URL → 秒回正常(返回服务端校验错误 400,说明消息完整到达)。
  • 同插件族 qwen-mm-plugins-core 的本地工具(read_image,不涉及 data URL)→ 正常。
期望表现 · Expected behavior

data: URL 的 MCP 消息应像普通 URL 一样正常传输,server 侧能收到完整参数并正常处理。

实际表现 · Actual behavior
  • 调用后等待 30 秒报 Tool execution timed out after 30000ms,或直接 Connection closed
  • server 进程(qwen-mm-plugins-api.exe)随后消失,ZCode 重启新实例,说明连接被强制断开。
  • 手动直连同一 server 时 server stderr 显示完整处理流程(CallToolRequest → HTTP 请求 → 响应),证明 server 端无崩溃,问题在客户端与 server 的传输层。
ZCode 版本 · ZCode version

3.7.6(Windows 桌面版)

设备 / 系统 / 浏览器 · Device / OS / Browser

Windows 11(win32 10.0.26100 x64),Git Bash 终端,ZCode CLI 客户端。

截图 / 录屏 / 日志 · Screenshots / Recordings / Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names no source files or tests. First reproduce on ZCode 3.7.6 with the qwen-mm-plugins MCP stdio server, comparing a data URL with an https URL and with the manual JSON-RPC client. Done means the data URL reaches the server intact without a timeout or connection closure.

Written by the indexing model from the issue text.

Assessment

Domain
api, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.