pub struct McpService { /* private fields */ }Expand description
A hosted, in-process MCP service over named frontier checkouts. The hub
embeds this to serve hub.constellate.science/mcp without a sidecar:
the same dispatcher, profile gate, and tool registry as vela serve,
loaded from the git checkouts its ingest lane already maintains.
Implementations§
Source§impl McpService
impl McpService
Sourcepub fn from_named_paths(
entries: &[(String, PathBuf)],
profile_str: &str,
exclude: &[String],
) -> Result<(Self, Vec<String>), String>
pub fn from_named_paths( entries: &[(String, PathBuf)], profile_str: &str, exclude: &[String], ) -> Result<(Self, Vec<String>), String>
Load named frontier directories into one merged read-only service.
A broken entry is skipped and reported in the returned warnings,
never fatal: one frontier failing to replay must not take the
hosted endpoint down for the rest. Loading is the only filesystem
touch; the merge itself is from_projects.
Sourcepub fn from_projects(
entries: Vec<(String, Project)>,
profile_str: &str,
exclude: &[String],
) -> Result<(Self, Vec<String>), String>
pub fn from_projects( entries: Vec<(String, Project)>, profile_str: &str, exclude: &[String], ) -> Result<(Self, Vec<String>), String>
Build the merged read-only service from already-loaded projects —
the path the hub’s DB-hydrated refresher uses (no filesystem at
all). Each project is re-materialized here: promoted DB snapshots
were persisted WITHOUT materialize_project, so skipping it would
diverge from the checkout loader’s output.
Sourcepub fn hosted_exclusions() -> Vec<String>
pub fn hosted_exclusions() -> Vec<String>
The hosted exclusion set: every tool that operates on a
caller-supplied filesystem path. On a public endpoint those are
useless at best (the caller has no paths on the server) and a CPU
sink at worst (verify with mode=witness). The hosted endpoint runs
the read-only profile, so its tools/list is the read-only surface
minus these three: orient, finding, search, graph, external.
Sourcepub async fn handle_http(&self, body: &str) -> (u16, Option<Value>)
pub async fn handle_http(&self, body: &str) -> (u16, Option<Value>)
Handle one streamable-HTTP MCP exchange (single message or batch).
Returns (http_status, body); None body = empty 202.
Sourcepub fn frontier_labels(&self) -> Vec<String>
pub fn frontier_labels(&self) -> Vec<String>
The loaded frontier labels, for the hub’s status surfaces.