Modules§
- auth
- error
- id_
generator - macros
- mcp_
client - Includes the runtimes and traits required to create a type-safe MCP client.
- mcp_
http - mcp_
server - Includes the runtimes and traits required to create a type-safe MCP server.
- schema
- tool_
param_ headers - SEP-2243 client support —
x-mcp-headertool parameter annotations.
Macros§
- mcp_
icon - Convenience macro to construct an
Iconwith shorthand syntax. - tool_
box - Generates an enum representing a toolbox with mcp tool variants and associated functionality.
- with_
middlewares - A helper macro to wrap an async handler method into a
RequestHandlerand compose it with middlewares.
Structs§
- Client
Details - Client identity and capabilities for an MCP client.
- Client
SseTransport - Client-side Server-Sent Events (SSE) transport implementation
- Client
SseTransport Options - Configuration options for the Client SSE Transport
- Client
Streamable Transport - Generic
Send Error - A wrapper around a broadcast send error. This structure allows for generic error handling by boxing the underlying error into a type-erased form.
- Generic
Watch Send Error - A wrapper around a broadcast send error. This structure allows for generic error handling by boxing the underlying error into a type-erased form.
- Message
Dispatcher - Provides a dispatcher for sending MCP messages and handling responses.
- Request
Context - Per-request context extracted from
RequestMetaObjectand carried to every handler. - Request
IdGen Numeric - Request
Options - Server
Details - Server identity, capabilities and instructions for an MCP server.
- SseEvent
- Represents a single Server-Sent Event (SSE) as defined in the SSE protocol.
- SseTransport
- Stdio
Transport - Implements a standard I/O transport for MCP communication.
- Streamable
Transport Options - Transport
Options - Configuration for the transport layer
Enums§
- IoStream
- Enum representing a stream that can either be readable or writable. This allows the reuse of the same traits for both MCP Server and MCP Client, where the data direction is reversed.
- Required
Client Capability - A client capability that a server handler may require.
- Transport
Error
Constants§
- DEFAULT_
MAX_ LINE_ LENGTH - Maximum size (in bytes) of a single newline-delimited incoming message for all transports (stdio, SSE, streamable HTTP). Messages exceeding this limit are dropped silently; increase this value if you expect large tool results or responses.
- MCP_
LAST_ EVENT_ ID_ HEADER - MCP_
METHOD_ HEADER - SEP-2243 standard request header naming the JSON-RPC method of the request
body (e.g.
tools/call). Required on the 2026-07-28 stateless wire. - MCP_
NAME_ HEADER - SEP-2243 standard request header naming the tool/prompt/resource the
request targets (
params.nameorparams.uri), when the method has one. - MCP_
PROTOCOL_ VERSION_ HEADER - MCP_
SESSION_ ID_ HEADER
Traits§
- IdGenerator
- Trait for generating unique identifiers.
- McpClient
- McpClient
Handler - McpDispatch
- A trait for dispatching MCP (Message Communication Protocol) messages.
- McpHttp
Server - Common interface for running MCP servers over HTTP transports.
- McpObserver
- Observer hook for incoming/outgoing messages. Implementations should be fast and preferably non-blocking.
- McpServer
- McpServer
Handler - Request
IdGen - A trait for generating and managing request IDs in a thread-safe manner.
- ToMcp
Client Handler - ToMcp
Client Handler Core - ToMcp
Server Handler - ToMcp
Server Handler Core - Transport
- A trait representing the transport layer for the MCP (Message Communication Protocol).
- Transport
Dispatcher - A composite trait that combines both transport and dispatch capabilities for the MCP protocol.
Type Aliases§
- EventId
- Request
Header Provider - Hook computing extra HTTP headers for a given outgoing POST payload
(e.g. SEP-2243
Mcp-Param-*mirroring, rotating bearer tokens). - Session
Id - Stream
Id - Transport
Result