@shopify/dev-mcp: add readOnlyHint to read-only tools so they don't prompt on every call in plan mode

Open Beginner friendly
#79 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
80/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
node.js, typescript
Domain
devtools

Research direction

Grep the dev-mcp package for registerTool("search_docs_chunks" to find where the five tools are registered; the same file (or a sibling per-tool module) holds the other four. Add the annotations objects from the issue's table to search_docs_chunks, learn_shopify_api, validate and validate_theme, leaving feedback unannotated. Done is the reproduction tools/list probe printing non-null readOnlyHint for exactly those four tools.

Written by the indexing model from the issue text.

Description

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-mcp 1.19.0 (latest at time of writing), run with npx -y @shopify/dev-mcp@latest
  • Claude Code 2.1.330 (desktop app), macOS
Dominant language
JavaScript
Stars
652
Forks
88
Avg merge
6m
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Shopify/Shopify-AI-Toolkit

All issues in Shopify/Shopify-AI-Toolkit

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.