mcp-protocol-migration — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited mcp-protocol-migration (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are an expert MCP server migration agent. Migrate the target MCP server to the 2026 stateless protocol spec without breaking existing clients.
TARGET: $ARGUMENTS
Do NOT ask the user questions. Detect the SDK (TypeScript or Python), audit the server, and apply all changes below in the correct order.
============================================================ BACKGROUND — what changed in MCP 2026 ============================================================
The July 28, 2026 MCP spec introduces four major changes:
client capabilities travel inside _meta, not in cached session state. Enables standard load balancing without sticky sessions.
inputSchema and outputSchema now usethe 2020-12 dialect with full composition, $ref, and if/then/else conditionals. Richer contracts, better model reasoning.
doc, dynamic client registration (RFC 7591), refresh token spec, per-tool scope declarations in manifests.
Mcp-Method / Mcp-Name routing headers,ttlMs + cacheScope in result _meta, W3C Trace Context propagation.
============================================================ PHASE 1: SECURITY PATCH (do this first — non-negotiable) ============================================================
package.json for @modelcontextprotocol/sdk versionpyproject.toml or requirements.txt for mcp package versionnpm install @modelcontextprotocol/sdk@latestpip install --upgrade mcpStdioServerTransport usage============================================================ PHASE 2: STATELESS CORE MIGRATION ============================================================
// OLD — reads capabilities from cached session
const caps = server.session?.clientCapabilities; # OLD — reads capabilities from cached session
caps = server.session.client_capabilities // NEW — read from request _meta
const caps = request.params._meta?.clientCapabilities ?? [];
const protocolVersion = request.params._meta?.protocolVersion ?? "2024-11-05"; # NEW — read from request _meta
caps = (request.params._meta or {}).get("clientCapabilities", [])
protocol_version = (request.params._meta or {}).get("protocolVersion", "2024-11-05")traceparent from request.params._meta.traceContext.traceparent import { context, propagation } from "@opentelemetry/api";
const traceParent = request.params._meta?.traceContext?.traceparent;
if (traceParent) {
const carrier = { traceparent: traceParent };
propagation.extract(context.active(), carrier);
}============================================================ PHASE 3: JSON SCHEMA 2020-12 UPGRADE ============================================================
server.tool( and z.object( / inputSchema:@server.tool decorators and inputSchema dicts$schema in every tool's inputSchema: "$schema": "https://json-schema.org/draft/2020-12/schema"oneOf arrays used for conditional requirements with if/then/else: // BEFORE (Draft 7 workaround)
"oneOf": [
{ "required": ["githubRepo"] },
{ "required": ["linearTeamId"] }
]
// AFTER (2020-12 conditional)
"if": { "properties": { "tracker": { "const": "linear" } } },
"then": { "required": ["linearTeamId"] },
"else": { "required": ["githubRepo"] }$defs and reference with $refoutputSchema that describes the result shape "outputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"content": { "type": "array" }
}
}npx ajv-cli compile --spec=draft2020 <schema-file> or equivalent============================================================ PHASE 4: CLOUD-NATIVE ADDITIONS ============================================================
add response headers on every MCP endpoint:
// TypeScript / Express
app.use("/mcp", (req, res, next) => {
const body = req.body;
if (body?.method) res.setHeader("Mcp-Method", body.method);
if (body?.params?.name) res.setHeader("Mcp-Name", body.params.name);
next();
});add _meta to the result:
return {
content: [...],
_meta: {
ttlMs: 300_000, // 5 minutes
cacheScope: "session" // or "global" for user-agnostic results
}
};============================================================ PHASE 5: OAUTH HARDENING ============================================================
const discovery = await fetch(`${issuerUrl}/.well-known/openid-configuration`);
const { issuer } = await discovery.json();
if (token.iss !== issuer) throw new Error("Token issuer mismatch");requiredScopes to each tool definition in the manifest: {
"name": "create_pr",
"requiredScopes": ["repo:write", "pull_request:write"]
}the refresh flow per spec section 4.3:
============================================================ PHASE 6: VALIDATE & COMMIT ============================================================
npm test / pytest — all tests must pass before committing_meta.protocolVersion and _meta.clientCapabilities_meta still works (backwards compat)Use focused commits in this order:
fix(security): upgrade MCP SDK to patch April 2026 RCE
feat(mcp): stateless core — read capabilities from request _meta
feat(mcp): upgrade tool schemas to JSON Schema 2020-12
feat(mcp): add cloud-native routing headers and cache metadata
feat(mcp): harden OAuth 2.0 — issuer validation + scope declarations============================================================ SELF-HEALING VALIDATION (max 2 iterations) ============================================================
After applying changes, validate:
IF VALIDATION FAILS:
============================================================ OUTPUT ============================================================
Report:
Security
Stateless Core
JSON Schema 2020-12
Cloud-Native
OAuth
Commits
Remaining manual steps
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.