Metadata-Version: 2.4
Name: mcmr
Version: 0.0.3
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Requires-Dist: annotated-types>=0.8,<1
Requires-Dist: anyio>=4.14,<5
Requires-Dist: cyclopts>=4
Requires-Dist: huggingface-hub>=0.34,<1
Requires-Dist: httpx>=0.28,<1
Requires-Dist: openai>=2.53,<3
Requires-Dist: packaging>=26,<27
Requires-Dist: patos>=0.0.10,<0.1
Requires-Dist: pathspec>=1.1,<2
Requires-Dist: polars>=1.41,<2
Requires-Dist: pydantic>=2.13,<3
Requires-Dist: rich>=14,<16
Requires-Dist: sqlglot>=27,<28
Requires-Dist: tron-python>=0.1,<0.2
License-File: LICENSE
Summary: Define and enforce the engineering rules that make your code yours.
Keywords: lint,rules,static-analysis,mcmr
Home-Page: https://phvv.me/mcmr/
Author-email: Pedro Valois <contact@phvv.me>
License-Expression: Apache-2.0
Requires-Python: >=3.14
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://phvv.me/mcmr/docs/
Project-URL: Homepage, https://phvv.me/mcmr/
Project-URL: Issues, https://github.com/phvv-me/mcmr/issues
Project-URL: Repository, https://github.com/phvv-me/mcmr

<div align="center">

[![My Code, My Rules banner](https://raw.githubusercontent.com/phvv-me/mcmr/main/docs/assets/banner.png)](https://phvv.me/mcmr/)

[![CI](https://github.com/phvv-me/mcmr/actions/workflows/ci.yml/badge.svg)](https://github.com/phvv-me/mcmr/actions/workflows/ci.yml)
[![Publish](https://github.com/phvv-me/mcmr/actions/workflows/publish.yml/badge.svg)](https://github.com/phvv-me/mcmr/actions/workflows/publish.yml)
[![PyPI](https://img.shields.io/pypi/v/mcmr)](https://pypi.org/project/mcmr/)
[![Python](https://img.shields.io/pypi/pyversions/mcmr)](https://pypi.org/project/mcmr/)
[![Docs](https://img.shields.io/badge/docs-phvv.me%2Fmcmr-C6281C)](https://phvv.me/mcmr/)
[![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)](https://github.com/phvv-me/mcmr/actions/workflows/ci.yml)

</div>

> **Warning** MCMR is early `0.0.x` software. Its rules and command line may still change.

## Installation

MCMR requires Git and Python 3.14 or newer. Its main target is free-threaded Python `3.14t+`.

```sh
pip install mcmr
mcmr check .
```

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

## What it is

MCMR is a policy engine for whole repositories. A Rust kernel reads source once into typed fact
tables. Python rules query the shared evidence and report exact findings with source locations.

- Deterministic rules are local, fast, and enabled by default.
- Contextual rules use a configured model only when you enable them.
- External rules can join repository facts with systems such as DataHub.
- Safe repairs are kept only after MCMR reparses the edit and reruns the rule.
- Plugins can add rules and evidence providers through public entry points.

MCMR reads Python, Rust, TypeScript, C, C++, and CUDA.

## Usage

```sh
mcmr check . --format concise
mcmr check . --repair preview
mcmr check . --repair apply
mcmr check . --contextual --external
```

Write every verdict to DataHub, then read the history before the next agent changes the code.

```sh
mcmr check . --external --writeback
mcmr history .
```

## Demo

The repository includes a deliberately messy MCP server. Run every enabled rule without changing
the demo.

```sh
mcmr check demo/ --contextual --external --writeback --report-only
```

See the [documentation](https://phvv.me/mcmr/docs/), the
[rule reference](https://phvv.me/mcmr/docs/rules/), and the
[recorded DataHub examples](examples/datahub). [SYSTEM.md](SYSTEM.md) documents the architecture.
The docs also cover [contextual setup](https://phvv.me/mcmr/docs/start/contextual-rules/) and
[rule controls](https://phvv.me/mcmr/docs/reference/rule-control/).

MCMR is licensed under Apache 2.0.

