Skip to main content

Module mcp

Module mcp 

Source
Expand description

MCP over HTTP at /mcp: the Streamable HTTP transport’s request half. A client POSTs one JSON-RPC message (or a batch) and gets the response in the body; the server answers initialize with an Mcp-Session-Id header, requires it on every later request, and forgets the session on DELETE or after a silence longer than SESSION_IDLE_TIMEOUT. There is no server-initiated stream (GET is 405): this server sends no notifications, so a stream would carry nothing.

Every session is one Server over the shared surface, seen from its own peer, so the stdio bridges of other majordomus mcp processes and clients speaking this transport directly are peers of one board, and peers.announce knows who spoke.

Structs§

McpEndpoint
The endpoint: the sessions it holds and the surface they share.

Constants§

PATH
The path of the endpoint.
SESSION_HEADER
The session header, as the transport specifies it (compared case-insensitively).
SESSION_IDLE_TIMEOUT
A session that has been silent this long is forgotten. A majordomus mcp bridge pings every crate::mcp::bridge::HEARTBEAT, well inside it; a client that speaks the transport directly and falls silent longer re-initialises on the 404 it gets, as the transport prescribes.

Functions§

is_initialize
Is this message, or any message of this batch, an initialize request?