This release is a pre-release and may not be stable for production use.
MCP Trust Monitor
A Python library that keeps MCP tool approval tied to the metadata an operator reviewed. When the monitor observes changed tool definitions, calls through the managed client stop until the new revision is reviewed and approved.
Version 0.2.0a2 is a corrective alpha for local stdio servers. It provides an owning async SDK, a CLI, background monitoring, a local operator console, and decision-record export. Optional Semgrep, OpenAI, Senso and ClickHouse adapters add policy checks, review recommendations, reviewed precedents and audit delivery. Memory is off by default.
Upgrading from 0.2.0a1. 0.2.0a2 fixes four defects:
- Launch identity. A server whose executable symlink was retargeted during startup or observation could receive calls under an approval recorded for the new target.
- Detector changes. A detector-only change did not invalidate approvals or selection tokens.
- Optional descriptions. A tool without a description failed model review.
- Export provenance. Failed assessments exported no returned policy sources.
The first time 0.2.0a2 opens an existing state directory, approved servers return to pending review once and quarantine is kept. Observe and approve them again. See the handoff and the compatibility notes.
Install
Use Python 3.10 or 3.12 on macOS or Linux. Download the wheel and SHA256SUMS from
the versioned GitHub release,
verify its checksum, and install into your application's environment:
python3 -m venv .venv
.venv/bin/python -m pip install ./mcp_trust_monitor-0.2.0a2-py3-none-any.whl
.venv/bin/mcp-trust-monitor --help
The core library requires no cloud credentials. See the library guide for configuration, CLI commands, optional adapters, ownership and recovery. Windows and remote MCP transports are outside this release.
Try the enforcement boundary
The installed consumer example runs an independently configured synthetic server outside the checkout. It:
- observes a tool and explicitly approves that revision;
- completes one protected call;
- changes the server's metadata;
- shows the next call blocked, with the server's instrumented call count unchanged.
The example creates its own temporary policy and state. It needs no API key. Its scripted approval is for a controlled demonstration; a real application must present the exact revision and generation to its operator before approval.
Use the SDK
from pathlib import Path
from mcp_trust_monitor import MonitorConfig, ServerConfig, TrustMonitor
config = MonitorConfig(
state_dir=Path("state"),
policy_path=Path("operator-policy.json"),
servers={"notes": ServerConfig(
"notes", "/absolute/path/to/python",
("/absolute/path/to/notes_server.py",),
cwd="/absolute/path/to/server-directory",
)},
)
async def inspect():
async with TrustMonitor(config) as monitor:
observed = await monitor.observe("notes")
# Display the observed metadata, revision and generation to your operator.
# Call monitor.approve(...) only after that explicit decision.
return observed
The owning monitor coordinates sessions for one state directory. Protected calls check approval, current metadata, launch identity, policy and session freshness before dispatch. A changed definition, failed observation, quarantine or stale selection blocks dispatch. Calls are never replayed automatically after an uncertain outcome. See the API and lifecycle contract.
What protection means
Only calls made through this library are covered. Observation starts the configured executable, so configure only processes you are prepared to run. The library does not sandbox code, verify package integrity, inspect returned document content, or guarantee that an approved tool behaves safely. An OpenAI review can recommend review or quarantine; it cannot approve a tool or override a deterministic hard denial.
Decision-record exports are pseudonymous, not anonymous. Memory requires human verdicts, exact-content approval, verified private publication and current local eligibility. It is optional and has no authority to approve calls.
Verification and evidence
The 0.2.0a2 code passed 645 tests on each of Python 3.10/3.12 across local macOS ARM64 and Linux ARM64, plus installed-wheel, typing and cross-version state checks. Every repaired defect has regression tests that fail on the 0.2.0a1 code. The CI workflow checks the release source on hosted Linux AMD64 and macOS ARM64. Exact hosted results and artifact hashes belong to the release's verification record.
The release evidence distinguishes current runtime checks from older live service experiments. The historical eight-case memory comparison tied at 24/24 per mode; it did not demonstrate an improvement. Private lesson records, service identifiers and raw provider data are not included in the public release.
Develop
uv sync --locked --python 3.12
uv run pytest -q
uv build
uv run python scripts/check_distribution.py
uv run python tests/typing/check.py
Tests use synthetic state and no cloud keys. Detector tests run pinned Semgrep
1.180.0 in an isolated uvx environment. Node.js is required for the console's
JavaScript tests; set MTM_REQUIRE_NODE=1 to make its absence fail the suite.
Read the specification,
console guide,
and handoff
before changing the trust boundary. Historical scripted demos remain available as
python -m mcp_trust_monitor.historical_demo; they use separate demo state and
are not the generic library CLI.
MIT licensed. Report bugs through GitHub issues.
Metadata
Release files for mcp-trust-monitor 0.2.0a2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcp_trust_monitor-0.2.0a2.tar.gz | 478.9 kB | With provenance | Details for mcp_trust_monitor-0.2.0a2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcp_trust_monitor-0.2.0a2-py3-none-any.whl | Python 3 | none | any | Details for mcp_trust_monitor-0.2.0a2-py3-none-any.whl |
Total release size: 626.2 kB
Release files / mcp_trust_monitor-0.2.0a2.tar.gz
| Download URL | mcp_trust_monitor-0.2.0a2.tar.gz |
|---|---|
| Size | 478.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c79f415ac88c416b8ecda2f8dfa743eb7b2b160df4c8dc5d651deeca2c8494e
|
|
BLAKE2b-256 checksum How to use checksums |
a1fdb0bef206e1cd0d1ba0ea24d03fb8b0eb518438911502a176fbb5b52f85f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.
Transparency logRelease files / mcp_trust_monitor-0.2.0a2-py3-none-any.whl
| Download URL | mcp_trust_monitor-0.2.0a2-py3-none-any.whl |
|---|---|
| Size | 147.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4cbeb7ed831eb4a5644bcb6659fc7497e8a85f3ca2042a57f3964ba8499d7384
|
|
BLAKE2b-256 checksum How to use checksums |
832f0305b68ac81d81123a37a2011ecb8d80adb50fe92ebeee109751e7d2a477
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.
Transparency logSecurity for mcp-trust-monitor 0.2.0a2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mcp_trust_monitor-0.2.0a2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.