Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

mcp-behave

Latest version: v0.5.6

Overview

Last scanned
26 Nov 2026
Published
26 Nov 2026
PyPI package Publisher: navid72m
4 Stars
0 Forks
29 Versions
3.6K Downloads
Python Repo language

Scan summary

mcp-behave was last scanned on 26 Nov 2026 at version 0.5.6. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 29 versions; the latest 5 were published within 6 days (21–26 Nov 2026).
  • Findings: No rules fired in version 0.5.6.
  • Downloads: 3,595 downloads.

Versions

29 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.5.6 LATEST 26 Nov 2026 No rules fired
0.5.5 25 Nov 2026 No rules fired
0.5.4 25 Nov 2026 No rules fired
0.5.3 21 Nov 2026 Not shown
0.5.2 21 Nov 2026 Not shown

No rules fired in 0.5.6

Findings

Findings for v0.5.6. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.5.6; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

mcp-behave

Runtime behavioral auditing and monitoring for Model Context Protocol (MCP) servers.

CI PyPI npm MCP Registry License: MIT

npm downloads

mcp-behave is a CLI-first security tool for checking what an MCP server actually does—not only what its tool descriptions say it can do. It actively exercises a server's advertised capabilities, observes selected runtime activity, checks protocol metadata and responses, and compares behavior with saved baselines.

It also provides mcp-behave wrap, a stdio proxy for monitoring MCP traffic while an AI client uses a server. mcp-behave is CLI-first: it provides terminal, JSON, and SARIF output and does not ship a built-in graphical dashboard.

Why mcp-behave?

An MCP server can advertise a harmless tool while its implementation performs unexpected operations. For example, a tool described as a local document formatter might also read a credential file or attempt an outbound network connection.

mcp-behave compares two views of a server:

  • Declared behavior: tools, input schemas, annotations, resources, prompts, and metadata exposed over MCP.
  • Observed behavior: selected file, network, and process activity captured while the server is exercised or monitored.

The goal is to make unexpected behavior visible for review. A clean audit is not proof that a server is safe; it means no covered issue was observed in the tested scenarios.

What it checks

  • Runtime activity: selected filesystem operations, network connection attempts, and subprocess launches.
  • MCP metadata: tool definitions, schemas, descriptions, annotations, resources, prompts, and manifest changes.
  • Content risks: prompt-injection patterns, invisible or bidirectional Unicode characters, terminal escape sequences, and external Markdown/HTML image references in tool output.
  • Sensitive data: known secret patterns and configured canary tokens in inspected payloads.
  • Client configuration: hard-coded credentials, broad filesystem mounts, shell wrappers, and unpinned package commands in supported MCP client configuration files.

Findings describe observed behavior and potential risks; they are not automatic accusations of malicious intent.

Install

The simplest option is to run with uvx:

uvx mcp-behave --version

Or install the Python package:

python -m pip install mcp-behave
mcp-behave --version

An npm package is also available:

npm install -g mcp-behave
mcp-behave --version

About the npm package: it is a Node.js launcher for the Python implementation, not a separate JavaScript auditing engine. It requires Node.js 16+ and a Python 3 environment; it uses uvx or pipx when available.

Quick start: audit an MCP server

Important: audits execute server code

An audit is active testing, not passive package inspection. The probe may call tools and read resources/prompts, and those operations can have side effects. Do not run an unfamiliar server against your normal host environment without isolation.

The audit sandbox defaults to none. Passing --sandbox auto asks mcp-behave to use Podman or Docker when available, but it does not guarantee isolation: if neither container runtime responds, the audit falls back to unsandboxed local execution. Container runs default to --network=none with the default python:3.12-slim or node:20-slim image and only the working directory mounted read-only at /workspace, so commands that download packages (npx -y, uvx) or reference host paths outside the working directory require pre-populated images or an already isolated disposable environment. When you require container isolation, run from a disposable directory with synthetic inputs and specify an explicit runtime (--sandbox docker or --sandbox podman) with a command and image that can run offline against /workspace.

Pass a stdio server command to run a one-shot audit. The audit prefix is optional. Running bare mcp-behave starts the tool's MCP service.

uvx mcp-behave python -m my_mcp_server
mcp-behave audit python -m my_mcp_server

Inside an already isolated disposable environment with synthetic fixture files, you can also audit a local server launched with npx or uvx:

uvx mcp-behave npx -y @modelcontextprotocol/server-filesystem /tmp/mcpb-fixture
uvx mcp-behave uvx mcp-server-git

The probe starts the server, initializes a session, discovers tools, resources, and prompts, and exercises advertised capabilities with synthesized inputs. It can call tools, read resources, and fetch prompts. Even an untraced audit executes server code and can cause side effects. The default audit environment redirects home and configuration paths to a temporary canary home and filters environment variables by name. An unsandboxed target still has the host access of the account that launched it.

With --transport sse or --transport streamable-http, supply one URL. The audit connects to the running remote server and exercises it for manifest and protocol analysis, without local OS tracing of the server.

Runtime monitoring with wrap

mcp-behave wrap runs between an AI client and a stdio MCP server. The client sends MCP messages to the proxy; the proxy forwards them to the target while monitoring protocol traffic and selected operating-system activity.

AI client  <---- stdio / JSON-RPC ---->  mcp-behave wrap  <---- stdio / JSON-RPC ---->  MCP server
                                                 |
                                                 +-- protocol monitoring
                                                 +-- runtime tracing (when available)
                                                 +-- policy checks, scanning, and telemetry

Start the inline proxy in monitoring mode with a controlled fixture:

uvx mcp-behave wrap \
  --server my-server \
  -- python -m my_mcp_server

By default, wrap monitors protocol traffic and can issue periodic synthetic tools/list requests to recheck the manifest. It publishes observed OS policy violations and emits alerts after the activity is observed. Protocol enforcement, response redaction, and OS sandboxing are independently configurable.

With --enforce, wrap requires a valid multi-server lockfile entry matching the selected server ID before launching the child, even with --fail-mode fail-open. With the default fail-closed mode, the inline filter rejects unapproved tools/call requests (including Unicode-escaped method names), JSON-RPC batch arrays, malformed JSON, and non-object payloads before forwarding, and replaces covered server responses containing a detected canary, critical secret, batch array, or malformed JSON with a JSON-RPC error. fail-open skips those inline blocks. wrap also bounds individual JSON-RPC messages and stdin queueing to 16 MiB (256 items max in queue; one oversized message up to 16 MiB is permitted when empty) and applies bounded process-group shutdown. Monitoring can still report findings.

--redact replaces detected secret and canary values in inspected server JSON payloads that reach the redaction step. Replacing or redacting a response leaves any OS side effects that already happened in place. Stderr, files, and network traffic are outside this protocol filter.

Create and use a behavioral lockfile

Generate or update the multi-server lockfile from an audit:

uvx mcp-behave --lock --server-id my-server python -m my_mcp_server

This writes mcp-behave.lock.json. Review the generated baseline before treating it as approved. Then run the server through wrap with enforcement enabled:

uvx mcp-behave wrap \
  --server my-server \
  --lockfile mcp-behave.lock.json \
  --enforce \
  -- python -m my_mcp_server

To review a manifest change observed by wrap and approve it into the lockfile:

uvx mcp-behave approve --server my-server

Useful wrap options:

Option Purpose
--enforce Enforce lockfile-based tool policy checks. Requires a valid matching entry in mcp-behave.lock.json.
--redact Replace detected sensitive values in inspected server responses.
--canary TOKEN / --canary-file PATH Watch for configured canary values in inspected traffic.
--sandbox auto Request the platform-appropriate sandbox backend.
--no-trace Disable native runtime tracing and retain protocol-level monitoring.
--no-reverify Disable periodic synthetic tools/list re-verification.

wrap is an stdio proxy; it does not turn a remote HTTP MCP connection into a locally traced process.

Other commands

Command Use it for
mcp-behave lint manifest.json Static checks of a manifest or tool-definition JSON without starting a server.
mcp-behave scan-configs Find MCP servers in supported local client configuration files and inspect configuration risks.
mcp-behave audit-configs Discover configured servers and run audits against them. This actively launches and exercises targets.
mcp-behave inspect <command> View a correlated timeline of MCP messages and observed runtime events; can also inspect a prior output directory.
mcp-behave serve Expose mcp-behave's audit and inspection tools through an MCP server interface.
mcp-behave install / status / uninstall Add, inspect, or remove wrapper entries in supported local AI client configurations.
CI and machine-readable output

