@shopify/dev-mcp: add readOnlyHint to read-only tools so they don't prompt on every call in plan mode
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 80/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
- 领域
- devtools
调研方向
在 dev-mcp 包中 grep registerTool("search_docs_chunks",找到这五个工具的注册位置;同一个文件(或每个工具对应的同级模块)包含另外四个。将 issue 表格中的 annotations 对象添加到 search_docs_chunks、learn_shopify_api、validate 和 validate_theme,让 feedback 保持未标注。完成标准是复现用的 tools/list 探针恰好为这四个工具打印非 null 的 readOnlyHint。
由索引模型根据 Issue 内容生成。
描述
Summary
@shopify/dev-mcp 1.19.0 returns no annotations for any of its five tools in tools/list. MCP clients that gate on tool annotations therefore have to treat every call, including a plain docs search, as potentially state-changing.
Impact
In Claude Code's plan mode (its read-only research mode), MCP tools that the server marks readOnlyHint: true run without asking (docs). Every other MCP tool prompts for approval on each call, and those prompts don't offer "Always allow". As a result, each search_docs_chunks, learn_shopify_api and validate call during planning needs its own manual approval, even though looking up docs is exactly what plan mode is for. Other docs servers such as @upstash/context7-mcp already set readOnlyHint: true and run without prompts.
Reproduction
{ printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"probe","version":"0"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}'; sleep 5; } \
| npx -y @shopify/[email protected] | jq -c 'select(.id==2) | .result.tools[] | {name, annotations}'
Output:
{"name":"feedback","annotations":null}
{"name":"learn_shopify_api","annotations":null}
{"name":"search_docs_chunks","annotations":null}
{"name":"validate","annotations":null}
{"name":"validate_theme","annotations":null}
Suggested fix
Based on the tool descriptions, four of the five tools only read. Annotating them would let clients run them in read-only modes:
| Tool | Suggested annotations |
|---|---|
search_docs_chunks |
readOnlyHint: true, openWorldHint: true |
learn_shopify_api |
readOnlyHint: true, openWorldHint: true |
validate |
readOnlyHint: true |
validate_theme |
readOnlyHint: true (it reads theme files; it doesn't modify them) |
feedback |
leave unannotated, since it submits data to Shopify |
With the MCP TypeScript SDK this is the annotations field on registerTool:
server.registerTool("search_docs_chunks", {
description: "...",
inputSchema: { /* ... */ },
annotations: { readOnlyHint: true, openWorldHint: true },
}, handler);
Environment
@shopify/dev-mcp1.19.0 (latest at time of writing), run withnpx -y @shopify/dev-mcp@latest- Claude Code 2.1.330 (desktop app), macOS
- 主要语言
- JavaScript
- 星标
- 652
- 派生
- 88
- 平均合并
- 6 分钟
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Shopify/Shopify-AI-Toolkit 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 1/5 1 小时以内 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 63/100
-
Hermes install: join the download and run with && so a failed fetch cannot run a stale installer未关闭
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 1/5 1 小时以内 新手友好度 92/100
查看 Shopify/Shopify-AI-Toolkit 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100
cloudflare/workers-sdk#17139 ·
维护者通常 1 天内回复
-
area: editor P3 type: feature
难度 2/5 1-3 小时 新手友好度 74/100
halisonworks/mod-codeling#290 ·
维护者通常 1 天内回复
-
Teams conversion crashes on channel messages sent by an application可能已有人在做 @sdivyanshu90 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
aws/aws-sdk-js-v3#8441 ·
维护者通常 1 天内回复