@shopify/dev-mcp: add readOnlyHint to read-only tools so they don't prompt on every call in plan mode
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 80/100
- Type d'issue
- Fonctionnalité
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- node.js, typescript
- Domaine
- devtools
Piste de recherche
Cherche avec grep dans le paquet dev-mcp registerTool("search_docs_chunks" pour trouver où les cinq outils sont enregistrés ; le même fichier (ou un module frère par outil) contient les quatre autres. Ajoute les objets annotations du tableau de l'issue à search_docs_chunks, learn_shopify_api, validate et validate_theme, en laissant feedback sans annotation. Terminé lorsque la sonde de reproduction tools/list affiche readOnlyHint non nul pour exactement ces quatre outils.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
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-mcp1.19.0 (latest at time of writing), run withnpx -y @shopify/dev-mcp@latest- Claude Code 2.1.330 (desktop app), macOS
- Langage dominant
- JavaScript
- Étoiles
- 652
- Forks
- 88
- Merge moyen
- 6 min
- PR mergées (30 j)
- 2
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de Shopify/Shopify-AI-Toolkit
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 63/100
-
Hermes install: join the download and run with && so a failed fetch cannot run a stale installerOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
Toutes les issues de Shopify/Shopify-AI-Toolkit
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
TarteelAI/quranic-universal-library#1111 ·
Les mainteneurs répondent en général sous 1 jour
-
area:ryoku type:bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
google-ai-edge/LiteRT-LM#4783 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
security
Difficulté 1/5 Moins d'une heure Accessibilité débutants 64/100
IBM/bob-oic-tutorials#34 ·
Les mainteneurs répondent en général sous 1 jour