Skip to content

[Bug] devdoc is discovered to pre-mcp-gw and consistently times out, while other MCP products on mcp-gw work #523

Description

@trivial-boy

问题描述

dws devdoc 在当前环境下稳定超时,但同机其他 dws MCP 产品(如 todo / drive / doc)可以正常访问。排查后发现不是本地网络整体问题,而是 devdoc 被 discovery/cache 指到了 pre-mcp-gw.dingtalk.com,而不是正式的 mcp-gw.dingtalk.com

这会导致:

  • dws devdoc article search ... 稳定超时
  • dws devdoc error diagnose ... 稳定超时
  • dws cache refresh 也可能因为 discovery 链路失败而无法自愈

环境信息

  • dws 版本: v1.0.44 (be80790, 2026-06-29T02:56:43Z)
  • OS: macOS (darwin arm64)
  • 本地未设置 DWS_* / MCP_* host override 环境变量

复现步骤

  1. 正常登录 dws
  2. 执行:
dws devdoc article search --query 'OAuth2' --format json --timeout 30 --verbose
  1. 返回超时,典型错误:
{
  "error": {
    "category": "discovery",
    "code": 6,
    "message": "request to https://pre-mcp-gw.dingtalk.com/server/... failed: Post \"https://pre-mcp-gw.dingtalk.com/server/...\": dial tcp 203.119.212.41:443: i/o timeout",
    "reason": "request_timeout"
  }
}

本地排查结果

1. devdoc 在本地缓存中被发现成 pre 网关

本地缓存文件:~/.dws/cache/default_default/market/servers.json

其中 devdoc 的 endpoint 为:

"endpoint": "https://pre-mcp-gw.dingtalk.com/server/b1de5f0f0cde6116b2fb84e5e4bef74d942116aad9ab7b2d63526a9a4042f6ff?key=..."

而同一份缓存里其他大多数服务都是:

https://mcp-gw.dingtalk.com/server/...

2. 日志确认 devdoc 实际打到了 pre 网关

~/.dws/logs/dws.log 中可见:

product="devdoc" endpoint="https://pre-mcp-gw.dingtalk.com/server/b1de5f0f0cde6116b2fb84e5e4bef74d942116aad9ab7b2d63526a9a4042f6ff"

随后 3 秒左右超时。

3. 同机其他正式网关 MCP 服务正常

同机测试:

  • dws todo ... 正常
  • dws drive ... 正常
  • dws doc ... 正常

这些服务都走 https://mcp-gw.dingtalk.com/server/...

说明不是整机网络出网问题,而是 devdoc endpoint 本身被下发到了 pre。

4. 手工把 devdoc endpoint 改成正式网关后,命令立刻恢复

我临时把本地缓存中的这条 endpoint 从:

https://pre-mcp-gw.dingtalk.com/server/b1de5f0f0cde6116b2fb84e5e4bef74d942116aad9ab7b2d63526a9a4042f6ff?key=...

替换为:

https://mcp-gw.dingtalk.com/server/b1de5f0f0cde6116b2fb84e5e4bef74d942116aad9ab7b2d63526a9a4042f6ff?key=...

之后再执行:

dws devdoc article search --query 'OAuth2' --format json --timeout 30 --verbose

即可成功返回文档结果。

这说明 CLI 本身的 devdoc 调用链路不是完全坏的,核心问题更像是:

  • discovery 下发了错误/不适合当前用户环境的 devdoc endpoint
  • 或者某段 endpoint normalization/runtime override 错误地把 devdoc 指到了 pre 网关

期望行为

  • devdoc 默认应与其他 MCP 服务一样,走正式可用网关
  • 至少 open-source / 普通用户环境不应把 devdoc silently 指到 pre-mcp-gw.dingtalk.com
  • 若确实需要 pre 路由,也应有明确 edition / env gating,而不是在默认缓存里混入单个 pre endpoint

补充观察

仓库 CHANGELOG 中也提到:默认 MCP / skill hosts 应保持生产环境,prepub 只应在 runtime configurable 场景使用。当前现象和这个预期不一致。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions