A previous release had provenance metadata, but this release does not. View details.
mcp-behave
See what your MCP servers actually do at runtime. Audit them before connecting them to an AI agent, monitor live tool calls, and enforce reviewed behavioral policies.
Quick start · Runtime monitoring · Validation · Documentation · Discussions
Quick start
Run without permanent installation using uvx, or install with pip or npm:
uvx mcp-behave --version
# or
pip install mcp-behave
# or
npm install -g mcp-behave
The npm package launches the Python implementation. Native tracing supports compatible macOS and Linux runtimes; building the interposer requires a C compiler.
1. Audit a server
Discover MCP capabilities, exercise them with schema-aware inputs, and compare declared metadata with observed file, network and process activity.
uvx mcp-behave audit python -m my_mcp_server
Safety: Audits execute server code and may invoke mutating tools. Use synthetic data in a disposable environment. Canary HOME redirection is not OS isolation; sandboxing is off by default. For untrusted targets, use a suitable isolated container or VM. Audit
--sandbox automay fall back to unsandboxed execution.
2. Monitor your AI client
Already using Claude Desktop, Claude Code or Cursor? Preview configuration changes, then wrap one existing server (replace filesystem with its configured name):
uvx mcp-behave status --client claude
uvx mcp-behave install filesystem --client claude --dry-run
uvx mcp-behave install filesystem --client claude
Restart the client and use its MCP tools normally. To undo the integration:
uvx mcp-behave uninstall filesystem --client claude
Or configure the stdio proxy manually. Example for a controlled filesystem fixture:
mkdir -p /tmp/mcpb-fixture
uvx mcp-behave wrap --server filesystem --state-dir /tmp/mcpb-logs \
-- npx -y @modelcontextprotocol/server-filesystem@2.4.1 /tmp/mcpb-fixture
wrap is launched by an MCP client, not used as an interactive shell. It forwards JSON-RPC and records session telemetry (JSONL and SQLite). With the explicit state directory above, session logs are in /tmp/mcpb-logs/sessions/.
AI client <--> mcp-behave wrap <--> MCP server
|
+-- Protocol monitoring & policy checks
+-- Native runtime events & tool attribution
+-- Session telemetry
Example from a post-release macOS filesystem test (selected event fields):
{
"event": "file_write",
"target": "/private/tmp/mcp-behave-test/hello.txt",
"current_tool": "write_file",
"request_id": 3,
"source": "interposition",
"evidence_tier": "observed"
}
3. Enforce reviewed behavior
Generate a multi-server lockfile in an isolated test environment, review it, then enable inline policy enforcement:
uvx mcp-behave --lock --server-id my-server python -m my_mcp_server
uvx mcp-behave wrap --server my-server --lockfile mcp-behave.lock.json \
--enforce -- python -m my_mcp_server
--enforce requires a valid matching lockfile entry. The default fail-closed policy blocks covered protocol violations and stops forwarding when required tracing coverage is detected to be unavailable or degraded. --fail-mode fail-open skips inline blocking; --redact separately enables response redaction. Native OS activity is observed, not universally blocked or undone.
Features
| Capability | What it does |
|---|---|
| Active auditing | Schema-aware probes, optional declarative probe profiles, static lint and behavioral findings. |
| Live monitoring | Stdio proxy with native file, network and process observation and tool-call attribution. |
| Policy enforcement | Reviewed multi-server lockfiles, inline filtering, manifest re-verification and optional redaction. |
| Behavioral regression | init / check detect drift against a separate single-server baseline. |
| Configuration security | Scan MCP client configs for risky settings; install or remove wrappers. |
| CI integration | JSON, SARIF and severity-based audit exit codes. |
What's new in v0.5.8
- Improved macOS support for npm-based MCP servers with a Darwin npx launch adapter.
- Hardened fail-closed request forwarding, final telemetry draining and PID tracking degradation handling.
- Conservative attribution when telemetry is lost, with explicit shutdown uncertainty.
- Improved nested-schema argument synthesis, fixture-assisted probe profiles and detection precision.
- Frozen release artifacts with checksum-verified CI promotion and trusted publishing.
Read the v0.5.8 release notes.
CI and other commands
uvx mcp-behave --json --fail-on high python -m my_mcp_server
uvx mcp-behave --sarif python -m my_mcp_server > mcp-behave.sarif
| Command | Purpose |
|---|---|
lint manifest.json |
Static checks without launching a server. |
scan-configs / audit-configs |
Inspect client configuration / actively audit configured targets. |
inspect |
Correlated audit timeline. |
init / check |
Single-server behavioral baseline and regression check. |
approve |
Review and approve a manifest change into the multi-server lockfile. |
serve |
Expose auditing capabilities over MCP. |
Run uvx mcp-behave --help or uvx mcp-behave wrap --help for options. The legacy mcp-behave.lock format is distinct from mcp-behave.lock.json.
Validation
| v0.5.8 release validation | Result |
|---|---|
| macOS regression suite | 538 passed |
| Linux regression suite (non-root ARM64 container, installed wheel) | 530 passed, 8 skipped |
| Real-world wrap/enforce scenarios | Seven servers evaluated |
| Filesystem acceptance | 30 successful runs (including initial cache population) |
| Public installations | PyPI/uvx and npm smoke tests passed |
Evaluated servers include MotherDuck, DBHub, Qdrant, Excel, MCP Memory Service, Desktop Commander and Filesystem. These are selected, project-maintained scenarios, not comprehensive coverage or security certification. Cold-cache launches may time out or degrade tracing; the v0.5.8 soak was short-duration lifecycle validation, not an endurance test.
Release notes · Historical validation (v0.5.7) · Benchmarks and historical endurance results · Integration examples
Security boundaries
- Native interposition observes selected dynamic-library calls, not every syscall. Static binaries, direct syscalls, macOS SIP and hardened runtimes can limit coverage.
wrapsupports local stdio; remote SSE/Streamable HTTP audits do not trace the remote host. npm package installation can occur outside runtime monitoring.- Tracing, protocol enforcement and OS sandboxing are different controls.
wrap --no-trace --enforceis rejected in fail-closed mode; active tracing does not prove complete telemetry. Shutdown may reporttelemetry_complete: falseeven with zero reported drops. - A clean audit is not proof of safety. Review coverage, findings, lockfile changes and platform limitations before trusting a server.
Documentation
| Resource | Details |
|---|---|
| Architecture | Internal design and data flow |
| Detailed usage reference (v0.5.8) | Full CLI examples, sandbox semantics, probe profiles and platform caveats |
| Detection matrix | Rules and observation coverage |
| Security policy | Threat boundaries and private vulnerability reporting |
| Technical whitepaper · Research article | Background and experiments |
| Changelog · Roadmap | Changes and planned work |
Community
Questions, ideas and integration experiences are welcome in GitHub Discussions. Report reproducible bugs in Issues; report sensitive vulnerabilities privately as described in SECURITY.md.
To contribute, clone the repository, install with python -m pip install -e ".[test]", and run pytest -v.
MIT — License.
Metadata
Release files for mcp-behave 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Loss of provenance
These files do not have provenance metadata, despite files in a prior release including this data.
We recommend further investigation before installing these files. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcp_behave-0.6.0.tar.gz | 195.2 kB | Without provenance | Details for mcp_behave-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcp_behave-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for mcp_behave-0.6.0-py3-none-any.whl |
Total release size: 409.9 kB
Release files / mcp_behave-0.6.0.tar.gz
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | mcp_behave-0.6.0.tar.gz |
|---|---|
| Size | 195.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d9cfa6fdb71626feb8b2b1f5395cca8daee5d977d5681be997a938f4f13f985
|
|
BLAKE2b-256 checksum How to use checksums |
9f017112760161247423eae74cd09b07cf9306931f213beb37040a9ffc199207
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Release files / mcp_behave-0.6.0-py3-none-any.whl
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | mcp_behave-0.6.0-py3-none-any.whl |
|---|---|
| Size | 214.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
043b6f1185e95942addd29d47f4e4d6386c3b90426f7207f8a1fac4ccaca8350
|
|
BLAKE2b-256 checksum How to use checksums |
6319996980677fa79c4f1bb5b19a243e46c3659daceea553b6850fff0b21b110
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Security for mcp-behave 0.6.0
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.
Loss of provenance
A previous release of these files had provenance metadata, but this release does not.
While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.
Release comparison
- Removed 0.5.8 2 files With provenance
- Added 0.6.0 2 files Without provenance
A 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.