Repository navigation
MCP 客户端只投影 tools,不建模 resources —— resource-only 的上下文在 DSH 里读不到 #6535
VillagerUncle02
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
环境:DSH 0.1.5-rc.1 / Windows 11
DSH 的 MCP 客户端把每个 server 的 tool 投影成 mcp____ 暴露给模型:
dsh-mcp-client/lib/index.js:120-121 function publicToolName(serverName, rawName) {
const joined =
mcp__${serverName}__${rawName};dsh-mcp-client/lib/index.js:87-91 listToolsUncached(...) → method: "tools/list"
dsh-mcp-client/lib/index.js:156-158 for (const tool of response.tools)
publicToolName(opts.serverName, tool.name)
但 MCP 协议里与 tools 并列的 resources(list / read / templates)在 DSH 里没有对应的投影。
全发行版按下面这些 API 名检索,命中数都是 0:
listResources / readResource / resourceTemplates / resources/list / resources/read / ResourceTemplate
对照 Codex:它有 list_mcp_resources / list_mcp_resource_templates / read_mcp_resource 三个工具,
描述里还写着 "Prefer resources over web search when possible"。
影响:如果某个 MCP server 把关键上下文只做成 resource(数据库 schema、配置、知识库、文档集),
在 DSH 里模型读不到,只能退回 shell / HTTP 自己去抓——原本"MCP 一体化"的价值就没了。
建议:在 dsh-mcp-client 增加 resources 的 list / read 工具(命名可以沿用 mcp____ 前缀,
或单独一套 mcp_resource____*)。
(说明:这是否定性证据,来自全发行版 grep 这 6 个 API 名 = 0 命中;我没有逐行通读
dsh-mcp-client 的 791 行,如果有我漏掉的实现路径欢迎指出。)
All reactions