Skip to main content

crabtalk_mcp/
lib.rs

1//! MCP (Model Context Protocol) client, bridge, and dispatcher.
2//!
3//! Three layers:
4//! - [`client`] — minimal JSON-RPC 2.0 client over stdio or HTTP
5//! - [`bridge`] — fleet of connected peers, tool cache, call routing
6//! - [`handler`] / [`dispatch`] — config-driven load, port-file discovery,
7//!   meta-tool dispatch
8//!
9//! # Features
10//!
11//! Pick exactly one HTTP backend and one TLS backend:
12//! - `hyper` (default) / `reqwest`
13//! - `native-tls` (default) / `rustls`
14//!
15//! The `hyper` backend is more compact — it skips reqwest's cookie store,
16//! redirect logic, and decoders that MCP never uses.
17
18#[cfg(all(feature = "reqwest", feature = "hyper"))]
19compile_error!("features `reqwest` and `hyper` are mutually exclusive");
20#[cfg(not(any(feature = "reqwest", feature = "hyper")))]
21compile_error!("one of `reqwest` or `hyper` must be enabled");
22#[cfg(all(feature = "native-tls", feature = "rustls"))]
23compile_error!("features `native-tls` and `rustls` are mutually exclusive");
24#[cfg(not(any(feature = "native-tls", feature = "rustls")))]
25compile_error!("one of `native-tls` or `rustls` must be enabled");
26
27pub use {
28    bridge::McpBridge,
29    handler::{Fingerprint, McpEvent, McpHandler, McpServerState, ServerStatus, fingerprint},
30};
31
32pub mod bridge;
33pub mod client;
34pub mod dispatch;
35pub mod handler;