Context
The MCP specification 2026-07-28 RC (published May 29) rewrites the protocol fundamentals. The TS SDK v2.0.0-alpha.3 and Python SDK v2.0.0a3 both implement the new spec. The final spec date is July 28 — one month away. yopedia has a custom HTTP MCP implementation (src/lib/mcp-http.ts, 33 tools) that needs to migrate independently of the SDK.
Good news: Our HTTP MCP is already stateless POST-only (no sessions, no SSE, no GET endpoint). The hardest v2 changes (session removal, transport rewrite) are already done by our design. The migration is mostly additive.
What Changed in the Spec
- Stateless protocol —
initialize/initialized removed; every request carries _meta with protocolVersion, clientInfo, clientCapabilities
server/discover RPC — mandatory endpoint replacing the old handshake for capability advertisement
resultType required — every response must include resultType: "complete" (or "input_required" for MRTR)
- HTTP headers required —
MCP-Protocol-Version, Mcp-Method, Mcp-Name on every Streamable HTTP POST
CacheableResult — tools/list must return ttlMs + cacheScope
ping removed — health checks are transport-level
- Error codes renumbered — new standard codes (-32020 through -32022)
Gap Analysis (src/lib/mcp-http.ts)
| Requirement |
Current State |
Work |
initialize handler |
Present (L779) |
Remove or keep for v1 compat |
server/discover |
Missing |
Add (~20 lines) |
resultType on responses |
Missing |
Add to ok() helper (~2 lines) |
_meta validation |
Missing |
Add middleware (~30 lines) |
MCP-Protocol-Version header |
Missing |
Add to route handler (~10 lines) |
Mcp-Method header |
Missing |
Add to route handler (~5 lines) |
CacheableResult on tools/list |
Missing |
Add ttlMs/cacheScope (~5 lines) |
ping handler |
Present (L796) |
Remove or ignore |
| Sessions / SSE |
Already absent ✅ |
None |
| GET endpoint |
Already absent ✅ |
None |
Recommended Approach
Dual-version support: accept both v1 (initialize-based) and v2 (_meta-based) clients during transition. Detect version from presence of _meta.io.modelcontextprotocol/protocolVersion:
- If present → v2 path (validate
_meta, require headers, include resultType)
- If absent → v1 path (existing behavior, deprecated)
This avoids breaking existing stdio MCP clients that connect via the v1 SDK while the alpha stabilizes.
Scope
- Files:
src/lib/mcp-http.ts, src/app/api/mcp/route.ts
- Tests:
src/app/api/__tests__/mcp-route.test.ts
- Estimate: Medium (~150-200 lines of additive code + tests)
Relationship to #580
Issue #580 (MCP Server Card metadata) is a subset of this work. server/discover IS the Server Card delivery mechanism. When this issue lands, #580 can be closed as superseded.
Acceptance Criteria
Blocked-By: none (custom implementation, not SDK-dependent)
Blocker-Type: none
Context
The MCP specification 2026-07-28 RC (published May 29) rewrites the protocol fundamentals. The TS SDK v2.0.0-alpha.3 and Python SDK v2.0.0a3 both implement the new spec. The final spec date is July 28 — one month away. yopedia has a custom HTTP MCP implementation (
src/lib/mcp-http.ts, 33 tools) that needs to migrate independently of the SDK.Good news: Our HTTP MCP is already stateless POST-only (no sessions, no SSE, no GET endpoint). The hardest v2 changes (session removal, transport rewrite) are already done by our design. The migration is mostly additive.
What Changed in the Spec
initialize/initializedremoved; every request carries_metawithprotocolVersion,clientInfo,clientCapabilitiesserver/discoverRPC — mandatory endpoint replacing the old handshake for capability advertisementresultTyperequired — every response must includeresultType: "complete"(or"input_required"for MRTR)MCP-Protocol-Version,Mcp-Method,Mcp-Nameon every Streamable HTTP POSTCacheableResult—tools/listmust returnttlMs+cacheScopepingremoved — health checks are transport-levelGap Analysis (src/lib/mcp-http.ts)
initializehandlerserver/discoverresultTypeon responsesok()helper (~2 lines)_metavalidationMCP-Protocol-VersionheaderMcp-MethodheaderCacheableResultontools/listpinghandlerRecommended Approach
Dual-version support: accept both v1 (
initialize-based) and v2 (_meta-based) clients during transition. Detect version from presence of_meta.io.modelcontextprotocol/protocolVersion:_meta, require headers, includeresultType)This avoids breaking existing stdio MCP clients that connect via the v1 SDK while the alpha stabilizes.
Scope
src/lib/mcp-http.ts,src/app/api/mcp/route.tssrc/app/api/__tests__/mcp-route.test.tsRelationship to #580
Issue #580 (MCP Server Card metadata) is a subset of this work.
server/discoverIS the Server Card delivery mechanism. When this issue lands, #580 can be closed as superseded.Acceptance Criteria
server/discoverreturns supported versions, capabilities, server info, instructionsresultType: "complete"_metavalidation middleware rejects v2 requests missing required fieldsMCP-Protocol-Versionheader validated against_metavalueMcp-Methodheader parsed and validatedtools/listreturnsCacheableResultwithttlMsandcacheScopeinitializeflow) still work during transitionpnpm build && pnpm testpassesBlocked-By: none (custom implementation, not SDK-dependent)
Blocker-Type: none