Skip to content

refactor(oab-mcp): split handler into a lib with transport-agnostic dispatch (Part B slice 2) - #38

Merged
brettchien merged 1 commit into
mainfrom
feat/oab-mcp-inprocess-handler
Aug 14, 2026
Merged

brettchien merged 1 commit into
mainfrom
feat/oab-mcp-inprocess-handler

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

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-mcp was 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 — the OabMcp handler, now exposing a transport-agnostic public API:
    • from_env() — build from env (AWS default chain + $OAB_CLUSTER + opt-in fleet bindings)
    • info() — the initialize result
    • tools() — the tool catalog
    • dispatch(name, args) -> Result<Value> — execute one tool
    • ServerHandler now delegates to info() / 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 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 10 tools over stdio) and cargo test --workspace run in CI (build-test) — local test-profile link OOMs on aws-sdk-ec2, the constraint ci.yml documents.

Next: slice 3 (ACP-WS client + session lifecycle), which uses this lib.

🤖 Generated with Claude Code

… 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)
@brettchien
brettchien merged commit ae934ea into main Aug 14, 2026
2 checks passed
@brettchien
brettchien deleted the feat/oab-mcp-inprocess-handler branch August 14, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant