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.

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.1.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.1-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.1-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.1.tar.gz.

File metadata

  • Download URL: mcmr-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 95021a7344a036dcef25a9f311d02315fd94765493047b6f3c88557ae01c8cf3
MD5 e440a97fdedc3a039917f5f9b3a0961c
BLAKE2b-256 5fdbaf74d32f89212daff06a44f92cb3f3518ee3cc86ba3904b277842c4ba379

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mcmr-0.0.1-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.1-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 189f7cca5fd550424941fb96899102b9e0e0e105e50605a1e1e752985330be81
MD5 8375b4ce18743bc1f85446c41823917f
BLAKE2b-256 5c7e88b8188c81a3def6aae9f29f0f467b33e2ee874b323f1dd243fdd8db27d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mcmr-0.0.1-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.1-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 da3944110c0eb17fe8162f5d021bfc332890385f4d2fba78ac6531151d7f0b3a
MD5 c12722787913df5ef21f3f12f99e25a1
BLAKE2b-256 bbcdff17db5fc6538ad70ba9034d8537e7037e2798968b66cac7e2c12ae62061

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