Server logs a fabricated 'initialize' (with synthesized rmcp/3.8.0 peer identity) for no-initialize SEP-2567 requests, ignoring clientInfo from _meta

Aperta
#1,425 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

@jamadeo ci sta già lavorando.

Dal 3/11/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug P2 ready for work T-service T-transport

Summary

On rmcp 3.8.0, a streamable-HTTP server emits a Service initialized as server peer_info=Some(InitializeRequestParams { ... }) INFO log line for every no-initialize (SEP-2567, protocol 2026-07-28) request, as though an initialize handshake had occurred. The logged peer identity is a synthesized Implementation { name: "rmcp", version: "3.8.0" }, and a clientInfo explicitly provided in the request's _meta (io.modelcontextprotocol/clientInfo) is ignored — never surfaced in the log.

This makes server-side logs actively misleading for client-behavior analysis: a sessionless 2.0 client appears in logs as a legacy initialize handshake from an rmcp client.

Environment

  • rmcp 3.8.0, server role, transport-streamable-http-server (StreamableHttpService + LocalSessionManager::default(), axum nest_service("/mcp", ...))
  • Client: any no-initialize 2.0 caller (curl below; also observed with a real third-party client identifying as zcode/0.17.1)

Reproduction

  1. Start any streamable-HTTP server built on rmcp 3.8 (e.g. the counter example) and note its stderr/journal.
  2. Send a no-initialize request (no initialize ever sent):
curl -sS -X POST http://127.0.0.1:8000/mcp \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -H 'MCP-Protocol-Version: 2026-07-28' -H 'Mcp-Method: tools/list' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{"_meta":{
    "io.modelcontextprotocol/protocolVersion":"2026-07-28",
    "io.modelcontextprotocol/clientInfo":{"name":"distinctive-probe-XYZ","version":"9.9.9"},
    "io.modelcontextprotocol/clientCapabilities":{}}}}'
  1. The request succeeds (HTTP 200, tool list returned), and the server logs:
INFO serve_inner: rmcp::service: Service initialized as server peer_info=Some(InitializeRequestParams {
  meta: None,
  protocol_version: ProtocolVersion("2026-07-28"),
  capabilities: ClientCapabilities { ... all None ... },
  client_info: Implementation { name: "rmcp", title: None, version: "3.8.0", ... }
})

Two discrepancies vs. what actually happened on the wire:

  • No initialize request was ever sent; the log fabricates one.
  • The client identified itself as distinctive-probe-XYZ/9.9.9 in _meta; the log shows rmcp/3.8.0.

Real-world impact

We spent three rounds of diagnosis mis-attributing a third-party client's behavior because its sessionless 2.0 requests were logged as initialize handshakes from "rmcp 3.8.0". This included incorrectly concluding the client used a legacy handshake and had a clientInfo of rmcp/3.8.0 (wire capture later disproved both). Details and retraction: zai-org/feedback#1372.

Suggested direction

  • For no-initialize requests, log something that reflects the actual lifecycle (e.g. stateless request served), not Service initialized ... InitializeRequestParams.
  • Surface io.modelcontextprotocol/clientInfo from _meta when present, so per-request identities are observable; if absent, make the synthesized default obviously synthetic (or omit identity from the log).

Happy to provide full tcpdump captures or a minimal repro project if useful.

Lingua principale
Rust
Stelle
4.1k
Fork
694
Merge medio
4g 16h
PR unite (30g)
43

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/rust-sdk

Tutte le issue di modelcontextprotocol/rust-sdk

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.