Repository navigation
refactor(mcp): extract protocol implementation into a separate crate - #1106
Conversation
SummaryThis pull request moves the MCP protocol out of That split matches the base The branch does not merge with current main. GitHub reports Recommendation: request changes. Do not merge until the protocol crate renders the current error body and the server adapter compiles against the current handlers. BlockingThe new crate freezes the error body that main already replaced#1076, recorded in
A write that may have happened uses On this head a cancelled write is The protocol crate is the right owner of the envelope. It is the wrong owner of a second code table. On current main, The server wrapper around The handlers on main take
The branch copy of Update OptionalPublish an explicit list, not
|
|
Heads-up on an overlap with #1122 (server-wide
|
What & why
Extract MCP protocol handling from the server's large MCP module into
omnigraph-mcp. The new crate owns the SDK, settings, tool/resource catalog, typed arguments, bounded envelopes and response deadlines. The server mounts it at the existing/mcpendpoint and retains authentication, admission, handler dispatch and execution ownership.Preserve the current unified error contract through the extraction: the host projects both protocol refusals and handler failures through
ApiError. Write cancellation, timeout and undeliverable results retain their reconciliation disposition; resources retain structured error data. The protocol crate has no second error-code registry, engine dependency, graph opener or listener.Backing issue / RFC
Maintainer-requested internal refactor. Related to #991 and RFC 0003; this preserves the shipped MCP surface and does not close the broader issue.
Checklist
Local verification
cargo test --offline --locked -p omnigraph-mcp -p omnigraph-server --lib— 6 MCP and 213 server tests passed; two standalone subprocess helpers are ignored and exercised by their parent tests.RUST_MIN_STACK=16777216 cargo test --offline --locked -p omnigraph-server --test integration -- mcp:: openapi::— 106 passed; OpenAPI unchanged relative to current main.RUST_MIN_STACK=16777216 cargo test --offline --locked -p omnigraph-server --test boot_settings owned_shutdown::disconnected_write_and_shutdown_share_ownership_v2_finish -- --exact— passed.cargo clippy --offline --locked -p omnigraph-mcp -p omnigraph-server --all-targets --features omnigraph-server/aws -- -D warnings -W clippy::dbg_macro— passed.The HTTP fixture initially overflowed the default debug-test stack; it passes with the same 16 MiB setting used by repository CI. Full workspace and GQT suites were not run locally; fresh CI owns those broader checks.
Notes for reviewers
Host::start_toolandHost::start_resourceregister server-owned execution synchronously before returning an observation future. Cancellation, timeout or a dropped observation cannot release the MCP slot, ingress lease or deferred graph capture while execution continues. Write ingress reservation still precedes argument decoding.The old cancellation test failed when checked against the current canonical error shape before the fix. Server tests now pin the real error registry and write dispositions; protocol tests verify opaque error forwarding, resource data parity and both result-size limits without duplicating the registry. Existing HTTP tests retain stale-write and partial-load assertions.
This is an internal extraction with no intended public behavior change, so no release-note fragment is needed.