Skip to main content

Stratum MCP server for Claude Code — structured execution, typed contracts, postcondition enforcement

Project description

stratum-mcp

Stratum MCP server for Claude Code. Structured execution, typed contracts, postcondition enforcement — no sub-LLM calls.

Install

pip install stratum-mcp
stratum-mcp install

setup configures Claude Code in one command: writes .claude/mcp.json, appends the execution model block to CLAUDE.md, and installs nine skills to ~/.claude/skills/. Restart Claude Code and it's active.

Skills

Skill What it structures
/stratum-onboard Read a new codebase cold and write project-specific MEMORY.md — run once after setup
/stratum-plan Design a feature and present it for review — no implementation until approved
/stratum-feature Feature build: read existing patterns → design → implement → tests pass
/stratum-review Three-pass code review: security → logic → performance → consolidate
/stratum-debug Debug: read test → read code → check env → form hypotheses → confirm/rule out → fix
/stratum-refactor File split: analyze → design modules → plan extraction order → extract one at a time
/stratum-migrate Find bare LLM calls and rewrite as @infer + @contract
/stratum-test Write a test suite for existing untested code
/stratum-learn Review session transcripts — extract retry patterns, write conclusions to MEMORY.md

MCP Tools

Tool What it does
stratum_validate Validate a .stratum.yaml spec
stratum_plan Validate + create execution state + return first step
stratum_step_done Report a completed step; check postconditions; return next step or completion
stratum_audit Return per-step trace (attempts, duration) for any flow

Building on Stratum

Stratum exposes four stable integration points for apps and tooling:

1. MCP tools (Claude Code agents)

The primary control plane — stratum_plan, stratum_step_done, stratum_audit. Used by agents running inside Claude Code.

2. Query CLI (read-side, any process)

stratum-mcp query flows              # → JSON array of FlowSummary
stratum-mcp query flow <id>          # → JSON FlowState
stratum-mcp query gates              # → JSON array of pending gates

Exit 0, JSON to stdout. Use from shell scripts, background services, or UI backends.

3. Gate CLI (write-side, any process)

stratum-mcp gate approve <flow_id> <step_id> [--note "..."] [--resolved-by agent]
stratum-mcp gate reject  <flow_id> <step_id> [--note "..."]
stratum-mcp gate revise  <flow_id> <step_id> [--note "..."]

Exit codes: 0 success · 1 error (JSON on stdout) · 2 conflict (already resolved).

4. Storage schemas (contracts/)

Versioned JSON schemas for the flow state and audit record formats. Stable across internal refactors.

stratum-mcp/contracts/
  flow-state.v1.schema.json
  query-flows.v1.schema.json
  query-gates.v1.schema.json
  gate-mutation.v1.schema.json
  audit-record.v1.schema.json

How It Works

Claude writes .stratum.yaml specs internally — you never see them. You see plain English narration. The MCP server enforces postconditions on every step; if a step's output fails a check, Claude fixes it and retries before reporting success.

Full documentation: stratum-in-claude-code.md

Tutorial: claude-code-tutorial.md

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stratum_mcp-0.2.15.tar.gz (107.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stratum_mcp-0.2.15-py3-none-any.whl (67.4 kB view details)

Uploaded Python 3

File details

Details for the file stratum_mcp-0.2.15.tar.gz.

File metadata

  • Download URL: stratum_mcp-0.2.15.tar.gz
  • Upload date:
  • Size: 107.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for stratum_mcp-0.2.15.tar.gz
Algorithm Hash digest
SHA256 2513d21cf0b30f00e9b0ade59382789c0f555c929b0578f7a48ce9cd5f46b6ea
MD5 3d96800c58cc2bae7cb08054b4ed3aa4
BLAKE2b-256 0d99686cf39235c773b8c2eef1a5844658334c1873531abe2f8efbbb94f140f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for stratum_mcp-0.2.15.tar.gz:

Publisher: publish.yml on regression-io/stratum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stratum_mcp-0.2.15-py3-none-any.whl.

File metadata

  • Download URL: stratum_mcp-0.2.15-py3-none-any.whl
  • Upload date:
  • Size: 67.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for stratum_mcp-0.2.15-py3-none-any.whl
Algorithm Hash digest
SHA256 25e15e7124603354e9e7ca94abd0a65f798472939262db5b2daa11a04fda57a7
MD5 c112817c8159238381c4d820bf2a02f4
BLAKE2b-256 778d7e552fab2524b6e54abe53a96aa09892471c96f941fa448c83248abf87ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for stratum_mcp-0.2.15-py3-none-any.whl:

Publisher: publish.yml on regression-io/stratum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page