Use JSON or SARIF output for automation and code-scanning workflows:

uvx mcp-behave --json --fail-on high python -m my_mcp_server
uvx mcp-behave --sarif python -m my_mcp_server > mcp-behave.sarif

The default output directory is /tmp/mcp_behave_out. Set --out-dir to choose another location. Exit codes for an audit are 0 for no findings at or above the selected threshold, 3 when the threshold is met, 2 for a tracing/setup failure, and 1 for other errors.

Legacy single-server baseline workflow

The init and check commands maintain the earlier single-server mcp-behave.lock format:

uvx mcp-behave init python -m my_mcp_server
uvx mcp-behave check python -m my_mcp_server

This is separate from the multi-server mcp-behave.lock.json used by wrap. Keep the two lockfile formats distinct.

Runtime tracing and platform notes

  • Audit on macOS: uses a dynamic interposer via DYLD_INSERT_LIBRARIES when available. Hardened or specially signed targets can reject injection, which can cause launch failure.
  • Audit on Linux: automatic selection tries an LD_PRELOAD interposer first, then strace if installed. strace has its own coverage and permission requirements. With no eligible tracer, the local target is still exercised untraced. --no-trace explicitly selects that path when no container is active. Building a native interposer requires a C compiler.
  • Wrap on macOS and Linux: uses the platform's dynamic interposer and reports tracing status (active, partial, or disabled) in telemetry. It requires a handshake from the launched PID; if the launcher times out while descendants report ready, it emits a blind_spot alert and classifies tracing as partial (descendant_only). With a sandbox command, wrap attempts interposition on the launcher. A handshake or an active container status provides no evidence of tracing coverage inside the container.
  • Native Windows: ordinary audit tracer selection has no native Windows backend. Wrap tracing reports unsupported_os when enabled, and wrap --sandbox auto selects no backend. Explicit container use depends on a usable runtime and successful launch. Wrap also relies on asyncio stdio pipe integration, new sessions, and POSIX process-group signaling and cleanup, so the untraced path does not establish native Windows support.
Explicit tracer selection

--tracer auto (the default) selects the best available platform tracer. --tracer none or --no-trace explicitly requests untraced execution. Requesting an explicit unavailable backend (such as --tracer ebpf on macOS or unsupported Linux kernels, --tracer preload on macOS, or --tracer strace without strace installed) fails with exit code 2 before launching a local target. Remote audits (sse/streamable-http) and active container sandboxes (--sandbox) do not use host syscall tracers.

OS sandbox selection and defaults

Both audit and wrap default to --sandbox none.

  • Audit: --sandbox auto checks for responsive Podman first and then Docker. If neither responds, the audit can continue locally without a container. Explicit --sandbox docker or --sandbox podman uses that runtime name directly, so launch failures can surface. The initial banner labels the requested sandbox before availability is known. An active audit container bypasses host syscall tracing and records sandbox-<runtime> as the tracer label.
  • Wrap: --sandbox auto selects Seatbelt on macOS and a container on Linux. Explicit choices are seatbelt and container. For a selected backend, unavailability or an error preparing the command aborts under the default fail-closed mode. Under fail-open, those cases can launch the original command with sandbox status disabled. On unsupported platforms, auto prepares the original command with disabled sandbox status even under fail-closed. These rules govern preparation. A launch error or a failure after the wrapped command starts does not trigger an unsandboxed retry. Active sandbox telemetry describes the prepared command.
  • Container defaults: no networking, a read-only bind mount of the current working directory at /workspace, all capabilities dropped, and no new privileges. Audit can override the network mode. When supplied with an existing canary home directory, the command builder mounts it read-write at /canary_home and redirects home and configuration variables there. Audit supplies its temporary canary home by default. Wrap's container preparation does not supply one.
Seatbelt lockfile hints

Seatbelt starts with an allow-default profile. Wrap passes the selected server's lockfile entry to the profile generator even when protocol enforcement is off. With no matching entry or no tools, the profile adds neither write nor outbound restrictions.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases mcp-behave

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Frame 2085668439 (1)
Group 1261154229