Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

mcp-statecheck

Latest version: v0.2.0

Overview

Last scanned
27 Nov 2026
Published
27 Nov 2026
PyPI package Publisher: lixiangyu20041227
1 Stars
0 Forks
1 Versions
32 Downloads
Python Repo language

Scan summary

mcp-statecheck was last scanned on 27 Nov 2026 at version 0.2.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: First and only release on 27 Nov 2026.
  • Findings: No rules fired in version 0.2.0.
  • Downloads: 32 downloads.

Versions

1 version published
Versions and the rules that fired in each
VersionPublishedStatus
0.2.0 LATEST 27 Nov 2026 No rules fired

No rules fired in 0.2.0

Findings

Findings for v0.2.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.2.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

mcp-statecheck

Stateful differential testing for Model Context Protocol implementations.

CI PyPI License: Apache-2.0

Many MCP failures only appear across a sequence: initialize, overlap requests, cancel one, reconnect an SSE stream, or recover from an expired session. mcp-statecheck models these interactions as canonical actions and records the wire behavior as deterministic, redacted traces.

[!NOTE] Version 0.2.0 adds modern quick checks and offline comparison of tool catalogs. See the release notes for the upgrade details.

Quickstart

From a fresh checkout with uv installed:

git clone https://github.com/lxingy3/mcp-statecheck.git
cd mcp-statecheck
uv sync --locked
uv run mcp-statecheck check --output artifacts/quickstart.json --junit artifacts/quickstart.xml --sarif artifacts/quickstart.sarif --html artifacts/quickstart.html --stdio -- uv run python -m mcp_statecheck._controlled_peer --stdio --mode sdk-smoke
Check passed: wrote artifacts/quickstart.json

The released CLI can also be installed without a checkout:

uv tool install mcp-statecheck==0.2.0
mcp-statecheck --version
mcp-statecheck 0.2.0

The same quick profile can target only a server you explicitly name:

mcp-statecheck check --stdio -- python server.py
mcp-statecheck check --url http://127.0.0.1:3000/mcp
mcp-statecheck check --header-env Authorization=MCP_TOKEN --url https://example.test/mcp

--header-env HEADER=ENVIRONMENT_VARIABLE reads the complete header value from the environment. The value is never placed in CLI arguments and is redacted before traces or reports are stored. The bounded quick profile initializes one session, sends ping, probes tools/list without calling any tool, verifies response shapes, and confirms transport cleanup.

Check a modern server

Select the revision explicitly for an MCP 2026-07-28 server:

uv run mcp-statecheck check --protocol-version 2026-07-28 --url http://127.0.0.1:3000/mcp --output current.json --html current.html

The same option works with --stdio -- COMMAND. The check uses server/discover to verify the revision and lists tools if the server advertises them. The default still selects the legacy 2025-11-25 sequence. Both checks follow tools/list cursors on the same connection without invoking tools. The page limit defaults to 100 and can be set with --max-tool-pages. Reaching the limit before the last page exits 2.

Compare two versions of a server

Run check against the old and new server builds with the same authorization scope, protocol revision, and transport. Save the JSON artifacts as baseline.json and current.json, then run:

uv run mcp-statecheck compare baseline.json current.json

compare reads the two files locally. It prints a JSON object with added and removed tool names, changed input or output schema fields, and whether the server's tools capability appeared or disappeared. The command exits 0 for a match, 1 for a change, and 2 if it cannot compare the inputs. It accepts successful checks with the same negotiated revision and transport. A paginated catalog must contain each page in order through the end of the cursor chain. Rerun checks whose saved reports stop before the last page.

The comparison ignores tool descriptions, tool order, and JSON object key order. It compares schema structure as saved in the redacted artifacts. For example, rearranging an enum array can register as a change even if both schemas accept the same inputs.

What works today

Area Current implementation
Protocol state Lifecycle, capability negotiation, pending requests, cancellation, streams, and logical sessions
Request identity Internal action IDs remain separate from MCP request IDs, including duplicate concurrent IDs
stdio JSON Lines subprocess transport with deadlines, bounded stderr, and child cleanup
Streamable HTTP Session headers, JSON and SSE responses, reconnect cursors, status handling, and cleanup
Traces Versioned JSON, deterministic writes, recursive secret redaction, and stable session aliases
Installable CLI Explicit-target checks for legacy and modern servers, offline tool catalog comparison, allowlisted replay, reports, and locked SDK matrices
Reports Deterministic JSON, JUnit XML, SARIF 2.1.0, and a script-free single-file HTML trace explorer
Automation A JSON-argv composite Action plus scheduled macOS runs of the full SDK matrix and clean-package acceptance
M1 controlled peers Five original controlled scenarios exercised over real stdio or localhost HTTP connections
M2 controlled corpus Five seeded RuleBasedStateMachine failures with stable signatures, shrinking, saved-trace reload, and 10-run replay
M3 real SDK clients Four isolated Python and TypeScript SDK runners across two released protocol revisions and both transports, with 16/16 cells checked against saved traces
M5 application servers Release-bound, allowlisted recipes drive pinned Filesystem and Git reference servers through verified state transitions and reproduce one normalized trace across ten fresh processes
M6.1 modern SDK clients A separate four-cell 2026-07-28 profile covers Python mcp 2.1.1 and TypeScript client 2.0.0 over stdio and Streamable HTTP
M6.2 Tasks wire profile Three generated controlled defects across both transports, with independent state checks, minimized traces, 10-run replay, and ten conforming baselines
M6.3 subscription wire profile Three controlled delivery defects across both transports, with per-subscription acknowledgement and filter checks, minimized traces, 10-run replay, and eight conforming baselines
M6.4 subscription lifecycle Controlled stdio cancellation, HTTP SSE closure, abrupt disconnect and re-subscription on both transports, plus a ten-run late-delivery fault
M6.5 SDK subscriptions Pinned Python and TypeScript clients exercise their native listen APIs over both transports, checking delivery and graceful completion in four cells
M6.6 SDK subscription lifecycle Eight native-client cells cover cancellation, abrupt drops, explicit re-subscription, and tool-list refetch across both transports
M6.7 concurrent SDK subscriptions Eight cells keep two native subscriptions open and check that cancelling either one preserves the other's delivery
flowchart LR
    A["Canonical actions"] --> B["State reducer"]
    A --> C["stdio or Streamable HTTP"]
    C --> D["Controlled MCP peer"]
    D --> E["Wire observations"]
    B --> F["Versioned trace"]
    E --> F
    F --> G["Hypothesis shrink<br/>(five M2 controlled failures)"]
    G --> H["Saved-trace reload<br/>and 10-run replay"]
    F --> I["JSON · JUnit · SARIF · offline HTML"]

