Skip to main content

MCMR banner

CI Release PyPI Python Docs Coverage License

[!WARNING] MCMR is early software. Its policy catalog and command line may change before the first stable release.

MCMR is a fast code policy engine for whole repositories. A Rust kernel understands the source tree once. Typed Python rules query shared Polars tables and report precise findings. Rules can also offer fixes that MCMR verifies before keeping them.

MCMR reads Python, Rust, TypeScript, C, C++, and CUDA. Deterministic checks are local and stateless. Model judgment, network evidence, and writeback are separate opt-ins.

Installation

Install the command line application from PyPI.

MCMR requires Python 3.14 or newer. Its primary runtime target is free-threaded Python 3.14t+, and standard CPython 3.14+ is supported too. Releases include Linux wheels for CPython 3.14 and 3.14t. MCMR itself is developed and rehearsed on 3.14t with the GIL disabled. An installer may build dependencies from source when their projects do not publish free-threaded wheels yet.

pip install mcmr
mcmr check .

Use uv tool install mcmr for an isolated command line installation.

What it is

  • One repository parse feeds every selected rule.
  • Each rule runs once over a typed table instead of once per object.
  • The default lane contains 241 deterministic rules and makes no model or network request.
  • Contextual rules and external evidence run only when explicitly enabled.
  • Findings name exact source locations and carry the measurements behind them.
  • Safe repairs are reparsed and checked again before MCMR keeps an edit.
  • Installed packages can add rules and evidence providers through public entry points.

Demo

demo/ is a small Model Context Protocol server written badly on purpose. The baseline reports 50 policy failures across 29 rules. Three prepared stages show how the same repository can converge while four deliberate findings remain.

Run the baseline without model judgment, network access, repairs, or writeback.

chefe run check demo/ --no-contextual --format concise --report-only

The expected summary is 3 files, 188 facts, 194 executed rules, 50 failures, and 81 findings. See demo/README.md for the staged walkthrough.

Usage

Check a repository with deterministic rules.

mcmr check . --no-contextual

Preview fixes without changing files.

mcmr check . --repair preview

Apply only fixes declared safe. MCMR reparses the result and reruns the originating rule before it keeps an edit.

mcmr check . --repair apply

Enable model judgment or network evidence only when the run needs them.

mcmr check . --contextual
mcmr check . --external
mcmr check . --contextual --external

Inspect the policy catalog and machine-readable output.

mcmr catalog
mcmr coverage
mcmr replacement
mcmr check . --format json

DataHub

The bundled DataHub provider turns schemas, lineage, ownership, and governance into typed facts. Rules join that catalog context to exact source references. Read access uses GraphQL directly and does not require a local Model Context Protocol server.

[tool.mcmr.execution]
external = true

[tool.mcmr.providers.datahub]
server = "http://localhost:8080"
max_assets = 500

Set DATAHUB_GMS_TOKEN when the service requires authentication, then run the external lane.

mcmr check . --external

Point recorded at captured exchanges to run the same rules without a network connection.

[tool.mcmr.providers.datahub]
recorded = "recordings"

Writeback is explicit. It records each verdict as a DataHub assertion result and records the whole invocation as a successful policy run. Policy failures remain visible in the run properties and assertion timelines without making a completed MCMR invocation look like an operational crash.

mcmr check . --external --writeback
mcmr history .

The provider keeps no local catalog cache. examples/datahub contains the recorded integration story and sample output. docs/agent-read-back.md shows how another agent can read the resulting history through DataHub.

Plugins

A rule package publishes an mcmr.rules entry point. An external evidence package publishes an mcmr.providers entry point.

[project.entry-points."mcmr.rules"]
acme = "acme_mcmr.rules"

[project.entry-points."mcmr.providers"]
acme = "acme_mcmr.provider:AcmeProvider"

Provider settings stay in the checked repository configuration. Secrets stay in the provider's chosen secret source.

Development

Chefe owns the environment and every project task.

chefe install
chefe run setup
chefe run lint
chefe run typecheck
chefe run test
chefe run core-lint
chefe run core-test
chefe run architecture
chefe run debug
chefe run contribute

MCMR is licensed under Apache 2.0. SYSTEM.md describes the contracts and ROADMAP.md records product work that remains.

Download files

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

Source Distribution

mcmr-0.0.2.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

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

mcmr-0.0.2-cp314-cp314t-manylinux_2_28_x86_64.whl (11.8 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

mcmr-0.0.2-cp314-cp314-manylinux_2_28_x86_64.whl (11.8 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

File details

Details for the file mcmr-0.0.2.tar.gz.

File metadata

  • Download URL: mcmr-0.0.2.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcmr-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f28fc6a7db068221ce7c79bb4a54d7afb48a9df0f2fbffefedeb8e162e9369c9
MD5 fd794560313f326e039b321bde48ea9a
BLAKE2b-256 55524c394c03996b0d27c0e7071366577509d33f4a917bb65b7334d22898c4c4

See more details on using hashes here.

File details

Details for the file mcmr-0.0.2-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: mcmr-0.0.2-cp314-cp314t-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 11.8 MB
  • Tags: CPython 3.14t, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcmr-0.0.2-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 29418989be5c8cf73784f596b52f9ae698d8da76aa7773e159a1880c5c2728cd
MD5 30781ffe63b25c02039733a8150e7fb3
BLAKE2b-256 b285dd7159db8adb1ce6ccb282704635421228f4df7d61a3541d43bd9f0f6fa4

See more details on using hashes here.

File details

Details for the file mcmr-0.0.2-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: mcmr-0.0.2-cp314-cp314-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 11.8 MB
  • Tags: CPython 3.14, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcmr-0.0.2-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 36e724efef9504ac192077933402a990fce4d8ba9b6c911480c41a0a09544206
MD5 e2525374fe77f48877420f1ae548368d
BLAKE2b-256 205ae03b710bf9ac981d3ad2e9a0eb9a257d100e96ddd0beabe47c31191ad156

See more details on using hashes here.

Supported by

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