mcpField
S
Stateless Migrator

Stateless Migrator

Local
matthiasmeyer.techDeveloper Tools0Updated 1w ago

About Stateless Migrator

Stateless Migrator is a CLI for maintainers of TypeScript and JavaScript MCP servers checking compatibility with MCP-Spec 2026-07-28 RC. It scans for violations, previews and applies a limited safe AST rewrite, and verifies code against the spec.

Key features

  1. 01Scan code for spec violations
  2. 02Preview planned changes as diffs
  3. 03Apply the supported AST rewrite
  4. 04Verify code against the spec
  5. 05Generate coverage reports

Use cases

  1. 01Audit an MCP server before a spec upgrade
  2. 02Review planned changes before applying them
  3. 03Update matching error-code properties
  4. 04Check whether migration issues remain

MCP support

This CLI scans and migrates MCP server codebases for compatibility with MCP-Spec 2026-07-28 RC. It does not describe an MCP server endpoint of its own.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"stateless-migrator": {
"command": "npx",
"args": [
"-y",
"mcp-stateless-migrator"
]
}
}
}
Run commandnpx -y mcp-stateless-migrator

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmmcp-stateless-migrator

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

Part of the StudioMeyer MCP Stack — Built in Mallorca 🌴 · ⭐ if you use it

mcp-stateless-migrator

npm version CI OpenSSF Scorecard License: MIT

CLI tool that scans MCP-server codebases for incompatibilities with MCP-Spec 2026-07-28 RC (Stateless Core, mandatory headers, deprecated features, error-code shift, OAuth hardening, endpoint-shape changes) and applies safe AST-rewrites where mechanically possible.

Target users: maintainers of TypeScript/JavaScript MCP servers (the largest SDK userbase, @modelcontextprotocol/sdk).

Status: v0.1.2 — pre-final-RC. Detection rules are tagged with specRevision: 2026-07-28-rc-2026-05-21 and cite the canonical SEP files. v0.2.0 will re-validate against the Tier-1 SDK final release.

Install

npm install -g mcp-stateless-migrator
# or one-shot:
npx mcp-stateless-migrator scan ./src

Requires Node >= 20.

CLI

#CommandArgsOutputRead-onlyDestructive
1scan<path> [--format json|text|md|html]violations + severityyesno
2diff<path> [--output <file>]unified diff of planned patchesyesno
3patch<path> [--dry-run] [--no-backup] [--only <id...>]rewrites files + writes backup foldernoyes
4verify<path> [--spec <rev>]exit 0 = cleanyesno
5report<path> [--format json|md|html]coverage reportyesno
6rules[--verbose]list all detection rulesyesno

Detection rules

RuleSeverityAuto-patchSource
r01-stateless-corewarnnoSEP-2567
r02-mandatory-headersinfonoSEP-2243
r03-tasks-extensionwarnnoSEP-2663
r04-apps-extensioninfonoSEP-1865
r05-deprecationswarnnoSEP-2577
r06-error-code-shifterroryesSEP-2164
r07-oauth-hardeningwarnnoSEP-2468
r08-endpoint-shapewarnnoSEP-2596

Only r06 rewrites code automatically — it swaps -32002 -> -32602 inside any property named code (identifier key, "code"/'code' string key, or class field), and leaves computed keys and same-value-but-different-name properties untouched. SEP-2164 is Draft status as of the RC, so re-validate before the final spec; every patch is backed up by default. Every other rule requires a human reviewing the planned change — server architecture varies too much for blind auto-patching.

Usage

# 1. See what the migrator finds
mcp-stateless-migrator scan ./src --format text

# 2. Preview the auto-patch as a unified diff
mcp-stateless-migrator diff ./src

# 3. Apply only the safe error-code shift, with backup
mcp-stateless-migrator patch ./src --only r06-error-code-shift

# 4. Confirm the codebase is clean
mcp-stateless-migrator verify ./src

# 5. Generate a Markdown report for the team
mcp-stateless-migrator report ./src --format md > migration-report.md

Exit codes:

  • 0 — clean (no violations OR patch applied successfully)
  • 1 — violations remaining / diff non-empty
  • 2 — invalid CLI arguments

Backup folder

patch creates <path>/.bak.<ISO-timestamp>/ containing the original file tree for every file it touched. Pass --no-backup to disable (not recommended). Restore via cp -r .bak.<timestamp>/. ..

Programmatic API

import { scanPath, patchPath, formatScan } from "mcp-stateless-migrator";

const report = await scanPath("./src");
console.log(formatScan(report, "json"));

await patchPath("./src", { dryRun: false, backup: true, only: ["r06-error-code-shift"] });

Custom patterns accept at most 128 strings. Each string is limited to 1024 UTF-16 code units and 16 unescaped opening grouping characters ((, {, [). Inputs above these budgets raise a controlled error before matching. Use patterns relative to the scan root. Ignore rules apply within that root; an ignored name in an ancestor path does not exclude an explicitly selected root.

Ecosystem

This tool complements:

See ECOSYSTEM.md for the full positioning matrix.

License

MIT — Copyright © 2026 Matthias Meyer (StudioMeyer).

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.