Repository navigation
feat(mcp)!: bridge clients and servers with Interchange - #28
TheGreatAxios merged 28 commits into
Conversation
|
Triage: Fail @TheGreatAxios, please address the following:
Notes:
Waiting on a maintainer to approve: request changes. |
TheGreatAxios
left a comment
There was a problem hiding this comment.
Review: PR #28 — feat(client): speak MCP 2026-07-28
Verdict: Request changes.
Verified clean
The MCP 2026-07-28 client work itself is in good shape. Five independent review lanes plus two verification/convergence lanes cross-checked the PR against the branch code and temporary repro tests:
- Stateless
server/discoverprobe + per-call_meta/MCP-Protocol-Version/Mcp-Method/Mcp-Nameheaders, no session on that path — verified. - Legacy fallback ladder (
-32020/-32021no-fallback,-32022fallback-only-when-legacy-listed) — verified. input_required→mcpContinue, progress, cancel, tasks/skill gating, hub discovery dual-mode — verified.- First-wave claims that the
-32022fallback branch was dead code and that the fallback could re-enter the ladder were disproved — no fixes needed there.
Findings (deduplicated, conflict-resolved)
-
Blocking — public API return-type drift (VERIFIED).
mcpCallToolmoved from returningPromise<McpToolResult>toPromise<McpToolCallResult>(McpToolResult | McpInputRequired | McpTaskHandle), andMcpToolResultwas repurposed to requireresultType: "complete". Downstream consumers typing results asMcpToolResultor readingresult.isError/result.contentno longer compile. Fix landed:resultTypemade optional on resolved results + regression test. -
Should-fix HIGH — VERIFIED. Legacy
initializehandshake advertised stale client identity (0.2.0) vs. modern path (0.3.1). Fix landed. -
Should-fix HIGH — VERIFIED. Session-less core calls bypassed the modern stateless path and sent no protocol metadata. Fix landed.
4-7. Should-fix HIGH — docs (confirmed). README client-options sentence, README reference table, AGENTS.md method list, Mcp-Name scope, Upgrading framing. Fix landed.
- Should-fix HIGH — coverage (confirmed). Agent-tool result shaping,
mcpContinuebeyondtools/call, task-state validation, no-version error path,-32021on connect, listen/extensions gating. Regression tests landed for the blocking and stateless paths; remainder recommended.
Verification
bun run check→ exit 0 (typecheck / lint / format + unit tests) on the fixed branch.
Ask
Fixes for the converged findings landed as individual commits on cl-11364-speak-mcp-2026-07-28-from-the-corbits-mcp-client (fix(client): … ×3, docs: …).
There was a problem hiding this comment.
Summary
Adds a bidirectional MCP ↔ Interchange bridge with four role entries:
@corbits/mcp/client@corbits/mcp/server@corbits/mcp/interchange/client@corbits/mcp/interchange/server
Historical root/hub/sidecar facades remain. The standalone client and server have dependency-isolated runtime graphs; OAuth-core is now an optional peer, explicitly installed when using root/login APIs. This is a breaking installation/API change.
Delivered
- Shared wire, method/result, header, content and JSON Schema validation; modern stateless MCP 2026-07-28 client/server behavior.
- Explicitly selected Interchange tool, operation, agent and workflow exports; reverse MCP consumption with mediated credentials, approval floors and rich-result/lifecycle handling.
- MRTR continuations, elicitation host contracts, progress/cancellation, subscriptions and task runtime/storage primitives.
- Verified static Skills publication and consumption, identity/content-bound approvals, streaming resource limits and inclusive 16 MiB support.
- Explicit Apps host capability gating; metadata-only consumers do not advertise rendering support.
- Guarded authorization discovery, registration, issuer/state/resource binding, token-only grants and resource-server verification hooks.
- Opt-in legacy server compatibility for 2025-11-25, 2025-06-18 and 2025-03-26. Modern behavior stays stateless. Legacy sessions are bounded, in-memory and instance-affine; March batching is isolated from later revisions.
- Version/maturity metadata follows upstream specifications; standard wire identifiers are not renamed with experimental prefixes.
Verification
At dacf1b15f3ad7e3643dd10ccc9f7b4eb47c7b150:
bun run check: exit 0, 423 tests / 2,116 assertions; typecheck, lint and formatting pass.bun run build: exit 0.- Node 24.22.1
bun run test:e2e: exit 0, 22 tests. - Node 24.22.1
bun run test:package: exit 0, 13 tests, including real build/pack/ordinary npm installs and Bun/Node factory behavior. - Independent scoped reviews approved core, auth, extensions, Interchange adapters, modern/legacy server and bounded large-resource fixes after reproducing and repairing findings.
- Independent QA exercised both directions using installed Interchange tool runners/credential capabilities and runnable standalone examples.
Eight new commits separate shared/client, extensions, auth, server, adapters, packaging, artifact tests/examples and documentation. Earlier pushed history was retained.
Explicit limits
This delivers the repository's bridge scope, not exhaustive MCP certification or proof of a deployed host. Applications supply trusted identity/grants, cryptographic verification, persistence/recovery, consent/context/execution gates and browser rendering/sandbox enforcement.
The verified Skills consumer declines dynamic manifests and requires a complete resource read with one matching text/blob item; it does not orchestrate resource MRTR. Modern server default and optional legacy behavior are documented separately.
External companions remain open:
- CL-11479: stock OAuth-core token-only/storage and transport/parameter protections; guarded MCP paths do not repair stock helpers.
- CL-11480: credential-http RequestInit/scheme handling and published harness/types peer incompatibility with the 0.5 baseline. Neutral installs pass; full pinned hub installation remains blocked by that dependency.
See docs/conformance.md, docs/migration.md, docs/public-api.md, docs/legacy-server.md and src/auth/INTEGRATION.md for evidence and responsibilities.
Closes CL-11364
Closes CL-11472
Implementation buckets: CL-11473, CL-11474, CL-11475, CL-11476, CL-11477, CL-11478.
Centralize wire schemas, headers, result applicability and resource bounds. Harden stateless transport and legacy negotiation with regression coverage. Expose repeated continuation and polymorphic resource results explicitly.
Add opt-in task persistence and recovery, bounded skill publication and verification, and explicit Apps host capability gates with lifecycle tests.
Bind OAuth discovery and callbacks to issuer and resource policy, isolate neutral authorization contracts, and enforce mediated credential boundaries with security regressions.
Add fetch-compatible providers, authorization and extension dispatch. Bound identity-scoped legacy sessions across three 2025 revisions, including cancellation, shutdown and initialization regression coverage.
Share live and stored-catalog result projection, preserve mediated tools and ask floors, and connect explicit host continuation, task, skill and Apps services. Expose only selected authorized operations with adapter tests.
Publish standalone client/server and Interchange entries plus the explicit file task store. Declare AJV and YAML runtimes and make host peers optional for neutral consumers. Root and guarded login consumers must now install OAuth-core explicitly; no version bump is included.
Test packed neutral, host, auth and legacy entry points through ordinary npm installs and add runnable standalone examples. Cover public declarations, runtime isolation and bidirectional integration.
Retain the architecture scope and document migration, role APIs, legacy deployment and final serial verification. Preserve companion dependency defects and host obligations without claiming exhaustive certification.
Review · CommentAPI architecture lens. PR #28 at Findings
What holds
|
Review · Request changesPR #28 at Findings
VerificationTemporary probes under Commit subjects
|
Review · CommentSecurity lens. PR #28 at Findings
CheckedResource-server authentication rejects query tokens, requires exact issuer and audience, and fails closed on verifier or scope errors. OAuth metadata and token fetches use Stock |
submitInput no longer CAS-writes a task that is not input_required or not waiting for the submitted keys, including after a concurrent transition.
Consume the authorization session only after the grant is stored, and skip persistence when cancel lands during the token request.
Refuse to send the code and verifier when an authorization or token endpoint origin differs from the issuer unless iss matches, and do not add offline_access from that cross-origin metadata.
Denied principals no longer receive server/discover. Tool catalog and invocation use the exposure resource and action, not mcp:tools.
Review · Request changesThe six local review-fix commits on PR #28 hold, and Findings
Verified
The temporary probe was removed. The working tree was clean. |
A missing tools/call name skipped the gate, so it did not match a denied binding. Private modern and legacy calls now share that denial, while tools/list stays a filtered catalog.
A rejected tools/call validated the catalog schema before the gate, so a missing required field differed from an unknown name. Denial now precedes schema and header checks.
Review-fix follow-upPushed
Independent recheck at |
Drop the one-use origin helper and method gate, the dead dynamic-skill check, the repeated exchange expiry check, and a restated scope comment. Authorization and protocol behavior is unchanged.
SimplificationPushed |
A bare install cannot load the root entry because agent and oauth-core are optional peers. Check the standalone client without them, and the historical root exports with those peers installed.
Summary
Adds a bidirectional MCP ↔ Interchange bridge with four role entries:
@corbits/mcp/client@corbits/mcp/server@corbits/mcp/interchange/client@corbits/mcp/interchange/serverHistorical root/hub/sidecar facades remain. The standalone client and server have dependency-isolated runtime graphs; OAuth-core is now an optional peer, explicitly installed when using root/login APIs. This is a breaking installation/API change.
Delivered
Verification
At
dacf1b15f3ad7e3643dd10ccc9f7b4eb47c7b150:bun run check: exit 0, 423 tests / 2,116 assertions; typecheck, lint and formatting pass.bun run build: exit 0.bun run test:e2e: exit 0, 22 tests.bun run test:package: exit 0, 13 tests, including real build/pack/ordinary npm installs and Bun/Node factory behavior.Eight new commits separate shared/client, extensions, auth, server, adapters, packaging, artifact tests/examples and documentation. Earlier pushed history was retained.
Explicit limits
This delivers the repository's bridge scope, not exhaustive MCP certification or proof of a deployed host. Applications supply trusted identity/grants, cryptographic verification, persistence/recovery, consent/context/execution gates and browser rendering/sandbox enforcement.
The verified Skills consumer declines dynamic manifests and requires a complete resource read with one matching text/blob item; it does not orchestrate resource MRTR. Modern server default and optional legacy behavior are documented separately.
External companions remain open:
See
docs/conformance.md,docs/migration.md,docs/public-api.md,docs/legacy-server.mdandsrc/auth/INTEGRATION.mdfor evidence and responsibilities.Closes CL-11364
Closes CL-11472
Implementation buckets: CL-11473, CL-11474, CL-11475, CL-11476, CL-11477, CL-11478.