modelcontextprotocol / modelcontextprotocol/servers

everything server: instructions unconditionally reference sampling/elicitation tools that only exist when the client declares those capabilities

Offen Anfängerfreundlich
#4,792 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
TypeScript
Sterne
90.5k
Forks
11.7k
Ø Merge
2 T. 2 Std.
Gemergte PRs (30 T.)
5

Beschreibung

Factual issue

The @modelcontextprotocol/server-everything v2026.8.31 instructions string unconditionally tells integrating agents to use trigger-sampling-request and trigger-elicitation-request:

## Constraints & Limitations
- Sampling requests (`trigger-sampling-request`) require client sampling capability
- Elicitation requests (`trigger-elicitation-request`) require client elicitation capability

These tools are registered through registerConditionalTools() inside oninitialized, gated on the client's declared capabilities (server/index.ts). For a client that declares no sampling/elicitation capability — e.g. the majority of clients today, and verified by a capability sweep across 12 popular MCP servers — the tools never appear in tools/list, and the instructions reference tools that do not exist for that session:

  • initialize with capabilities: {}tools/list returns 13 tools, none of them trigger-sampling-request or trigger-elicitation-request
  • initialize with capabilities: {sampling:{}, elicitation:{}} → 16 tools, both present

Suggested fixes (pick any)

  1. Make the instructions conditional-aware — e.g. "when your client declares the sampling capability, trigger-sampling-request is available" — so the guidance matches what an agent can actually call.
  2. Compose the instructions per session — the instructions string is static, but it could be built from the registered-tools state after oninitialized, or the conditionality could be stated in one sentence.
  3. At minimum, add the phrase "if your client declares the corresponding capability" to the two bullets.

Why this matters beyond this server

The instructions field exists to orient agents; an agent that follows these instructions on a non-capability client will attempt to call a tool that is not in its catalog — a coherence class that deterministic batteries (this was found with mcp-eval's catalog-vs-instructions checks) can expose mechanically.

Repro

npx -y @modelcontextprotocol/server-everything
# initialize with capabilities: {} ; then tools/list -> 13 tools, no trigger-sampling-request
# initialize with capabilities: {sampling:{},elicitation:{}} ; wait ~1.5s after notifications/initialized ; tools/list -> 16 tools, both present

Environment: server-everything v2026.8.31 (npm), server self-reports 2.0.0; verified against the published dist (registerConditionalTools in dist/server/index.js).

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne in server/index.ts und konzentriere dich auf registerConditionalTools() innerhalb von oninitialized sowie auf den statischen instructions-String. Führe die bereitgestellte npx-Server-Reproduktion mit leeren capabilities und mit sampling/elicitation capabilities aus und überprüfe anschließend, dass die instructions konsistent beschreiben, ob trigger-sampling-request und trigger-elicitation-request verfügbar sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
backend
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
75/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.