[Bug]ZCode 客户端与 MCP server 传输含 `data:` URL 的消息时连接断开
Nobody has claimed this yet.
- 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-plugins(QwenMM/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
- 安装 qwen-mm-plugins 插件(api 包),在
~/.qwen-mm-plugins/config配置有效的DASHSCOPE_API_KEY。 - 在 ZCode 会话中调用
mcp__plugin_qwen-mm-plugins-api__vision_chat。 images参数传入任意data:image/png;base64,<...>的 URL(本地图片路径亦可——插件会自动 base64 编码为 data URL)。- 观察结果。
对照实验(关键):
- 同一会话、同一 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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