Repository navigation
Description
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(), axumnest_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
- Start any streamable-HTTP server built on rmcp 3.8 (e.g. the counter example) and note its stderr/journal.
- Send a no-initialize request (no
initializeever 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":{}}}}'- 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
initializerequest was ever sent; the log fabricates one. - The client identified itself as
distinctive-probe-XYZ/9.9.9in_meta; the log showsrmcp/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), notService initialized ... InitializeRequestParams. - Surface
io.modelcontextprotocol/clientInfofrom_metawhen 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.
Activity
github-actions commentedon Nov 3, 2026
@jamadeo is on triage rotation this week and is the reviewer for this one.
Codex labeled this bug / P2 (T-service, T-transport). Please confirm or correct those labels.
Automated triage. Labels are a first pass and the assigned maintainer has the final say.
jamadeo commentedon Nov 3, 2026
Thanks for the report - yes this is misleading. Logging the identity from _meta makes sense. As for the lifecycle accuracy, I think we could simply make it neutral, e.g. "Server service started"
jokemanfire commentedon Nov 8, 2026
Reproduced on 3.8.0, and the cause is a synthesized peer identity plus a log message that is written for a handshake that never happened.
Repro (no server code beyond the default config)
StreamableHttpService<Calculator, LocalSessionManager>withwith_legacy_session_mode(false), one POST with exactly your headers/body (Mcp-Method: tools/list,_metaclientInfodistinctive-probe-XYZ/9.9.9), log level INFO:Both of your observations reproduce: no
initializewas sent, and the_metaclientInfo never appears.Where it comes from
peer_info_for_stateless_request(crates/rmcp/src/transport/streamable_http_server/tower.rs:2432-2451) builds anInitializeRequestParamsfor any request that is not aninitialize: it takes the protocol version from theMCP-Protocol-Versionheader and hardcodesImplementation::default()isfrom_build_env()(crates/rmcp/src/model.rs:1700-1703), i.e.rmcp+CARGO_PKG_VERSION— hencermcp/3.8.0.That synthesized value is passed to
serve_directly_with_ct(..., peer_info, ...)(tower.rs:1537-1545, same for the negotiated path at2308-2316) and becomes the peer's identity (service.rs:1291).serve_innerlogs it unconditionally when a peer identity exists (service.rs:1351-1353):Nothing reads
_metaeven though the accessors exist and are already used for validation nearby:RequestMetaObject::client_info()/client_capabilities()(crates/rmcp/src/model/meta.rs:459-477).Options
A. Read the client context out of
_meta(recommended). Inpeer_info_for_stateless_request:Logs become truthful for the SEP-2575 path, and handlers that inspect
peer_info()(capabilities, client name) see what the client actually declared. Caveat:clientInfois optional in the draft schema, so the fallback still needs a decision — I'd use something obviously synthetic (Implementation::new("unknown", "unknown")) rather thanrmcp/<version>, so it can never be mistaken for an rmcp client again.B. Stop claiming an initialize happened. The message, not just the payload, is the bug: a no-initialize request should log e.g.
stateless request served method=tools/list, at INFO or DEBUG. This needs the stateless origin plumbed intoserve_inner(a flag, or a small enum next topeer_info) so it can pick the right wording; it is a slightly wider change than A but it is what makes the log self-describing.C. Minimal band-aid. Keep the synthesis, swap
Implementation::default()for a synthetic identity and demote the line to DEBUG. Smallest diff, but the INFO line still says "Service initialized" if anyone turns DEBUG off... rather: the misleading wording survives for every other log consumer; I'd only take this as a stopgap.A + B together are what I'd merge: A removes the wrong identity, B removes the wrong verb. They also make the fix testable — a request with
_meta.clientInfoshould yield thatclient_infoinpeer_info, and a stateless request should not emit "Service initialized".Happy to send the PR for A (plus B if you want it in the same change); say the word and I'll put it against
mainwith tests. I have not opened one, since this is your report and the fallback-identity choice is a maintainer call.