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).awaitOr 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_fnmethod 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_mutmethod when defining tools.
Structs§
- McpServer
Builder - Builder for creating MCP servers with tools.
Enums§
- Enabled
Tools - Tracks which tools are enabled.
Traits§
- McpServer
Ext - Extension constructors for MCP servers backed by
rmcp. - McpTool
- Trait for defining MCP tools.