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
//! Transport-agnostic [MCP](https://modelcontextprotocol.io) (Model Context
//! Protocol) client for Everruns agents.
//!
//! `everruns-mcp` is part of the [Everruns](https://everruns.com) ecosystem. It
//! is the shared MCP client used across Everruns hosts (runtime, worker, and
//! server), so every host wires MCP the same way without duplicating protocol
//! logic.
//!
//! The crate owns the JSON-RPC client (HTTP, and optional stdio behind the
//! `stdio` feature), credential acquisition ([`McpAuthProvider`]), result
//! mapping, and tool execution ([`McpExecutor`], which implements
//! `everruns_core::McpToolInvoker` so MCP tools register as regular `Tool`s).
//! Wire types and tool-name helpers live in `everruns-core` and are reused
//! as-is.
//!
//! # Example
//!
//! ```
//! use everruns_mcp::{McpClient, McpConnection};
//!
//! # async fn run() -> anyhow::Result<()> {
//! let client = McpClient::direct();
//! let connection = McpConnection::http("docs", "https://example.com/mcp");
//! let tools = client.discover(&connection).await?;
//! let result = client
//! .call(&connection, &tools[0].name, serde_json::json!({}))
//! .await?;
//! # let _ = result;
//! # Ok(())
//! # }
//! ```
pub use ;
pub use McpClient;
pub use ;
pub use ;
pub use Negotiated;
pub use ;
pub use ;
pub use StdioTransport;