Expand description
Streamable HTTP remote transport for MCP (axum + tokio). Streamable HTTP remote transport for MCP.
Exposes an McpServer over HTTP: a single JSON-RPC endpoint
(POST /mcp) returning JSON responses, per the Streamable HTTP transport.
The server’s Authorization (Bearer) check applies to every request, so a
server secured for stdio is secured identically over HTTP.
This is a dual-era endpoint: modern (stateless, _meta-carrying) requests
are validated against the standard request headers
(MCP-Protocol-Version, Mcp-Method, Mcp-Name) and answered per the
2026-07-28 revision; legacy initialize-handshake requests are served
per the negotiated legacy revision with no header requirements.
The transport holds the server behind an Arc (shared across request
tasks) and dispatches tools/call via McpServer::call_tool_async, so
async handlers work transparently over HTTP.
Requires the mcp-http feature (axum + tokio).
Structs§
- Http
Transport - Shared MCP server state for the HTTP transport.
Functions§
- serve
- Run the MCP HTTP transport on
addruntil the server is stopped.