Skip to main content

Crate agent_client_protocol_rmcp

Crate agent_client_protocol_rmcp 

Source
Expand description

§agent-client-protocol-rmcp

This crate provides integration between rmcp MCP servers and the Agent Client Protocol MCP server framework.

Building or directly serving a standalone MCP server requires no unstable ACP feature. Enable unstable_mcp_over_acp when attaching the server to an ACP connection with with_mcp_server.

§Usage

Build an MCP server with tools using the extension trait:

use agent_client_protocol::{ConnectTo, mcp_server::McpServer, role::mcp};
use agent_client_protocol_rmcp::McpServerExt;

let server = McpServer::<mcp::Client>::builder("my-tools").build();
server.connect_to(client_transport).await

Or create an MCP server from an rmcp service:

use agent_client_protocol::mcp_server::McpServer;
use agent_client_protocol_rmcp::McpServerExt;

let server = McpServer::from_rmcp("my-server", MyRmcpService::new);

// With `unstable_mcp_over_acp`, attach it to a proxy and connect the proxy
// to its transport.
Proxy.builder()
    .with_mcp_server(server)
    .connect_to(transport)
    .await?;

Macros§

tool_fn
This is a hack that must be given as the final argument of the MCP server builder’s tool_fn method when defining stateless concurrent tools.
tool_fn_mut
This is a hack that must be given as the final argument of the MCP server builder’s tool_fn_mut method when defining tools.

Structs§

McpServerBuilder
Builder for creating MCP servers with tools.

Enums§

EnabledTools
Tracks which tools are enabled.

Traits§

McpServerExt
Extension constructors for MCP servers backed by rmcp.
McpTool
Trait for defining MCP tools.