pub async fn run_server_with_extensions(
config: &Config,
extra_tools: Arc<ToolRegistry>,
extra_agents: Arc<AgentRegistry>,
) -> Result<()>Expand description
Starts the MCP server with custom Rust tool and agent extensions.
Like run_server, but accepts a ToolRegistry and AgentRegistry
containing custom extensions that will be served alongside built-in,
TOML-defined, and Lua-scripted entries.
Custom tools appear in GET /tools/list and can be called via
POST /tools/{name}. Custom agents appear in GET /agents/list and
can be resolved via POST /agents/{name}/prompt.
ยงExample
use context_harness::server::run_server_with_extensions;
use context_harness::traits::ToolRegistry;
use context_harness::agents::AgentRegistry;
use std::sync::Arc;
let tools = ToolRegistry::new();
let agents = AgentRegistry::new();
run_server_with_extensions(config, Arc::new(tools), Arc::new(agents)).await?;