Skip to main content

Crate turul_http_mcp_server

Crate turul_http_mcp_server 

Source
Expand description

§HTTP MCP Server

Production HTTP transport layer for Model Context Protocol (MCP) servers.

Provides both modern Streamable HTTP and legacy HTTP+SSE transports with automatic protocol detection, CORS support, and session management for maximum compatibility.

Crates.io Documentation

§Installation

[dependencies]
turul-http-mcp-server = "0.4"
turul-mcp-server = "0.4"

§Supported Transports

  • Streamable HTTP: Recommended for production deployments
  • HTTP+SSE: Legacy transport for backwards compatibility

§Features

  • Automatic protocol version detection and routing
  • CORS support for browser-based clients
  • Session management with cryptographically secure IDs
  • Graceful error handling and JSON-RPC 2.0 compliance

§Quick Start

use turul_http_mcp_server::HttpMcpServerBuilder;
use std::net::SocketAddr;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let addr: SocketAddr = "127.0.0.1:8080".parse()?;
    let server = HttpMcpServerBuilder::new()
        .bind_address(addr)
        .cors(true)
        .build();

    println!("Server running on http://127.0.0.1:8080/mcp");
    server.run().await?;
    Ok(())
}

Re-exports§

pub use cors::CorsLayer;
pub use notification_bridge::BroadcastError;
pub use notification_bridge::NotificationBroadcaster;
pub use notification_bridge::SharedNotificationBroadcaster;
pub use notification_bridge::StreamManagerNotificationBroadcaster;
pub use origin::OriginPolicy;
pub use protocol::McpProtocolVersion;
pub use protocol::extract_last_event_id;
pub use protocol::extract_protocol_version;
pub use protocol::extract_session_id;
pub use routes::RouteBody;
pub use routes::RouteHandler;
pub use routes::RouteRegistry;
pub use routes::RouteValidationError;
pub use server::HttpMcpServer;
pub use server::HttpMcpServerBuilder;
pub use server::ServerConfig;
pub use server::ServerStats;
pub use session_handler::SessionMcpHandler;
pub use session_handler::SessionSseStream;
pub use stream_manager::StreamConfig;
pub use stream_manager::StreamError;
pub use stream_manager::StreamManager;
pub use stream_manager::StreamStats;
pub use streamable_http::StreamableHttpContext;
pub use streamable_http::StreamableHttpHandler;

Modules§

