branben/OmniRoute · Pull Request #15983

PRD — Upgrade OmniRoute MCP surface to 2026-07-28 spec

feat/mcp-v2-sidecar → release/v3.8.53 +2761 / −14 21 files

The one-line ask

Bring OmniRoute's MCP server from its legacy v1 surface to the 2026-07-28 specification by adding an opt-in native sidecar that speaks the new wire format (MCP-Protocol-Version: 2026-07-28, server/discover, resultType, cacheable lists, _meta extraction, header-based routing, outputSchema, MRTR contract) while keeping the existing v1 server, sessions, CLI entry, and full tool catalog untouched for legacy clients.

Why this is brownfield, not greenfield

The v1 MCP server is live and production-used. open-sse/mcp-server/ already exposes 37 tools over stdio, HTTP (SSE), and streamable HTTP. The v1 implementation rejects the 2026-07-28 header with HTTP 400 and does not expose modern discovery. This is not a greenfield MCP server — it is a parallel, opt-in surface that runs alongside v1, exactly as the spec's compatibility clause intends.

The gap, measured

Capability v1 today 2026-07-28 required Gap
Protocol version headerRejects 2026-07-28 → 400Accept + routeHard block
server/discoverAbsentRequired for v2Hard block
resultType fieldAbsentRequired on responsesHard block
Cacheable list results (ttlMs, cacheScope)AbsentRequiredHard block
_meta extraction + passthroughAbsentRequiredHard block
Mcp-* request headersAbsentRequiredHard block
outputSchema on tool definitionsAbsentRequiredHard block
MRTR (model-request-tool-result) contractAbsentRequiredHard block
Stateless initialize (no handshake)v1 requires handshakev2 drops itHard block
Scope enforcementv1 has itMust not be looser in v2Verification
Client metadata → permission grantv1 had a pathBlocked in v2Verification

Source: PR #15983 body + diff (open-sse/mcp-server/v2/server.ts 979 lines, src/app/api/mcp/v2/route.ts, tests/unit/mcp/v2-* 11 test files).

Scope

In scope Out of scope (now) Explicitly refused
v2 sidecar under open-sse/mcp-server/v2/Full catalog migrationReplacing v1
8 tools calling omniRouteFetch() against real endpointsVersion routing on main /api/mcpRemoving v1
Opt-in gated by OMNIROUTE_MCP_V2 feature flagCancellation propagationChanging v1 behavior
server/discover, resultType, _meta, cacheable listsProduction acceptance testingMerging without Diego review
src/app/api/mcp/v2/route.ts (stateless HTTP)
Scope enforcement ≥ v1 (resolved via v1's DB-aware switch)
Sanitized transport/tool errors + stdio cleanup handle
11 test files (unit + integration) under tests/unit/mcp/v2/
vitest.mcp.config.ts for isolated MCP test runner

GF / BF alternatives

What the user sees

A client that sends MCP-Protocol-Version: 2026-07-28 gets:

A legacy client (no version header or 2024-10-07) sees v1 unchanged.

Outcomes we are buying

Out of scope