Skip to content

MCP 2026-07-28 wire: header-add (SDK pin + vendored shim + MIGRATION_NOTE) - #7

Open
CSOAI-ORG wants to merge 4 commits into
mainfrom
mcp-2026-wire-header-add
Open

CSOAI-ORG wants to merge 4 commits into
mainfrom
mcp-2026-wire-header-add

Conversation

@CSOAI-ORG

@CSOAI-ORG CSOAI-ORG commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

MCP 2026-07-28 wire - class header-add (header-add runbook)

Plan: MCP_2026_WIRE_MIGRATION_PLAN_2026-10-07.md (section 3 = header-add runbook, section 4 = the shim as bridge)
Deprecation deadline: the old wire dies 2027-07-28.
Branch: mcp-2026-wire-header-add -> base main (no push to the default branch).
Census row: era unknown / class header-add (census 2026-10-07); the local before-row below is the audit of the reconstructed default branch.

Runbook steps applied

  1. SDK pinned: "mcp>=1.0.0" -> "mcp>=2.0.0" in pyproject.toml (a real mcp dependency line existed - none invented), packaging include list extended with mcp2026_shim.py so the vendored shim ships in the wheel.
  2. mcp2026_shim.py vendored (stdlib, 665 lines) - the transport middleware that reads/validates Mcp-Method + Mcp-Name, injects params._meta.protocolVersion = \"2026-07-28\" and never emits Mcp-Session-Id.
  3. from mcp.server.fastmcp import FastMCP -> from mcp.server.mcpserver import MCPServer as FastMCP - required by mcp 2.x (FastMCP was renamed MCPServer; mcp.server.fastmcp raises ModuleNotFoundError by design), otherwise the pin would not import.
  4. stdio-only: headers N/A at runtime; server.py carries the migration note block plus an http_app() enable path (ShimASGI(mcp.streamable_http_app(json_response=True))) for when the server is exposed over HTTP.
  5. MIGRATION_NOTE.md: class, transport reality, steps, verify command, before/after/control rows, follow-ups.

Verify (run locally before merging this PR)

PYTHONPATH= /opt/homebrew/bin/python3.11 ~/clawd/mcp_wire_audit.py audit --local explainability-report-mcp
state era migration
before (default branch) 2026-07 header-add
after (this branch) 2026-07 handshake-removal
control (migration-note block removed) 2026-07 header-add

After-rows are note-text-driven until post-merge re-audit. The scanner excludes its own shim (SELF_FILES) and does not scan .md, so protocol-2026-07-28 / mcp-method-header / mcp-name-header / server-discover in the after record are read from the migration-note text, and session-id there is prose (the shim strips that header) - the control run, which removes only that note block, shows no session-id. Runtime evidence for the wire is the mcp>=2.0.0 SDK pin (2.3.0 speaks 2026-07-28) + the vendored shim at the ingress; mcp>=2.0.0 alone is not a wire signal for this scanner.

Files: MIGRATION_NOTE.md, mcp2026_shim.py, pyproject.toml, server.py

Measurement, not certification - re-audit after merge with the command above, and run the live
probe of plan section 6.5 before anyone quotes migration: none.


Note

Medium Risk
Protocol and dependency major-version changes affect all MCP clients; HTTP shim behavior is new and stdio path does not apply header rules until HTTP is used.

Overview
Migrates the explainability MCP server toward the 2026-07-28 wire (class header-add): bumps mcp to >=2.0.0, switches the server import to MCPServer (2.x rename from FastMCP), and vendors mcp2026_shim.py so the wheel can enforce Mcp-Method / Mcp-Name, inject params._meta.protocolVersion, strip session headers, and bridge legacy handshake traffic.

server.py keeps stdio via mcp.run() unchanged for headers; it adds http_app() wrapping streamable_http_app(json_response=True) in ShimASGI for HTTP deployments. MIGRATION_NOTE.md documents verify steps, audit caveats, and follow-ups (static manifests not updated in this PR).

Reviewed by Cursor Bugbot for commit 3f9673e. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor

cursor Bot commented Oct 8, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 07f5c0ce-9c14-46e1-8437-a30d09547993)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a non-blocking comment: Cursor Bugbot did not complete analysis (check skipped after a usage/spend limit), so this PR is not approved. Human review is needed, and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

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