Repository navigation
refactor(oab-mcp): split handler into a lib with transport-agnostic dispatch (Part B slice 2) - #38
Merged
Merged
Conversation
… dispatch (Part B slice 2) The tool logic was reachable only over stdio (a bin-only crate). Split it so the same handler serves two front doors — the stdio binary (headless path (ii)) and, next, the reverse-MCP-over-ACP tunnel driving it in-process (path (i)) — with no second implementation. - `lib.rs`: the `OabMcp` handler, now with a public transport-agnostic API — `from_env()` (build from env: AWS chain + $OAB_CLUSTER + opt-in bindings), `info()` (the initialize result), `tools()` (the catalog), and `dispatch(name, args) -> Result<Value>` (execute one tool). `ServerHandler` delegates to `info()` / `tools()` / `dispatch()`. - `main.rs`: a thin stdio wrapper — `OabMcp::from_env()` then `serve(stdio())`. Binary name and behaviour unchanged (the CI smoke still runs ./oab-mcp). Behaviour-preserving except one deliberate change: an unknown tool now returns an `isError` CallToolResult instead of an `invalid_params` JSON-RPC error — more typical for MCP tools/call, and no caller/test depends on the old shape. Verification: `cargo check -p oab-mcp --all-targets` clean (lib + bin + tests). Runtime smoke (server starts, advertises all tools over stdio) + workspace tests run in CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drafted by Orca (
ecs-claude) — flagging authorship (shared GitHub identity).Slice 2 of the reverse-MCP client ADR (#36). The tool logic was reachable only over stdio (
oab-mcpwas a bin-only crate). This splits it so one handler serves two front doors — the stdio binary (headless path (ii)) and, next, the reverse-MCP-over-ACP tunnel driving it in-process (path (i)) — with no second implementation.What
lib.rs— theOabMcphandler, now exposing a transport-agnostic public API:from_env()— build from env (AWS default chain +$OAB_CLUSTER+ opt-in fleet bindings)info()— theinitializeresulttools()— the tool catalogdispatch(name, args) -> Result<Value>— execute one toolServerHandlernow delegates toinfo()/tools()/dispatch().main.rs— a thin stdio wrapper:OabMcp::from_env()→serve(stdio()). Binary name and behaviour unchanged (CI smoke still runs./target/debug/oab-mcp).Behaviour note
Behaviour-preserving except one deliberate change: an unknown tool now returns an
isErrorCallToolResultinstead of aninvalid_paramsJSON-RPC error — more typical for MCPtools/call, and no caller/test depends on the old shape.Verification
cargo check -p oab-mcp --all-targetsclean (lib + bin + tests).cargo test --workspacerun in CI (build-test) — local test-profile link OOMs onaws-sdk-ec2, the constraintci.ymldocuments.Next: slice 3 (ACP-WS client + session lifecycle), which
uses this lib.🤖 Generated with Claude Code