pub struct McpProxyPlane { /* private fields */ }Expand description
ExecutionPlane that proxies tool calls to MCP servers over JSON-RPC 2.0 (stdio).
Credentials live in a CredentialVault and are injected into each server’s subprocess
environment — the model never sees the credential values.
Usage:
ⓘ
let mut plane = McpProxyPlane::new(Arc::new(EnvCredentialVault));
plane.add_server("brave", McpServerConfig {
command: "npx".into(),
args: vec!["-y".into(), "@modelcontextprotocol/server-brave-search".into()],
credential_keys: vec!["BRAVE_API_KEY".into()],
env: Default::default(),
});
plane.connect().await?;
// ... use with RuntimeRunner ...
plane.disconnect().await;Implementations§
Source§impl McpProxyPlane
impl McpProxyPlane
pub fn new(vault: Arc<dyn CredentialVault>) -> Self
pub fn add_server( &mut self, name: impl Into<String>, config: McpServerConfig, ) -> &mut Self
Sourcepub async fn connect(&mut self) -> Result<()>
pub async fn connect(&mut self) -> Result<()>
Start all configured MCP server processes and discover their tool schemas.
Sourcepub async fn disconnect(&mut self)
pub async fn disconnect(&mut self)
Gracefully stop all MCP server processes.
Sourcepub fn register(&mut self, tool: RegisteredTool) -> &mut Self
pub fn register(&mut self, tool: RegisteredTool) -> &mut Self
Register an in-process tool. Local tools take priority over MCP tools of the same name.
pub fn unregister(&mut self, name: &str) -> &mut Self
Trait Implementations§
Source§impl ExecutionPlane for McpProxyPlane
impl ExecutionPlane for McpProxyPlane
Auto Trait Implementations§
impl !RefUnwindSafe for McpProxyPlane
impl !UnwindSafe for McpProxyPlane
impl Freeze for McpProxyPlane
impl Send for McpProxyPlane
impl Sync for McpProxyPlane
impl Unpin for McpProxyPlane
impl UnsafeUnpin for McpProxyPlane
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more