1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! MCP server support for providing MCP tools over ACP.
//!
//! This module provides the infrastructure for building MCP servers that
//! integrate with ACP connections.
//!
//! ## Quick Start
//!
//! ```rust,ignore
//! use agent_client_protocol::mcp_server::{McpServer, McpTool};
//!
//! // Create an MCP server with tools
//! let server = McpServer::builder("my-server".to_string())
//! .instructions("A helpful assistant")
//! .tool(MyTool)
//! .build();
//!
//! // Use the server as a handler on your connection
//! Proxy.builder()
//! .with_handler(server)
//! .serve(client)
//! .await?;
//! ```
//!
//! ## Custom MCP Server Implementations
//!
//! You can implement [`McpServerConnect`](`crate::mcp_server::McpServerConnect`) to create custom MCP servers:
//!
//! ```rust,ignore
//! use agent_client_protocol::mcp_server::{McpServer, McpServerConnect, McpContext};
//! use agent_client_protocol::{DynComponent, JrLink};
//!
//! struct MyCustomServer;
//!
//! impl<R: Role> McpServerConnect<Link> for MyCustomServer {
//! fn name(&self) -> String {
//! "my-custom-server".to_string()
//! }
//!
//! fn connect(&self, cx: McpContext<Link>) -> DynComponent {
//! // Return a component that serves MCP requests
//! DynComponent::new(my_mcp_component)
//! }
//! }
//!
//! let server = McpServer::new(MyCustomServer);
//! ```
pub use ;
pub use McpServerConnect;
pub use McpConnectionTo;
pub use McpServer;
pub use McpTool;