Protocol-gated tools (delete_repository) are listed based on the client's requested protocolVersion string, not the negotiated version
Les mainteneurs répondent en général sous 2 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 43/100
Piste de recherche
Start with pkg/inventory/tool_availability.go at the reported checks around lines 120, 136, 148–151, and 175; then read the pinned SDK implementation in mcp/shared.go around lines 674–686. Trace how initialization negotiates the session protocol version and how tool availability handles unknown versions. Done means delete_repository is omitted when the negotiated version is below the minimum, unknown requested strings do not qualify as newer, and the stated elicitation and read-only conditions still hold.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
delete_repository is meant to be available only to sessions on protocol ≥ 2026-07-28 with form elicitation. The availability check reads req.ProtocolVersion(). For a session started with initialize, that returns the version the client requested (InitializeParams.ProtocolVersion), not the version the server answered. The comparison is also a plain string compare. As a result:
- A client that requests
2026-07-28is negotiated down to2025-11-25(deliberate in go-sdk, sinceinitializeis deprecated in 2026-07-28), yettools/listincludesdelete_repository. - Any string that sorts after
2026-07-28, such aszzz, does the same.
Impact is low. By code reading (not tested), --read-only should still remove the tool and deletion still requires the elicitation confirmation. But the listed tool set doesn't match the protocol the session actually speaks.
Upstream context: go-sdk issue modelcontextprotocol/go-sdk#1258 (closed 2026-11-03 by go-sdk PR #1266) fixed the same requested-vs-negotiated confusion inside the SDK, through an unexported ServerSession.protocolVersion(). The public ServerRequest.ProtocolVersion() on go-sdk main still returns InitializeParams.ProtocolVersion. That fix isn't in a go-sdk release yet (latest v1.8.0, which this repo pins), so a go-sdk bump alone will not change this server's behaviour.
Code (main 99d6d650, unchanged since v2.1.0): pkg/inventory/tool_availability.go:120,136,175 (req.ProtocolVersion()), :148-151 (protocolVersion >= minimum, string compare). go-sdk v1.8.0 mcp/shared.go:674-686 (ServerRequest.ProtocolVersion).
Affected version
v2.1.0 (image sha256:f6056fc1…0f8a, commit 4bcdcdf8) and main nightly (image sha256:48bc16d0…338f, revision 99d6d650). stdio, --toolsets=all.
Steps to reproduce the behavior
initialize:
The result has{"protocolVersion":"2026-07-28","capabilities":{"elicitation":{"form":{}}},"clientInfo":{"name":"t","version":"0"}}protocolVersion: "2025-11-25".tools/list: 92 tools, includingdelete_repository.- Same with
"protocolVersion":"zzz","capabilities":{"elicitation":{}}. Negotiated2025-11-25, 92 tools, includingdelete_repository. - Same with
"protocolVersion":"2025-11-25"and form elicitation: 91 tools, nodelete_repository. "2026-07-28"without an elicitation capability: 91 tools, nodelete_repository.
Expected vs actual behavior
Expected: availability follows the negotiated version (2025-11-25 in steps 1 and 2), so delete_repository is not listed. Unknown version strings are not treated as newer.
Actual: the requested string decides, and zzz counts as newer than 2026-07-28.
Suggested fix: gate on the negotiated version. Either have go-sdk expose it, or make ServerRequest.ProtocolVersion() return it (a follow-up to go-sdk #1266). Meanwhile, when there is no per-request _meta version, cap the session value to the initialize result's version. Compare against a list of known versions, not lexically.
Logs
requested 2026-07-28 + elicitation.form -> negotiated 2025-11-25, tools/list 92, delete_repository listed
requested zzz + elicitation -> negotiated 2025-11-25, tools/list 92, delete_repository listed
requested 2025-11-25 + elicitation.form -> negotiated 2025-11-25, tools/list 91
requested 2026-07-28, no elicitation -> negotiated 2025-11-25, tools/list 91
Same on v2.1.0 and main.
Found during an independent audit of v2.1.0 on a throwaway org and private test repo. Prepared with AI assistance (Claude Code); reproduced by two independent test runs before filing.
- Langage dominant
- Go
- Étoiles
- 34.2k
- Forks
- 5.3k
- Merge moyen
- 5 j 18 h
- PR mergées (30 j)
- 13
Préparer son environnement
- Fournit un Dockerfile ou un 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 github/github-mcp-server
-
update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labelsOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
github/github-mcp-server#3760 ·
Les mainteneurs répondent en général sous 2 jours
-
docs(install-claude): "environment variable" examples put the PAT in argv and the saved configOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
github/github-mcp-server#3758 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
github/github-mcp-server#3729 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
github/github-mcp-server#3722 ·
Les mainteneurs répondent en général sous 2 jours
-
Insiders Feedback: PR created UI doesn't link to the PRPeut-être pris @genius-0963 l’a pris il y a 5 jours. Ouvertebug insiders user-experience
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
github/github-mcp-server#3658 ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de github/github-mcp-server
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
prime-radiant-inc/evener#5901 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
-
kind/bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
kyma-project/serverless#2769 ·
Les mainteneurs répondent en général sous 1 jour
-
Update the mise toolsOuverteready-for-agent
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
hexlet-basics/hexlet-basics#962 ·
Les mainteneurs répondent en général sous 1 jour
-
imapproxy closeForMaintenance grace timer calls clientConn.Close() before closeMaintenanceTransportPeut-être pris @dejanstrbac l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
Les mainteneurs répondent en général sous 1 jour