Expand description
Model Context Protocol integration for agentkit, built on top of rmcp.
This crate exposes:
McpServerConfig/McpTransportBinding/StdioTransportConfig/StreamableHttpTransportConfig— declarative transport configuration.McpConnection— a live, single-server connection wrappingrmcp::service::RunningService.McpServerManager— multi-server lifecycle, discovery, catalog diffing, and auth replay.McpServerHandle, [McpToolExecutor],McpToolAdapter,McpResourceHandle,McpPromptHandle,McpCapabilityProvider— bridges into the agentkitTool/ capabilities systems.
Wire-protocol types (CallToolResult, ReadResourceResult, Content,
ToolAnnotations, Prompt, sampling/elicitation/roots payloads, …) are
re-exported from rmcp::model directly — there is no parallel
agentkit-side vocabulary. As rmcp tracks new MCP spec revisions, those
types and their fields propagate into agentkit unchanged.
Structs§
- Auth
Request - An auth challenge raised by an MCP server during a tool call, resource read, prompt fetch, or connection handshake.
- Call
Tool Result - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. The result of a tool call operation.
- GetPrompt
Result - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- Logging
Capability - Logging sub-capability. Spec reserves the key with no defined sub-fields yet.
- McpAnnotations
- Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- McpCancelled
Notification Param - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- McpCapability
Provider - A
CapabilityProviderthat surfaces MCP tools, resources, and prompts. - McpClient
Capabilities - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- McpClient
Channels - Channels paired with an
McpClientHandlerreturned byMcpHandlerConfig::build. - McpClient
Handler - rmcp
ClientHandlerused byMcpConnection. - McpConnect
AllSettled - Best-effort outcome returned by
McpServerManager::connect_all_settled. - McpConnection
- A live connection to a single MCP server, wrapping an
rmcp::service::RunningService. - McpCreate
Elicitation Result - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. The result returned by a client in response to an elicitation request.
- McpCreate
Message Request Params - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Parameters for creating a message through LLM sampling.
- McpCreate
Message Result - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Result of sampling/createMessage (SEP-1577). The result of a sampling/createMessage request containing the generated response.
- McpDiscovery
Snapshot - A snapshot of all capabilities discovered from a single MCP server.
- McpElicitation
Capability - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Elicitation allows servers to request interactive input from users during tool execution. This capability indicates that a client can handle elicitation requests and present appropriate UI to users for collecting the requested information.
- McpError
Context - Context describing which server / method / input produced the
invocation error currently being inspected by
McpErrorResponder::handle. - McpForm
Elicitation Capability - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Capability for handling elicitation requests from servers. Elicitation allows servers to request interactive input from users during tool execution. This capability indicates that a client can handle elicitation requests and present appropriate UI to users for collecting the requested information.
- McpHandler
Config - Configuration applied to every
McpClientHandlerthis crate builds on behalf of a connection orMcpServerManager. - McpImplementation
- Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- McpList
Roots Result - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- McpLogging
Message Notification Param - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Parameters for a logging message notification
- McpProgress
Notification Param - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- McpPrompt
- Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. A prompt that can be used to generate text from a model
- McpPrompt
Handle - Adapter exposing a single MCP prompt as a
PromptProvider. - McpRaw
Resource - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Represents a resource in the extension with metadata
- McpResource
Handle - Adapter exposing a single MCP resource as a
ResourceProvider. - McpResource
Updated Notification Param - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Parameters for a resource update notification
- McpRoot
- Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- McpRoots
Capabilities - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- McpSampling
Capability - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Sampling capability with optional sub-capabilities (SEP-1577).
- McpSampling
Message - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. A message in a sampling conversation, containing a role and content.
- McpServer
Capabilities - Capabilities advertised by an MCP server during the
initializehandshake. - McpServer
Config - Full configuration for a single MCP server.
- McpServer
Connection Error - Connection failure for one server returned by
McpServerManager::connect_all_settled. - McpServer
Handle - A connected MCP server together with its configuration and snapshot.
- McpServer
Id - Unique identifier for a registered MCP server.
- McpServer
Manager - Manages the lifecycle of one or more MCP servers.
- McpServer
Options - Per-server lifecycle options used by
McpServerManager. - McpSet
Level Request Params - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Parameters for setting the logging level
- McpSse
- Re-export of the SSE event/error types referenced by
McpHttpClient::get_stream. - McpTool
- Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. A tool that can be used by a model.
- McpTool
Adapter - Adapter exposing an MCP tool as an agentkit
Tool. - McpTool
Annotations - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Additional properties describing a Tool to clients.
- McpUrl
Elicitation Capability - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Capability for URL mode elicitation.
- Prompt
Argument - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Represents a prompt argument that can be passed to customize the prompt
- Prompt
Message - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. A message in a prompt conversation
- Prompts
Capability - Prompts sub-capability flags from the MCP
initializeresponse. - RawAudio
Content - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- RawEmbedded
Resource - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- RawImage
Content - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- RawText
Content - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- Read
Resource Result - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Result containing the contents of a read resource
- Resources
Capability - Resources sub-capability flags from the MCP
initializeresponse. - Stdio
Transport Config - Configuration for an MCP server that communicates over standard I/O.
- Streamable
Http Transport Config - Configuration for an MCP server that communicates over the MCP Streamable HTTP transport.
- Tools
Capability - Tools sub-capability flags from the MCP
initializeresponse. - UrlElicitation
Data - Typed payload for the URL elicitation error case.
Enums§
- Auth
Operation - The MCP operation that triggered an
AuthRequest. - Auth
Resolution - Outcome of an
AuthRequestafter the host’sMcpAuthResponderruns. - Error
Responder Outcome - Decision returned by an
McpErrorResponder. - McpCatalog
Event - Catalog and lifecycle events emitted by
McpServerManager. - McpCreate
Elicitation Request Params - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Parameters for creating an elicitation request to gather user input.
- McpElicitation
Action - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Represents the possible actions a user can take in response to an elicitation request.
- McpError
- Errors produced by MCP transport, protocol, and lifecycle operations.
- McpInvocation
Error - Typed view of a JSON-RPC error returned by an MCP server for an invoked method.
- McpLogging
Level - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Logging levels supported by the MCP protocol
- McpMethod
- Typed dispatch for MCP requests that may surface auth or invocation
errors. Each peer call constructs the matching variant;
[
auth_request_from_signal] converts to a publicAuthOperation(typed for the four common cases,AuthOperation::McpOtherfor the long tail). The same value is also exposed toMcpErrorResponderimplementations viaMcpErrorContext::method. - McpOperation
Result - The result of replaying an MCP operation after auth resolution.
- McpResource
Contents - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- McpServer
Event - Server-pushed events broadcast to every
McpConnection::subscribe_eventsreceiver. - McpServer
Notification - Server-originated catalog notifications observed by
McpClientHandler. - McpSse
Error - Re-export of the SSE event/error types referenced by
McpHttpClient::get_stream. - McpStreamable
Http Error - Re-exports of the rmcp Streamable HTTP transport types used by
McpHttpClientimplementations. - McpStreamable
Http Post Response - Re-exports of the rmcp Streamable HTTP transport types used by
McpHttpClientimplementations. - McpTool
Namespace - Strategy used to derive the agentkit-side tool name for an MCP tool.
- McpTransport
Binding - Selects which transport an MCP server should use.
- Prompt
Message Content - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Content types that can be included in prompt messages
- Prompt
Message Role - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc. Represents the role of a message sender in a prompt conversation
- RawContent
- Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
Traits§
- McpAuth
Responder - Host-supplied resolver for MCP auth challenges.
- McpElicitation
Responder - Pluggable handler invoked when an MCP server issues
elicitation/create. - McpError
Responder - Userland hook invoked when an MCP server returns a JSON-RPC error for an invoked method.
- McpHttp
Client - Pluggable HTTP transport for the MCP Streamable HTTP client.
- McpRoots
Provider - Pluggable handler invoked when an MCP server issues
roots/list. - McpSampling
Responder - Pluggable handler invoked when an MCP server issues
sampling/createMessage.
Type Aliases§
- Audio
Content - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- Client
Json RpcMessage - Re-export of the JSON-RPC client→server envelope handed to
McpHttpClient::post_message. - Content
- Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- Embedded
Resource - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- Image
Content - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- McpPrompt
Descriptor - Alias for
McpPrompt. - McpResource
- Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.
- McpResource
Descriptor - Alias for
McpResource. - McpSse
Stream - Type alias for the SSE stream returned by
McpHttpClient::get_stream. - McpTool
Descriptor - Alias for
McpTool. - Text
Content - Re-exports of the rmcp wire-protocol types this crate now surfaces directly instead of wrapping. Pull these in to pattern-match on tool annotations, content blocks, structured tool output, embedded resources, sampling / elicitation requests, progress and log notifications, etc.