turbomcp_client/integration.rs
1//! Integration prelude for LLM framework integrations (Rig, Langchain, etc.)
2//!
3//! This module provides a comprehensive re-export of types commonly needed when
4//! integrating MCP clients with LLM frameworks. It includes everything from the
5//! standard prelude plus additional abstractions that are particularly useful for
6//! building agent integrations.
7//!
8//! # Usage
9//!
10//! For LLM framework integrations, use this instead of the standard prelude:
11//!
12//! ```rust,no_run
13//! use turbomcp_client::integration::*;
14//!
15//! // Now available:
16//! // - Client<T> and ClientBuilder for MCP connections
17//! // - Transport trait for generic bounds in agent definitions
18//! // - Tool, Resource, Prompt for protocol types
19//! // - All handler types for server-initiated requests
20//! // - Plugin system for middleware and metrics
21//!
22//! pub fn register_mcp_tool<T: Transport + 'static>(
23//! agent_builder: AgentBuilder,
24//! tool: Tool,
25//! client: Client<T>,
26//! ) -> AgentBuilder {
27//! // Integration code here
28//! agent_builder
29//! }
30//! ```
31
32// Re-export the complete standard prelude
33pub use crate::prelude::*;
34
35// Additional re-exports specifically useful for integrations
36// (most are already in prelude, but we keep this explicit for documentation)
37
38// Core client types
39pub use crate::ClientBuilder;
40
41// Transport trait - essential for generic bounds
42pub use turbomcp_transport::Transport;
43
44// Re-export commonly needed protocol types (already in prelude but documented here)
45pub use turbomcp_protocol::types::{
46 Content, CreateMessageRequest, CreateMessageResult, Prompt, Resource, Tool,
47};