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
//! Remote MCP connectors for the Common Agent Runtime.
//!
//! Lets CAR users add remote MCP servers as tool sources — the way
//! Claude and ChatGPT add connectors. This crate is the **client**
//! direction of MCP (the `car-mcp` crate is the server direction, which
//! exposes CAR's own tools to other MCP clients).
//!
//! ## What it provides
//!
//! - [`McpHttpSession`] — an HTTP-streamable MCP client transport that
//! implements [`car_engine::McpSession`], so a remote connector plugs
//! into the engine's existing [`car_engine::McpToolExecutor`] routing
//! and fallback machinery exactly like a stdio MCP server does.
//! - [`ConnectorManager`] — connector lifecycle: connect, discover,
//! enable, persist to `~/.car/connectors.json`, with secret auth
//! headers stored in the OS keychain (never in the JSON).
//!
//! ## Governance
//!
//! Because connector tools register as ordinary
//! [`car_engine::ToolEntry`]s and dispatch through the standard
//! executor, every call flows through CAR's validator, policy, and
//! eventlog — the differentiator over calling connector tools directly.
//!
//! ## Scope
//!
//! - **Phase 1:** unauthenticated and static-auth-header servers over
//! the HTTP-streamable transport.
//! - **Phase 2:** OAuth 2.1 ([`oauth`]) — Protected Resource + auth
//! server metadata discovery, dynamic client registration, PKCE, and
//! token refresh. See [`ConnectorManager::authenticate`] /
//! [`ConnectorManager::complete_authentication`].
//! - **Phase 3:** per-tool enable/disable
//! ([`ConnectorManager::enable_tools`] / [`ConnectorManager::disable_tools`])
//! and a daemon `deny_connector` policy rule.
//! - **Phase 4:** local stdio connectors
//! ([`ConnectorManager::add_stdio`], reusing `car_engine::McpServer`)
//! and team-shareable secret-free `.car/connectors.toml`.
//!
//! See `docs/proposals/remote-mcp-connectors.md` for deferred items.
pub use ConnectorError;
pub use ;
pub use ;
pub use ;