The checked-in M1 acceptance report records the pinned Python runtime, exact passing test count, and all five M1 fixture checks within a 180-second hard deadline. CI runs the locked project on Ubuntu and Windows.

Reproduce the M1 baseline

Install uv, then run:

uv sync --locked
uv run python scripts/run_m1_acceptance.py
uv build

The acceptance command runs the full test suite and writes one wire trace per controlled fixture to artifacts/m1/.

Controlled defect corpus

Fixture Transport Observation preserved by M1
http-error-as-timeout Streamable HTTP An HTTP 503 remains distinct from a timeout
duplicate-concurrent-request-id stdio Two pending calls retain separate logical identities despite sharing one MCP request ID
second-sse-resume-token-loss Streamable HTTP Each reconnect sends the newest event ID
request-before-initialized stdio A request issued before initialization completes remains visible in the trace
late-response-after-cancellation stdio A cancelled result is cross-correlated with the later call

For example, the HTTP error fixture records the protocol result and cleanup state separately:

{
  "fixture_id": "http-error-as-timeout",
  "transport": "streamable-http",
  "normalized_events": [
    {
      "kind": "http_error",
      "status": 503
    }
  ],
  "cleanup": {
    "client_closed": true,
    "listener_closed": true
  }
}

M1 preserves the observations required for detection. M2 now closes that loop for all five controlled defects:

$ uv run python scripts/run_m2_slice.py --fixture http-error-as-timeout
M2 slice passed: minimized and replayed 10 times; wrote artifacts/m2/http-error-as-timeout.json
$ uv run python scripts/run_m2_slice.py
M2 slice passed: minimized and replayed 10 times; wrote artifacts/m2/request-before-initialized.json
$ uv run python scripts/run_m2_slice.py --fixture duplicate-concurrent-request-id
M2 slice passed: minimized and replayed 10 times; wrote artifacts/m2/duplicate-concurrent-request-id.json
$ uv run python scripts/run_m2_slice.py --fixture late-response-after-cancellation
M2 slice passed: minimized and replayed 10 times; wrote artifacts/m2/late-response-after-cancellation.json
$ uv run python scripts/run_m2_slice.py --fixture second-sse-resume-token-loss
M2 slice passed: minimized and replayed 10 times; wrote artifacts/m2/second-sse-resume-token-loss.json

Hypothesis reduces the generated sequence to initialize followed by tools/list for the lifecycle case, and to two overlapping tools/call requests sharing one ID for the request-identity case. The cancellation case uses fixture canaries to detect a full response cross-swap after call-a is cancelled and call-b is pending. That oracle is enabled only for this controlled fixture, and it verifies the cancellation request ID and both sides of the swap without assuming a response order. A late response alone is not classified as a failure. Each saved trace is loaded from disk and replayed against ten fresh peers; every run produces the expected stable signature.

The HTTP slice proves that a real 503 reached the transport before a controlled client adapter misclassifies it as a timeout. The SSE slice keeps the expected latest cursor in the canonical action while the controlled adapter omits it on the second reconnect, after the required initialized notification; the peer captures the actual cursor, session, and protocol headers. Each HTTP candidate and replay uses a fresh localhost peer, verifies client and listener cleanup, and verifies session deletion when a session was established.

The installed replay command accepts package-controlled target recipes. This M2 example uses the versioned controlled-fixture recipe:

$ mcp-statecheck replay artifacts/m2/request-before-initialized.json
Replay reproduced mcp-statecheck:v1:62237ccbaf578ac57aedd89b1b34c81c01913f6541dc3d3d414fbc180fd25dc2 in 10/10 attempts

Reproducing the protocol or differential failure exits 1. Invalid artifacts, unknown recipe versions or fixture IDs, startup failures, and cleanup failures exit 2. The recipe schema has exactly three fields: version, kind, and fixture_id. It cannot store or execute a command, URL, environment variable, or working directory.

Reproduce M3

The client matrix covers four pinned SDK runners, both released protocol revisions in the benchmark, and both stdio and Streamable HTTP. It requires uv and Node.js 24.14.1; the command installs the exact isolated Python and npm dependencies:

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases mcp-statecheck

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Frame 2085668439 (1)
Group 1261154229