Skip to main content

Crate agentkit_mcp

Crate agentkit_mcp 

Source
Expand description

Model Context Protocol integration for agentkit, built on top of rmcp.

This crate exposes:

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§

AuthRequest
An auth challenge raised by an MCP server during a tool call, resource read, prompt fetch, or connection handshake.
CallToolResult
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.
GetPromptResult
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.
LoggingCapability
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.
McpCancelledNotificationParam
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.
McpCapabilityProvider
A CapabilityProvider that surfaces MCP tools, resources, and prompts.
McpClientCapabilities
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.
McpClientChannels
Channels paired with an McpClientHandler returned by McpHandlerConfig::build.
McpClientHandler
rmcp ClientHandler used by McpConnection.
McpConnectAllSettled
Best-effort outcome returned by McpServerManager::connect_all_settled.
McpConnection
A live connection to a single MCP server, wrapping an rmcp::service::RunningService.
McpCreateElicitationResult
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.
McpCreateMessageRequestParams
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.
McpCreateMessageResult
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.
McpDiscoverySnapshot
A snapshot of all capabilities discovered from a single MCP server.
McpElicitationCapability
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.
McpErrorContext
Context describing which server / method / input produced the invocation error currently being inspected by McpErrorResponder::handle.
McpFormElicitationCapability
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.
McpHandlerConfig
Configuration applied to every McpClientHandler this crate builds on behalf of a connection or McpServerManager.
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.
McpListRootsResult
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.
McpLoggingMessageNotificationParam
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
McpProgressNotificationParam
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
McpPromptHandle
Adapter exposing a single MCP prompt as a PromptProvider.
McpRawResource
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
McpResourceHandle
Adapter exposing a single MCP resource as a ResourceProvider.
McpResourceUpdatedNotificationParam
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.
McpRootsCapabilities
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.
McpSamplingCapability
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).
McpSamplingMessage
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.
McpServerCapabilities
Capabilities advertised by an MCP server during the initialize handshake.
McpServerConfig
Full configuration for a single MCP server.
McpServerConnectionError
Connection failure for one server returned by McpServerManager::connect_all_settled.
McpServerHandle
A connected MCP server together with its configuration and snapshot.
McpServerId
Unique identifier for a registered MCP server.
McpServerManager
Manages the lifecycle of one or more MCP servers.
McpServerOptions
Per-server lifecycle options used by McpServerManager.
McpSetLevelRequestParams
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.
McpToolAdapter
Adapter exposing an MCP tool as an agentkit Tool.
McpToolAnnotations
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.
McpUrlElicitationCapability
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.
PromptArgument
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
PromptMessage
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
PromptsCapability
Prompts sub-capability flags from the MCP initialize response.
RawAudioContent
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.
RawEmbeddedResource
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.
RawImageContent
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.
RawTextContent
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.
ReadResourceResult
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
ResourcesCapability
Resources sub-capability flags from the MCP initialize response.
StdioTransportConfig
Configuration for an MCP server that communicates over standard I/O.
StreamableHttpTransportConfig
Configuration for an MCP server that communicates over the MCP Streamable HTTP transport.
ToolsCapability
Tools sub-capability flags from the MCP initialize response.
UrlElicitationData
Typed payload for the URL elicitation error case.

Enums§

AuthOperation
The MCP operation that triggered an AuthRequest.
AuthResolution
Outcome of an AuthRequest after the host’s McpAuthResponder runs.
ErrorResponderOutcome
Decision returned by an McpErrorResponder.
McpCatalogEvent
Catalog and lifecycle events emitted by McpServerManager.
McpCreateElicitationRequestParams
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.
McpElicitationAction
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.
McpInvocationError
Typed view of a JSON-RPC error returned by an MCP server for an invoked method.
McpLoggingLevel
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 public AuthOperation (typed for the four common cases, AuthOperation::McpOther for the long tail). The same value is also exposed to McpErrorResponder implementations via McpErrorContext::method.
McpOperationResult
The result of replaying an MCP operation after auth resolution.
McpResourceContents
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.
McpServerEvent
Server-pushed events broadcast to every McpConnection::subscribe_events receiver.
McpServerNotification
Server-originated catalog notifications observed by McpClientHandler.
McpSseError
Re-export of the SSE event/error types referenced by McpHttpClient::get_stream.
McpStreamableHttpError
Re-exports of the rmcp Streamable HTTP transport types used by McpHttpClient implementations.
McpStreamableHttpPostResponse
Re-exports of the rmcp Streamable HTTP transport types used by McpHttpClient implementations.
McpToolNamespace
Strategy used to derive the agentkit-side tool name for an MCP tool.
McpTransportBinding
Selects which transport an MCP server should use.
PromptMessageContent
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
PromptMessageRole
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§

McpAuthResponder
Host-supplied resolver for MCP auth challenges.
McpElicitationResponder
Pluggable handler invoked when an MCP server issues elicitation/create.
McpErrorResponder
Userland hook invoked when an MCP server returns a JSON-RPC error for an invoked method.
McpHttpClient
Pluggable HTTP transport for the MCP Streamable HTTP client.
McpRootsProvider
Pluggable handler invoked when an MCP server issues roots/list.
McpSamplingResponder
Pluggable handler invoked when an MCP server issues sampling/createMessage.

Type Aliases§

AudioContent
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.
ClientJsonRpcMessage
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.
EmbeddedResource
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.
ImageContent
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.
McpPromptDescriptor
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.
McpResourceDescriptor
Alias for McpResource.
McpSseStream
Type alias for the SSE stream returned by McpHttpClient::get_stream.
McpToolDescriptor
Alias for McpTool.
TextContent
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.