pub struct PlanServer { /* private fields */ }Expand description
MCP server façade exposing a BasicCpmPlanner over six tools.
Implementations§
Source§impl PlanServer
impl PlanServer
Sourcepub fn new(planner: Arc<BasicCpmPlanner>) -> Self
pub fn new(planner: Arc<BasicCpmPlanner>) -> Self
Build a server backed by the supplied planner.
Sourcepub fn with_identity(
self,
name: impl Into<String>,
version: impl Into<String>,
) -> Self
pub fn with_identity( self, name: impl Into<String>, version: impl Into<String>, ) -> Self
Override the advertised server identity. Defaults to
("mcp-flowgate-plan", CARGO_PKG_VERSION).
Sourcepub fn planner(&self) -> &Arc<BasicCpmPlanner> ⓘ
pub fn planner(&self) -> &Arc<BasicCpmPlanner> ⓘ
Borrow the inner planner. Tests use this to set up state directly
(e.g. submit a plan, then drive acquire_cohort via MCP).
Sourcepub async fn serve_stdio(self) -> Result<()>
pub async fn serve_stdio(self) -> Result<()>
Serve the MCP surface over stdio. Blocks until the peer disconnects.
No SIGINT/drain handling is wired here yet; a future revision can
adopt the cancellation-token pattern from
crates/mcp-flowgate/src/main.rs::serve if graceful shutdown becomes
necessary for operators spawning this binary as a long-running child.
Sourcepub async fn dispatch_call(
&self,
request: CallToolRequestParams,
) -> Result<Value, McpError>
pub async fn dispatch_call( &self, request: CallToolRequestParams, ) -> Result<Value, McpError>
Transport-free dispatch entry point. Tests call this directly to exercise each tool without spinning up a stdio transport.
Behaviour matches what ServerHandler::call_tool does, minus the
CallToolResult wrapping.
Trait Implementations§
Source§impl Clone for PlanServer
impl Clone for PlanServer
Source§fn clone(&self) -> PlanServer
fn clone(&self) -> PlanServer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more