caching
Core MCP protocol types and error handling Cache-control hints for results (SEP-2549).
completion
Core MCP protocol types and error handling MCP Completion Protocol Types
content
Core MCP protocol types and error handling Content block types for MCP 2026-07-28.
cors
CORS (Cross-Origin Resource Sharing) support
discover
Core MCP protocol types and error handling server/discover types for MCP 2026-07-28.
elicitation
Core MCP protocol types and error handling MCP Elicitation Protocol Types
handler
SSE stream body utilities for MCP protocol
headers
Core MCP protocol types and error handling HTTP header name constants for MCP Streamable HTTP transport (SEP-2243, changelog Minor #4).
icons
Core MCP protocol types and error handling MCP Icon Types
initialize
Core MCP protocol types and error handling Shared capability and implementation identity types for MCP 2026-07-28.
input_required
Core MCP protocol types and error handling Multi-round-trip input requests for MCP 2026-07-28 (SEP-2322).
json_rpc
Core MCP protocol types and error handling MCP-specific params and result shapes that layer on top of generic JSON-RPC 2.0 wire envelopes from turul-rpc.
json_rpc_responses
JSON-RPC 2.0 response builders for HTTP transport
logging
Core MCP protocol types and error handling MCP Logging Protocol Types
mcp_session
Streamable HTTP session management for MCP transport
meta
Core MCP protocol types and error handling _meta Field Support for MCP 2026-07-28.
middleware
Middleware system for MCP servers
notification_bridge
Notification Bridge - Connects NotificationBroadcaster to StreamManager
notifications
Core MCP protocol types and error handling Notification payload types for MCP 2026-07-28.
origin
Origin-header validation (DNS-rebinding protection) for the MCP endpoint.
param_extraction
Core MCP protocol types and error handling Parameter extraction utilities for MCP protocol
ping
Core MCP protocol types and error handling EmptyResult and EmptyParams — utility shapes for empty payloads.
prelude
HTTP MCP Server Prelude
prompts
Core MCP protocol types and error handling MCP Prompts Protocol Types
protocol
MCP Protocol Version Detection and Features
resources
Core MCP protocol types and error handling MCP Resources Protocol Types
result_type
Core MCP protocol types and error handling Result discrimination for MCP 2026-07-28.
roots
Core MCP protocol types and error handling MCP Roots Protocol Types
routes
Route registry for custom HTTP paths (e.g., .well-known endpoints)
sampling
Core MCP protocol types and error handling MCP Sampling Protocol Types
schema
Core MCP protocol types and error handling JSON Schema Support for MCP
server
HTTP MCP Server with SessionStorage integration
session_handler
JSON-RPC 2.0 over HTTP handler for MCP requests with SessionStorage integration
sse
Server-Sent Events (SSE) support for MCP
stream_manager
Enhanced Stream Manager with MCP 2025-11-25 Resumability
streamable_http
Streamable HTTP Transport for MCP 2025-11-25
subscriptions
Core MCP protocol types and error handling Unified subscription stream for MCP 2026-07-28.
tools
Core MCP protocol types and error handling MCP Tools Protocol Types
traits
Core MCP protocol types and error handling Traits for JSON-RPC types as per MCP specification (2026-07-28).
version
Core MCP protocol types and error handling MCP Protocol Version Support

Macros§

impl_serde_extractor
Core MCP protocol types and error handling Macro to implement SerdeParamExtractor for any Params type that implements Deserialize

Structs§

Annotations
Core MCP protocol types and error handling Annotations for resources, prompts, and tools — audience, priority, last_modified. Carried on Resource, ResourceTemplate, Prompt, Tool (via ToolAnnotations), and ContentBlock.
BlobResourceContents
Core MCP protocol types and error handling Binary resource contents (matches TypeScript BlobResourceContents exactly)
CacheableResult
Core MCP protocol types and error handling Cacheable-result mixin per schema. Embed via #[serde(flatten)]:
CallToolRequest
Core MCP protocol types and error handling Inner content of a tools/call request (method name and parameters).
CallToolResult
Core MCP protocol types and error handling Result for tools/call — extends Result.
CancelledNotification
Core MCP protocol types and error handling Method: “notifications/cancelled”
ClientCapabilities
Core MCP protocol types and error handling Capabilities that a client may support.
DiscoverRequest
Core MCP protocol types and error handling Client → server server/discover request.
DiscoverResult
Core MCP protocol types and error handling Server → client server/discover result.
DiscoverResultResponse
Core MCP protocol types and error handling Envelope JSONRPCResultResponse specialized to carry a DiscoverResult.
ElicitRequest
Core MCP protocol types and error handling elicitation/create request.
ElicitRequestFormParams
Core MCP protocol types and error handling Form-mode elicitation params. Per schema this interface does NOT extend RequestParams — no _meta field.
ElicitResult
Core MCP protocol types and error handling The client’s response to an elicitation request: { action: "accept"|"decline"|"cancel", content?: {[k]: string|number|boolean|string[]} }.
ElicitationBuilder
Core MCP protocol types and error handling Builder for creating common elicitation patterns
ElicitationSchema
Core MCP protocol types and error handling Restricted schema for elicitation (only primitive types, no nesting) - per MCP spec
EmptyParams
Core MCP protocol types and error handling
EmptyResult
Core MCP protocol types and error handling EmptyResult — the Result shape with no extra fields.
GetPromptRequest
Core MCP protocol types and error handling Complete prompts/get request (matches TypeScript GetPromptRequest interface)
GetPromptResult
Core MCP protocol types and error handling Result for prompts/get — extends Result. Note GetPromptResultResponse.result is a GetPromptResult | InputRequiredResult union; callers needing the InputRequired variant should return crate::input_required::InputRequiredResult directly.
Icon
Core MCP protocol types and error handling Icon for tools, resources, prompts, and implementations. Icons are display hints — most implementations do not need icons. Defined on tool/resource/prompt/implementation interfaces in the 2026-07-28 schema.
Implementation
Core MCP protocol types and error handling Describes the name and version of an MCP implementation
InputRequiredResult
Core MCP protocol types and error handling A Result discriminated as "input_required" — server signals that additional input must be gathered and the original request re-issued.
InputResponseRequestParams
Core MCP protocol types and error handling Mixin shape that may appear on the params of any client-initiated request, allowing the client to attach prior input responses + echoed request state.
JsonRpcDispatcher
JSON-RPC 2.0 dispatcher and handler trait for protocol operations JSON-RPC method dispatcher with a typed domain-error type.
JsonRpcError
Core MCP protocol types and error handling JSON-RPC Error response
JsonRpcErrorObject
Core MCP protocol types and error handling JSON-RPC Error object
JsonRpcNotification
Core MCP protocol types and error handling A JSON-RPC notification (request without an id)
JsonRpcRequest
Core MCP protocol types and error handling A JSON-RPC request
JsonRpcSuccessResponse
Core MCP protocol types and error handling A successful JSON-RPC response object (JSON-RPC 2.0 §5, success case): {jsonrpc, id, result}.
ListPromptsRequest
Core MCP protocol types and error handling Complete prompts/list request — ListPromptsRequest extends PaginatedRequest { method: "prompts/list" }.
ListPromptsResult
Core MCP protocol types and error handling Result for prompts/list (per MCP spec)
ListResourcesRequest
Core MCP protocol types and error handling Complete resources/list request — ListResourcesRequest extends PaginatedRequest { method: "resources/list" }.
ListResourcesResult
Core MCP protocol types and error handling Result for resources/list — extends PaginatedResult and CacheableResult.
ListToolsRequest
Core MCP protocol types and error handling Complete tools/list request — ListToolsRequest extends PaginatedRequest { method: "tools/list" }.
ListToolsResult
Core MCP protocol types and error handling Result for tools/list — extends PaginatedResult and CacheableResult.
LoggingMessageNotificationDeprecated
Core MCP protocol types and error handling Method: “notifications/message”.
LoggingMessageNotificationParamsDeprecated
Core MCP protocol types and error handling Deprecated per SEP-2577 — see LoggingMessageNotification.
MetaCursor
Core MCP protocol types and error handling Cursor for pagination support
Notification
Core MCP protocol types and error handling Base notification structure following MCP TypeScript specification
NotificationParams
Core MCP protocol types and error handling Base notification parameters that can include _meta
PaginatedRequestParams
Core MCP protocol types and error handling params shape for any request that extends PaginatedRequestPaginatedRequestParams extends RequestParams { cursor?: Cursor }.
ProgressNotification
Core MCP protocol types and error handling Method: “notifications/progress”
ProgressNotificationParams
Core MCP protocol types and error handling
Prompt
Core MCP protocol types and error handling A prompt descriptor (matches TypeScript Prompt interface exactly)
PromptArgument
Core MCP protocol types and error handling Argument definition for prompts (extends BaseMetadata per MCP spec)
PromptListChangedNotification
Core MCP protocol types and error handling MCP notification payload for “notifications/prompts/list_changed”.
PromptMessage
Core MCP protocol types and error handling Message content for prompts (matches MCP PromptMessage interface exactly)
ReadResourceRequest
Core MCP protocol types and error handling Complete resources/read request (matches TypeScript ReadResourceRequest interface)
ReadResourceResult
Core MCP protocol types and error handling Result for resources/readReadResourceResult extends CacheableResult. Caller may also return InputRequiredResult via the ReadResourceResultResponse.result union.
RequestMetaObject
Core MCP protocol types and error handling Strictly-typed request _meta carrying the per-request capability negotiation. See also MetaObject for key naming rules and reserved prefixes, and General fields: _meta for the full spec section.
RequestParams
Core MCP protocol types and error handling JSON-RPC params object for any request — _meta is required per 2026-07-28 stateless core (carries protocolVersion, clientInfo, clientCapabilities for per-request negotiation).
Resource
Core MCP protocol types and error handling A resource descriptor (matches TypeScript Resource interface) Resource extends BaseMetadata, so it includes name and title fields
ResourceListChangedNotification
Core MCP protocol types and error handling MCP notification payload for “notifications/resources/list_changed”.
ResourceReference
Core MCP protocol types and error handling Resource reference for resource links.
ResourceUpdatedNotification
Core MCP protocol types and error handling Method: “notifications/resources/updated”
ResourceUpdatedNotificationParams
Core MCP protocol types and error handling
ServerCapabilities
Core MCP protocol types and error handling Capabilities that a server may support.
SubscriptionFilter
Core MCP protocol types and error handling Opt-in filter for which notification types the client wants on this stream.
SubscriptionsAcknowledgedNotification
Core MCP protocol types and error handling notifications/subscriptions/acknowledged — sent by the server as the first message on a subscriptions/listen stream.
SubscriptionsAcknowledgedNotificationParams
Core MCP protocol types and error handling Params for the acknowledgement notification.
SubscriptionsListenRequest
Core MCP protocol types and error handling subscriptions/listen request.
SubscriptionsListenRequestParams
Core MCP protocol types and error handling Params for subscriptions/listenSubscriptionsListenRequestParams extends RequestParams, so _meta is the typed crate::meta::RequestMetaObject carrying the per-request capability negotiation (protocol version, client info, client capabilities). Required by schema.
SubscriptionsListenResult
Core MCP protocol types and error handling The response to a subscriptions/listen request, signalling that the subscription ended gracefully (e.g. server shutdown). The listen stream is long-lived, so this result is sent only when the server tears the subscription down deliberately — an abrupt transport close carries no response. The result body is otherwise empty; _meta.subscriptionId is the only substantive field.
SubscriptionsListenResultMetaObject
Core MCP protocol types and error handling _meta for SubscriptionsListenResult. Schema: SubscriptionsListenResultMetaObject extends ResultMetaObject with a REQUIRED io.modelcontextprotocol/subscriptionId: RequestId — the id of the subscriptions/listen request this result closes (equals the result’s own id in the JSON-RPC envelope). Extending crate::meta::ResultMetaObject means it also carries the optional io.modelcontextprotocol/serverInfo.
SubscriptionsListenResultResponse
Core MCP protocol types and error handling JSON-RPC envelope carrying a SubscriptionsListenResult, sent when the server tears the subscription down gracefully.
TextResourceContents
Core MCP protocol types and error handling Text resource contents (matches TypeScript TextResourceContents exactly)
Tool
Core MCP protocol types and error handling Tool definition
ToolListChangedNotification
Core MCP protocol types and error handling MCP notification payload for “notifications/tools/list_changed”.
ToolOutputSchema
Core MCP protocol types and error handling JSON Schema for Tool.outputSchema per 2026-07-28:
ToolSchema
Core MCP protocol types and error handling JSON Schema for Tool.inputSchema per 2026-07-28:

Enums§

CacheScope
Core MCP protocol types and error handling Cache-sharing scope, analogous to HTTP Cache-Control: public / private.
ContentBlock
Core MCP protocol types and error handling Content block union — text | image | audio | resource_link | resource | tool_use | tool_result.
ElicitAction
Core MCP protocol types and error handling User action in response to elicitation
HttpMcpError
HTTP MCP specific errors
IconTheme
Core MCP protocol types and error handling Theme preference for an icon (light or dark mode). Defined on tool/resource/prompt/implementation interfaces in the 2026-07-28 schema.
InputRequest
Core MCP protocol types and error handling Server → client request emitted as part of an InputRequiredResult.
InputResponse
Core MCP protocol types and error handling Client → server response for an InputRequest, keyed by the server-assigned identifier from the corresponding InputRequests entry.
JsonRpcErrorCode
Core MCP protocol types and error handling JSON-RPC error codes
JsonRpcMessage
Core MCP protocol types and error handling Enum representing the inbound JSON-RPC messages a server parses: a request or a notification. Responses are produced, not parsed here, and live in turul_rpc_core::response::JsonRpcResponse.
JsonRpcParams
Core MCP protocol types and error handling Parameters for a JSON-RPC request
JsonRpcResponse
Core MCP protocol types and error handling A JSON-RPC Response object (JSON-RPC 2.0 §5): success XOR error.
JsonRpcVersion
Core MCP protocol types and error handling JSON-RPC version
JsonRpcWireMessage
Core MCP protocol types and error handling Any single JSON-RPC 2.0 message read off the wire, in either direction.
JsonSchema
Core MCP protocol types and error handling A JSON Schema definition
McpError
Core MCP protocol types and error handling MCP-specific errors
McpVersion
Core MCP protocol types and error handling Supported MCP protocol versions
PrimitiveSchemaDefinition
Core MCP protocol types and error handling Restricted schema definitions that only allow primitive types without nested objects or arrays (per MCP spec).
ProgressToken
Core MCP protocol types and error handling Progress token for tracking long-running operations.
ProgressTokenValue
Core MCP protocol types and error handling Progress token for tracking long-running operations.
RequestId
Core MCP protocol types and error handling A uniquely identifying ID for a JSON-RPC request: a String, a Number, or Null.
ResourceContent
Core MCP protocol types and error handling Union type for resource contents (matches TypeScript union)
ResourceContents
Core MCP protocol types and error handling Resource contents union type (matches TypeScript TextResourceContents | BlobResourceContents)
ResponseResult
Core MCP protocol types and error handling Result data for a JSON-RPC response
ResultType
Core MCP protocol types and error handling Discriminator for Result-shaped responses.
StringFormat
Core MCP protocol types and error handling String format constraints

Constants§

CURRENT_VERSION
Core MCP protocol types and error handling The current MCP protocol version implemented by this crate
ERROR_CODE_HEADER_MISMATCH
Core MCP protocol types and error handling JSON-RPC error code for header-validation failures. Matches the schema’s HEADER_MISMATCH const and HeaderMismatchError interface. Returned with HTTP 400 Bad Request when a required standard header is missing/malformed or a header value does not match the corresponding request-body value.
HTTP_HEADER_METHOD
Core MCP protocol types and error handling Mcp-Method — REQUIRED per SEP-2243 on all requests and notifications. Carries the JSON-RPC method string at the HTTP layer to enable intelligent routing without body inspection. Servers MUST reject requests where this header and the body’s method disagree.
HTTP_HEADER_NAME
Core MCP protocol types and error handling Mcp-Name — REQUIRED per SEP-2243 for tools/call (params.name), resources/read (params.uri), and prompts/get (params.name). Servers MUST reject requests where this header and the body’s value disagree.
HTTP_HEADER_PARAM_PREFIX
Core MCP protocol types and error handling Mcp-Param-{name} — header name prefix for custom headers mirrored from tool parameters (SEP-2243 §Custom Headers from Tool Parameters).
HTTP_HEADER_PROTOCOL_VERSION
Core MCP protocol types and error handling MCP-Protocol-Version — REQUIRED on every Streamable HTTP POST. Must match _meta.io.modelcontextprotocol/protocolVersion in the request body (servers MUST return 400 Bad Request on mismatch per the RequestMetaObject schema).
JSONRPC_VERSION
Core MCP protocol types and error handling JSON-RPC version constant. Mirrors turul_rpc::JSONRPC_VERSION for the few sites that still need a &str literal rather than the typed enum.
MCP_PARAM_BASE64_PREFIX
Core MCP protocol types and error handling Sentinel prefix marking a Base64-encoded Mcp-Param-* value (=?base64?{Base64EncodedValue}?=, case-sensitive, lowercase).
MCP_PARAM_BASE64_SUFFIX
Core MCP protocol types and error handling Sentinel suffix closing a Base64-encoded Mcp-Param-* value.
MCP_VERSION
Core MCP protocol types and error handling The MCP protocol version string this crate currently targets, exactly as it appears on the wire in LATEST_PROTOCOL_VERSION of the upstream schema.ts.
META_KEY_BAGGAGE
Core MCP protocol types and error handling _meta key carrying the W3C Trace Context baggage header value per SEP-414. Conventional, not schema-declared.
META_KEY_CLIENT_CAPABILITIES
Core MCP protocol types and error handling Schema-declared _meta key for the request client capabilities.
META_KEY_CLIENT_INFO
Core MCP protocol types and error handling Schema-declared _meta key for the request client info.
META_KEY_LOG_LEVELDeprecated
Core MCP protocol types and error handling Schema-declared _meta key for the per-request log level opt-in. Declared as the named field io.modelcontextprotocol/logLevel on RequestMetaObject. The constant is provided for use when callers index into a generic MetaObject and want the spelling pinned.
META_KEY_PROTOCOL_VERSION
Core MCP protocol types and error handling Schema-declared _meta key for the request protocol version.
META_KEY_SUBSCRIPTION_ID
Core MCP protocol types and error handling _meta key carrying the subscription id used by the server to tag notifications delivered on a subscriptions/listen stream. Schema-declared: NotificationMetaObject.io.modelcontextprotocol/subscriptionId (optional; value = the RequestId of the subscriptions/listen request that opened the stream) and SubscriptionsListenResultMetaObject.io.modelcontextprotocol/subscriptionId (required, on the result that closes the stream).
META_KEY_TRACEPARENT
Core MCP protocol types and error handling _meta key carrying the W3C Trace Context traceparent header value per SEP-414. Conventional, not schema-declared.
META_KEY_TRACESTATE
Core MCP protocol types and error handling _meta key carrying the W3C Trace Context tracestate header value per SEP-414. Conventional, not schema-declared.
SERVER_DISCOVER_METHOD
Core MCP protocol types and error handling Wire method string for the discover RPC.
SUBSCRIPTIONS_ACKNOWLEDGED_METHOD
Core MCP protocol types and error handling Wire method string for the acknowledgement notification.
SUBSCRIPTIONS_LISTEN_METHOD
Core MCP protocol types and error handling Wire method string for the subscription RPC.
X_MCP_HEADER_SCHEMA_KEY
Core MCP protocol types and error handling x-mcp-header — the JSON Schema extension property (inside a tool’s inputSchema) that designates a parameter for header mirroring. This is a schema annotation key, NOT a wire header name — the wire header it produces is HTTP_HEADER_PARAM_PREFIX{name}.

Traits§

HasData
Core MCP protocol types and error handling Escape hatch — flatten a typed result into a JSON-object map. Not part of the RpcResult supertrait bound; consumers that need this should prefer serde_json::to_value. Retained for the rare framework site that needs an untyped view.
HasDataParam
Core MCP protocol types and error handling
HasErrorObject
Core MCP protocol types and error handling Exposes the error field on a JSONRPCErrorResponse. The schema’s Error interface maps to turul_rpc::error::JsonRpcErrorObject ({ code, message, data? }).
HasMeta
Core MCP protocol types and error handling Exposes Result._meta?: ResultMetaObject — the result-side carrier, which adds io.modelcontextprotocol/serverInfo on top of MetaObject. Borrowed, typed — no JSON round-trip.
HasMetaParam
Core MCP protocol types and error handling
HasNotificationMeta
Core MCP protocol types and error handling Exposes Notification.params._meta?. Separate from HasMeta because the schema gives the two sides different carriers: results extend MetaObject with serverInfo, notifications with subscriptionId. One trait returning one type cannot model both.
HasOptionalRequestId
Core MCP protocol types and error handling Optional request id — used by JSONRPCErrorResponse where the server may omit id if it couldn’t parse the original request’s id.
HasProgressTokenParam
Core MCP protocol types and error handling
HasRequestId
Core MCP protocol types and error handling Required request id — present on requests and successful responses. Schema: RequestId = string | number; we expose as borrowed Value for permissive accept (the typed narrowing is a separate follow-up).
HasResultType
Core MCP protocol types and error handling Exposes the resultType discriminator per the schema’s Result.resultType: ResultType field. Every spec-compliant result MUST carry this; per the schema doc-comment, absent values default to Complete for backward compatibility with pre-2026-07-28 servers.
JsonRpcErrorResponseTrait
Core MCP protocol types and error handling JSONRPCErrorResponse per schema — error response with optional id.
JsonRpcHandler
JSON-RPC 2.0 dispatcher and handler trait for protocol operations Trait for handling JSON-RPC method calls.
JsonRpcNotificationTrait
Core MCP protocol types and error handling
JsonRpcRequestTrait
Core MCP protocol types and error handling
JsonRpcResultResponseTrait
Core MCP protocol types and error handling JSONRPCResultResponse per schema — successful response carrying result.
Params
Core MCP protocol types and error handling
RpcResult
Core MCP protocol types and error handling Schema’s Result interface: { _meta?: ResultMetaObject, resultType: ResultType, [key: string]: unknown }. Bound to HasMeta + HasResultType — arbitrary [key: string]: unknown extra keys are domain-specific and expressed on the concrete struct itself.
ToolChangeNotifier
Awaitable notifier for tool change events (restart/redeploy fingerprint mismatch). Implemented by the server layer (backed by SessionManager → dispatcher). Used by HTTP handlers to persist notifications/tools/list_changed through the session architecture, not directly via StreamManager.

Functions§

parse_json_rpc_wire_message
Core MCP protocol types and error handling Parse a JSON string into a JsonRpcWireMessage.

Type Aliases§

InputRequests
Core MCP protocol types and error handling Map of server-assigned identifiers → server-initiated requests.
InputResponses
Core MCP protocol types and error handling Map of identifiers → client responses, keyed identically to the originating InputRequests.
McpResult
Core MCP protocol types and error handling Common result type for MCP operations
MetaObject
Core MCP protocol types and error handling Loose _meta carrier — Record<string, unknown> in the schema.
Result
Result type for HTTP MCP operations
ToolResult
Core MCP protocol types and error handling Alias for crate::content::ContentBlock kept for callers that reference the type by its older name.