@shopify/dev-mcp: add readOnlyHint to read-only tools so they don't prompt on every call in plan mode
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 80/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- devtools
Hướng nghiên cứu
Chạy grep trên gói dev-mcp để tìm registerTool("search_docs_chunks" nhằm xác định nơi năm công cụ được đăng ký; cùng tệp đó (hoặc một mô-đun anh em theo từng công cụ) chứa bốn công cụ còn lại. Thêm các đối tượng annotations từ bảng của issue vào search_docs_chunks, learn_shopify_api, validate và validate_theme, để feedback không có chú thích. Hoàn tất là khi đầu dò tái tạo tools/list in ra readOnlyHint khác null cho đúng bốn công cụ đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- JavaScript
- Star
- 652
- Fork
- 88
- Merge trung bình
- 6 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Shopify/Shopify-AI-Toolkit
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
-
Hermes install: join the download and run with && so a failed fetch cannot run a stale installerĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Tất cả issue của Shopify/Shopify-AI-Toolkit
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
cloudflare/workers-sdk#17139 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: editor P3 type: feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
halisonworks/mod-codeling#290 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Teams conversion crashes on channel messages sent by an applicationCó thể đã có người làm @sdivyanshu90 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
aws/aws-sdk-js-v3#8441 ·
Maintainer thường phản hồi trong vòng 1 ngày