Expand description
§chuk-mcp
A Model Context Protocol (MCP) client and server library — the Rust port of
the Python chuk-mcp package.
Layers mirror the Python package:
protocol— JSON-RPC messages, MCP types, versioning, feature message APIstransports— stdio, Streamable HTTP, and (legacy) SSE transportsclient— high-levelclient::McpClientserver— high-levelserver::McpServerand protocol handler
§Quick start
[connect] takes a URL or a command line, picks the transport, detects the
protocol era and completes its handshake:
let client = chuk_mcp::connect("https://example.com/mcp").await?;
let tools = client.list_tools().await?;With options, or to say exactly which transport you want:
use chuk_mcp::Connect;
let client = Connect::to_command("python", ["server.py"])
.timeout(std::time::Duration::from_secs(10))
.connect()
.await?;Re-exports§
pub use client::McpClient;pub use client::connect_to_server;Deprecated pub use connect::connect;pub use connect::Connect;pub use connect::Target;pub use protocol::envelope::build_envelope;pub use protocol::envelope::ClientIdentity;pub use protocol::envelope::Envelope;pub use protocol::era::renegotiate;pub use protocol::era::Detection;pub use protocol::era::EndpointKey;pub use protocol::era::EraCache;pub use protocol::era::EraMode;pub use protocol::era::ProtocolEra;pub use protocol::era::ServerProfile;pub use protocol::header_params::HeaderParam;pub use protocol::json_rpc::JsonRpcMessage;pub use protocol::meta::RequestMeta;pub use protocol::types::capabilities::ClientCapabilities;pub use protocol::types::capabilities::ServerCapabilities;pub use protocol::types::errors::McpError;pub use protocol::types::info::ClientInfo;pub use protocol::types::info::ServerInfo;pub use server::McpServer;pub use transports::stdio::StdioParameters;
Modules§
- auth
- OAuth 2.1 authorization for HTTP transports.
- client
- High-level MCP client, mirroring
chuk_mcp.client. - connect
- One way to connect to anything.
- prelude
- The names most programs need, in one import.
- protocol
- Shared protocol components: JSON-RPC handling, MCP types, versioning, and the per-feature message APIs.
- server
- High-level MCP server, mirroring
chuk_mcp.server. - transports
- Pluggable transport implementations, mirroring
chuk_mcp.transports.