Skip to content

Releases

v0.7.1

Choose a tag to compare

@github-actions github-actions released this 08 Nov 09:32
v0.7.1

Stored hashes name their algorithm, and release tags are signed.

Changed

  • Tool fingerprints in pins, audit chain hashes and the hash of a call's arguments are stored with
    the name of their algorithm, as sha256:<hex>, so the algorithm can change without a new store
    format. Pins and audit logs written by 0.7.0 and earlier, with bare SHA-256 hex, still check. A pin
    written by this version looks changed to 0.7.0, which then asks for the tools to be approved again.
  • The release tag is signed with the maintainer's SSH key, and GitHub shows it as Verified. Tags up
    to v0.7.0 are not signed.

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 07 Nov 11:49

Python servers. A server started with uvx from PyPI is caged as an npx one is: resolved into a
lock with every package's hash, then installed from wheels only, so no package's code runs while
its image is built, on your machine or in Docker.

Security

  • Windows: mcpcage looked at paths a configuration entry names before deciding anything about it:
    its envFile, its command (and the node and cli.js of a caged entry), the directories of its
    PATH, its mount and argument paths, the .git file in a mounted folder. Windows opens a
    \\host\share or //host/share path by connecting to that host over SMB, and authenticates with
    the credentials of your session (NTLM). So an entry in a cloned repository's .vscode/mcp.json,
    or one written by any program, handed its author's host your NTLM response as soon as
    mcpcage protect read it: on a Windows 10 PC, looking at an envFile or a command on a share
    opened TCP connections to port 445 of the machine that served it. mcpcage now tells such a path
    by its text alone, after the variables it fills in (any path that starts with two slashes or
    backslashes, in any mix: \\server\share, //server/share, \\?\UNC\..., \\.\...), and never
    looks at it: the entry is not counted as caged, wrap and --fix leave it as it is ("one of its
    args is a network path, which mcpcage does not open"), and run refuses such a mount. The uv
    settings that 0.7.0 reads for uvx entries follow the same rule: an APPDATA, USERPROFILE,
    PROGRAMDATA, SYSTEMDRIVE or UV_CONFIG_FILE that points at a share, or at a host without a
    share (\\host), stops the cage instead of being read ("its env sets APPDATA to a network path,
    which mcpcage does not open, ..."). Your own AppData folder, where Windows' folder redirection
    puts it on a share, is still read, as every program of your session reads it. On macOS a path
    under /net/<host> is left alone the same way: where the automounter's -hosts map is turned on
    (it is not by default), looking there mounts that host over NFS. A symlink or a junction on a
    local disk that points at a share is not seen by a test of the text. Every published version up
    to 0.6.4 is affected. Advisory:
    GHSA-ghcm-rm79-6w6g.

Added

  • uvx servers. run, prepare, wrap, protect --fix and protect --inspect take a server
    started with uvx <package>, uvx --from <package> <command>, uv tool run or uv tool uvx,
    uvx by its full path, and on Windows a plain cmd /c uvx ... (kept after --, so that unwrap
    gives the entry back as it was, as for cmd /c npx). The package is a name with optional extras
    and versions; pkg@1.2 is pkg==1.2, and pkg@latest takes the newest release. --with,
    --python (3.10 to 3.15), --prerelease and --exclude-newer are read, and so are UV_PYTHON,
    UV_PRERELEASE and UV_EXCLUDE_NEWER; flags that only tune uv's cache, output or interpreter
    lookup on the host are ignored. A plain date given to --exclude-newer is the next midnight in
    your time zone, as uv reads it on the host. A server's id leaves out its version, extras, --with
    and --python, so an upgrade is compared with the tools you approved. run --no-sandbox still
    starts a uv line on the host as written, under the id it had. See
    Python servers.
  • How a uvx server is built. The resolve runs uv pip compile --no-build in a container of uv's
    image, pinned by digest, hardened as the cage is but with the network on for PyPI, with no host
    file and none of the entry's variables. It pins the server's own release first, so that a
    dependency without a wheel cannot move it back to an old release (dbt-mcp 2.10.1 became 0.2.1
    so), then locks every package with its sha256 hashes. The image is built from that lock with
    uv pip sync --require-hashes --no-build on a distroless base, with no shell and no pip, and runs
    as 65532. Python is 3.13 unless the line asks for another, raised to 3.14 or 3.15 when the newest
    release needs it, with a line saying so ("Python 3.14 for windows-mcp 0.8.8, which needs it (on
    Python 3.13 it would be 0.8.5)"). The lock is reused until --rebuild, or a change in what
    decides the install, so @latest stays at the release of the first build; a lock kept in the
    store is checked again before each build as a fresh one is.
  • What is refused, with the reason, naming a flag or a variable and never its value: a server
    whose packages are not all on PyPI as wheels ("dbt-mcp cannot be installed from PyPI wheels on
    Python 3.13 for Linux on ARM (linux/arm64), and the cage never builds a package from source:" and
    uv's reason); a git, URL or path source, --with-editable, --with-requirements; another index
    (--index-url, UV_INDEX_URL...); a file on your machine (--constraints, --env-file, an
    entry's UV_CONFIG_FILE...); a build from source or for another platform (--no-binary,
    --python-platform...); a package that uvx reads as a Python interpreter to start (python3.13,
    pypy, pyodide); and uv settings, yours, the system's or those an entry's variables point uvx
    to (uv.toml under ~/.config/uv, /etc/xdg/uv, /etc/uv, %APPDATA%\uv, %PROGRAMDATA%\uv,
    or the file UV_CONFIG_FILE names), that name an index or change what uvx installs
    (resolution, prerelease, exclude-newer, dependency-metadata, no-binary,
    allow-insecure-host...): "your uv settings (~/.config/uv/uv.toml) name a package index, and the
    cage builds from PyPI only".
  • wrap and protect --fix resolve each uvx server before they write its entry. One that uv finds
    no solution for is left as it is, with uv's reason; one whose resolve fails for another reason
    (Docker stopped, no network) is written with a note, and resolved at its first start. Nothing is
    kept in mcpcage's store until you answer yes, and the image is built from the lock the plan made.
    --no-build skips the resolve and says so.
  • protect --inspect starts uvx servers in the cage, and names a package that ships no wheel
    ("builds from source: uuid 1.30 ships no wheel (uvx runs its build code with your permissions when
    it installs it); mcpcage installs wheels only"), counted in its own summary line.
  • prepare prints the Python and the wheels' platform ("python 3.13.18, wheels for
    aarch64-manylinux_2_40"), and run writes the package, its version, the Python, the platform and
    the uv release into the audit log's sandbox entry.
  • doctor prints the four PyPI base images with their digests, after the npm ones.
  • The first resolve on a machine says that it is pulling uv's image, once, instead of waiting
    without a word.
  • Compatibility: the 39 Python MCP servers started with uvx that PyPI
    counts the most downloads for, run through the cage on macOS and Linux, 9 of them on Windows. On
    the Mac 26 work with the defaults, 3 need --allow-net, 6 fail (outside mcpcage too, or because
    they check dummy keys against their service), and 4 are refused for a package without a wheel;
    on Linux, 27 work, since one of the 4 has its wheel for x86_64 only. npm run compat -- --runner uvx runs them, and the weekly workflow runs all 63 servers.
  • Property-based tests of the uvx line reader, the uv settings scan, the lock check, network paths
    on Windows, the lines to paste into claude mcp add (run through /bin/sh) and the build output.
    Mutation scores of the files 0.7 added or changed the most: pypi.ts 92.5%, uv-settings.ts
    92.6%, network-path.ts 100%, windows-places.ts 87.0%, terminal.ts 85.9%, and 71% for the
    uvx parts of protect.ts, whose report wording the CLI tests check from a process Stryker cannot
    see.

Changed

  • protect reports a uvx entry (uvx, uv tool run, uv tool uvx, cmd /c uvx) as NOT CAGED,
    with what it asks PyPI for ("asks PyPI for: mcp-server-time") or why it cannot be caged, and
    --fix cages it. 0.6 said "uvx, not supported yet" and counted it with the remote and
    containerized servers. So the exit code counts uvx entries: protect exits 1 on a machine with
    an uncaged uvx server, where 0.6 exited 0, and protect --fix exits 1 when one it could not cage
    is left. A script that gates on protect may change result.
  • Any other program is reported as ", not npx or uvx: cannot be caged yet".

Fixed

  • protect called caged an entry whose line after -- mcpcage run refuses at every start: a
    program that is neither npx nor uvx (run -- node server.js), run -- npx -p x y, a bare
    mcpcage run. Such an entry is now "cannot start:" with run's reason, is not counted as caged,
    the summary counts it ("N cannot start: mcpcage run refuses its command line, for the reason
    shown above."), and --fix leaves it with the reason.
  • macOS: an entry that starts NPX (or UVX) in another case was "another command", so
    protect exited 0 and --fix had nothing to change, though APFS finds npx by that name and
    the server ran on the host. npx and uvx are now compared without case on macOS, as on Windows.
  • The lines protect --fix prints to paste into claude mcp add, while Claude Code is running,
    were the report's command column: an argument holding $(id) and backquotes was printed as it is,
    and pasted into a shell it ran id. Each word is now quoted for the shell (POSIX single quotes on
    macOS and Linux; double quotes on Windows, for PowerShell and cmd). A server with a word that no
    quoting gives back unchanged, or that the terminal would show otherwise (a line break, an
    invisible or bidi character), gets "close Claude Code and run mcpcage protect --fix again" in
    place of a line.
  • What docker build and docker pull printed went straight to the terminal: the classic builder
    wraps a step's stderr in color codes, and a package'...
Read more

v0.6.4

Choose a tag to compare

@github-actions github-actions released this 05 Nov 20:39

Full Changelog: v0.6.3...v0.6.4

v0.6.3

Choose a tag to compare

@github-actions github-actions released this 05 Nov 12:49

Changed

  • Releases are published to npm by trusted publishing: the release workflow trades its GitHub
    Actions OIDC token for a short-lived npm one, so no npm token is stored in the repository or
    anywhere else. The package keeps its provenance, its CycloneDX SBOM and its signed build
    attestation. The release job runs on Node 24, whose npm supports it.
  • Development only: Stryker, which runs the mutation tests, is given minimatch and qs versions
    without known vulnerabilities, through scoped npm overrides. Nothing changes for whoever installs
    mcpcage, which still has no runtime dependencies.

v0.6.2

Choose a tag to compare

@github-actions github-actions released this 05 Nov 09:57

A round of testing aimed at trust: a fourth review of the Windows code, the 24 most downloaded
MCP servers run in the cage, property-based tests of everything that reads untrusted input, and
mutation testing.

Security

  • A server could slip a new tool past the pin by listing one malformed entry with it: a
    tools/list answer such as [{"name":"read_file"}, {"name":"send_keys", ...}, {"name":null}]
    reached the client whole, the new tool neither pinned nor compared with the pin, with no block.
    mcpcage compared a listing with the pin only when every entry was a tool definition. Such an
    answer is now refused whole: the client gets an error, nothing is pinned, the session is locked,
    and the audit log records list-blocked with reason not-tools. Every published version up to
    0.6.1 is affected.
  • A tools/call sent without an id (a JSON-RPC notification) skipped the call filter and the
    audit log, so a call to a tool nobody approved reached the server. Every tools/call is now
    filtered; a refused one without an id gets no answer, as JSON-RPC requires, and is recorded as
    call-blocked.
  • A tools/call whose tool name is not a string was looked up as "": with a tool named ""
    approved, every such call passed. It is now refused.
  • A tools/call whose arguments were nested a few thousand levels deep stopped mcpcage with a
    stack overflow before it answered. Arguments nested more than 256 levels deep are now refused.
  • Windows: an entry's env could make docker start another program on the host while protect
    counted the entry as caged: ProgramData (or another of Windows' place variables) naming a folder
    with a docker-buildx.exe of its own, GODEBUG, or, when a client leaves those variables out, a
    project folder holding Docker plugins. mcpcage now moves Windows' place variables and GODEBUG
    from an entry's env into the cage, and gives docker and npm the places Windows itself reports
    (the registry, the account's home, SystemRoot), not the ones it was started with.
  • Windows: an env that sets one variable twice in two cases (Path and PATH) is counted as not
    caged. Windows keeps only one of them, and which one depends on the client.
  • Windows: an entry that starts mcpcage through mcpcage.cmd with arguments that cmd.exe reads
    again (a quote, &, |, ...) is counted as not caged: cmd runs them as commands before mcpcage
    starts (CVE-2024-27980). --fix rewrites it as node with mcpcage's cli.js.
  • macOS and Linux: a writable mount whose path has .. after a symlink
    (/x/link/../proj:rw) got no read-only .git, and a server in the cage could write
    .git/config on the host, which git then runs. mcpcage looked through the directory the system
    finds (the .. taken from where the symlink leads) while Docker mounted the one the path spells.
    A mount's path is now read as Docker reads it before mcpcage checks and looks through it. Affects
    0.5.0 to 0.6.1.

Fixed

  • A new server, or --rebuild, could get an old version of its package from Docker's build cache
    instead of npm's latest: a build that resolves a package now runs without the cache.
  • npx -s and npx --silent are accepted, as @modelcontextprotocol/server-pdf's README writes
    them; 0.6.1 refused them as an unsupported flag.
  • wrap and --fix leave as it is an entry whose env names a variable with = in it (the cage
    would read a different value), and write a variable whose name starts with a dash as
    --env=NAME, which run used to refuse at every start.
  • Windows: a --mount of \\, // or \\. alone is refused as written. It was resolved to C:\
    and, with --allow-sensitive-mount, mounted the whole drive, while protect said the entry
    could not start.

Added

  • Compatibility: the 24 MCP servers started with npx that npm counts the
    most downloads for, run through the cage on macOS and Windows: 22 work with the defaults, 2 need
    --allow-net. npm run compat runs it, and a weekly workflow runs it on Linux.
  • Property-based tests (fast-check) of the proxy, the pin, wrap and unwrap, the places never
    mounted and Windows' paths, with a far longer run every week on Linux and Windows. They
    found the first four security items above, and the env and \\ fixes.
  • Mutation testing (Stryker, npm run mutation), weekly: the tests notice 88% of the changes made
    to the code that decides what is safe.
  • The OpenSSF Scorecard runs on every push to main and weekly, with its badge in the README. Each
    GitHub release carries the signed build provenance (.sigstore.json).

Changed

  • The README and the threat model say that the read-only settings in a writable mount are looked
    for at any depth except inside node_modules, and why.

v0.6.1

Choose a tag to compare

@github-actions github-actions released this 04 Nov 20:49

Fixed

  • protect --fix and wrap run through pnpm dlx, yarn dlx or bunx wrote the runner's copy of
    mcpcage into configurations (on Windows its cli.js, for pnpm the one in its store), which the
    runner deletes or replaces (yarn as soon as mcpcage exits): every caged server then stopped
    starting. 0.6.0 refused only npx's. They now refuse any mcpcage in a temporary place, the system's
    temporary directory, npm's _npx or pnpm's dlx cache, an explicit --command included, and say
    to install mcpcage (npm install -g mcpcage) or to pass --command. protect without --fix
    still works from any of them.
  • npx mcpcage protect said of an entry caged by the installed mcpcage that it starts "not the
    mcpcage on your PATH" (on Windows "not mcpcage's cli.js and your node") and counted it as running
    uncaged, and --fix refused though mcpcage was installed; pnpm dlx and bunx likewise. The
    runner puts its own directories first on the PATH it gives mcpcage, which took them for yours.
    Run from a temporary place, mcpcage leaves out of your PATH the directories in a temporary place,
    every node_modules/.bin and npm's node-gyp-bin, finds the installed mcpcage past them (on
    Windows the cli.js npm installs next to its mcpcage.cmd), counts what it caged as caged, and
    --fix writes it. An entry whose PATH names one of those directories is no longer taken for
    one on yours, and a look-alike mcpcage in a project's node_modules/.bin is never taken for the
    installed one.

v0.6.0

Choose a tag to compare

@github-actions github-actions released this 04 Nov 19:42

Windows. Run on a Windows 10 PC for the first time, the unit suite gave 62 failed, 254 passed, and
mcpcage run stopped before a server given a folder could start. mcpcage now runs there with
Docker Desktop's Linux containers, tested with Node 24, and a CI job runs the typecheck and the unit
tests on Windows. Every Windows change below was found on that PC.

Added

  • Windows: a folder is mounted in the cage at /c/... (C:\Users\me\notes at
    /c/Users/me/notes, spelled as Windows keeps it on disk), and the server is given that path for
    each argument that names a mounted folder or a path inside one. run prints where each folder is
    in the cage. Tool calls are not translated: the model has to use the paths the server lists.
  • Windows: an entry that starts cmd /c npx ... counts as npx, and wrap and --fix cage it,
    keeping cmd /c after -- so that unwrap gives it back as it was; mcpcage never starts cmd
    for it. One whose line holds more than npx and its arguments is reported as not a plain npx
    command line and left as it is.
  • Windows: Claude Desktop installed from its MSIX package keeps its configuration under
    %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude. protect reads it, and
    that directory is never mounted (see Security).
  • A banner with mcpcage's name, version and tagline at the start of mcpcage, help, doctor and
    protect, only when stdout is a terminal; only the version line in one narrower than 62 columns.
    Never for any other command, and never when the output is piped or redirected.

Changed

  • Windows: protect --fix and wrap write the node that runs mcpcage (node.exe) with mcpcage's
    cli.js, by their full paths, instead of npm's mcpcage.cmd: Node refuses a plain spawn of a
    .cmd since the fix of CVE-2024-27980 (EINVAL), so a client that starts servers that way could
    not start what 0.5.0 wrote. protect says of an entry caged with mcpcage.cmd (or .bat) that
    some clients cannot start it, counts it on a line of its own, and --fix gives it node.exe with
    cli.js, its options kept.
  • Windows: a bare mcpcage in an entry never counts as mcpcage, since Windows looks for a bare name
    in the client's current directory first: protect counts it as running uncaged, --fix rewrites
    it, and a bare --command is refused.
  • Windows: a writable mount that holds any of git's or the editors' settings, a directory as well
    as a file, refuses to start, and so does a read-only mount given inside a writable one (see
    Security).
  • The install scripts lookup (npm view) runs the npm that packs a local package, on every system:
    next to the node that runs mcpcage, then the standard places, with a PATH of those places, instead
    of the first npm on the PATH.

Fixed

Windows

  • run --no-sandbox could not start npx ("spawn npx ENOENT"). It starts npm's npx-cli.js with the
    node that runs mcpcage, never through a shell, and refuses any other batch file as the host
    command, saying what to give instead.
  • The install scripts lookup started npm.cmd through cmd.exe with the package spec on its command
    line, and Node 24 printed a DEP0190 warning in the report; a spec with " or % was refused.
  • NPX.CMD, npx.CMD or C:\NODEJS\NPX.CMD was "not npx": the server ran uncaged and was not
    counted. npx, uvx, docker and mcpcage are compared without case.
  • A local package given as .\x, ..\x, C:\x or \x was looked up on the registry by that name.
  • protect --fix rewrote ~/.claude.json while Claude Code was running: a running claude.exe is
    now found with tasklist.exe, as Claude Code is with ps on macOS and Linux.
  • A network share or a device path (\\server\share, \\?\...) given to a server was mounted by
    wrap and --fix, and the entry never started, while protect called it caged. Such a server is
    left as it is with the reason, a caged entry that mounts one is said not to start, and
    protect --inspect inspects the server without it.
  • protect --inspect mounted a folder named in another case than on disk at another place than
    run does, so the inspected server listed other paths than the caged one.
  • A directory of your PATH spelled with 8.3 short names (C:\PROGRA~1) in one place and long names
    in the other counted as another directory, and the same mcpcage spelled in another case
    (mcpcage.CMD) as another file: paths are compared as the system spells them on disk.
  • A mcpcage.bat was "another command", not counted as uncaged whatever it ran. It is read as a
    mcpcage.cmd is.

Everywhere

  • npx mcpcage protect --fix wrote the mcpcage of npx's own cache into configurations (on Windows
    its cli.js), which npm cache npx rm deletes and a later npx replaces: once it was gone, every
    caged server stopped starting. --fix and wrap refuse to write a command from npx's cache, an
    explicit --command included, and say to install mcpcage (npm install -g mcpcage) or to pass
    --command. protect without --fix still works from npx.

Security

  • Windows: a program in the current directory ran in place of docker or npm. doctor ran a
    project's docker.exe, prepare its npm.exe, since Windows looks for a bare name there first,
    whatever the PATH. docker and npm are never started by a bare name there.
  • Windows: protect --fix run in a directory that held a mcpcage.cmd wrote that file into the
    user's configurations, since where looked in the current directory first; the clients then
    started it on the host. --fix no longer runs where, on any system: mcpcage is looked up in the
    absolute directories of the PATH only.
  • Windows: Docker Desktop lets a server in a writable folder reach a read-only folder inside it under
    another case of its name. Through the cage, a server wrote .GIT/config around a read-only .git
    and changed the repository's .git\config on the host, from which git runs commands. mcpcage now
    puts no read-only mount inside a writable one there (see Changed).
  • Windows: the repository a .git file names by an absolute path, as git writes it on Windows, or
    by 8.3 short names was not found, and stayed writable inside a writable mount: a server could
    change its configuration and hooks.
  • Windows: Claude Desktop's MSIX configuration directory was an ordinary path for run and wrap:
    mounted, it gave a server the other servers' tokens, and with :rw a place to add an uncaged
    server of its own. It is refused as a mount like %APPDATA%\Claude, and an entry's env that sets
    LOCALAPPDATA counts as moving the client configurations, as APPDATA does.

mcpcage 0.5.0

Choose a tag to compare

@github-actions github-actions released this 04 Nov 13:42

Hardening, second round. Independent reviews tried to break 0.4.0 from both sides: a server
talking to the proxy or writing in its mounts, and a client configuration entry that nobody meant
to write. Two more reviews then tried to break the fixes. Every change below closes something one
of them found.

Changed

  • wrap and protect --fix mount the paths a server is configured with read-only. Three review
    rounds each found another way for a server with a writable mount of a project to have the host
    run code (git hooks and configuration, editor settings, .env files a client loads), and no list
    of names to protect can be complete. --writable keeps the previous behavior, with a warning for
    each writable mount, and protect reports a writable mount as an opened cage.
  • On macOS and Windows, a writable mount that holds a file setting (a .git file, .mcp.json)
    refuses to start: the server could rewrite it under another case of its name. An entry that
    0.4.0 caged with such a mount starts again once its :rw is dropped.
  • mcpcage runs docker from the standard install places and npm from next to the node running it,
    each with a PATH of those places only, instead of the PATH a client was given.
  • protect exits 1 when it could not check a configuration file, as it does for an uncaged server.
  • The server's stderr reaches the client's log line by line, prefixed with [<server-id>].
  • wrap and protect --fix move some variables of an entry's env into the cage as
    --env NAME=value arguments (see Fixed), so their values show in the process list while the
    server runs; unwrap puts them back in env.
  • Many more paths are never mounted (see Fixed): wrap and --fix may leave uncaged a server that
    0.4.0 caged, with the reason, and run refuses its --mount without --allow-sensitive-mount.
  • Inside a writable mount, existing git and editor settings are mounted read-only and the
    directories that lead to them are held in place: a server can no longer rename those directories,
    and moving a file across them fails (EXDEV).
  • protect counts an entry as caged only when it starts the mcpcage on your PATH (or the one that
    runs the report), and says when an entry's run options, its own PATH (any directory that is not
    on yours), its envFile, or a writable mount open the cage. wrap and --fix check the entry
    they write with the same rules and leave one that would not count as caged as it is.
  • mcpcage run refuses a --memory or --cpus that is not positive, and a server id with other
    characters than letters, digits, dots, dashes and underscores.
  • A definition approved by an earlier version with a "__proto__" key counts as changed once and
    needs a fresh approval, and an audit entry an earlier version wrote with such a key no longer
    verifies.

Fixed

The proxy and the pin

  • Names that every JavaScript object inherits fooled the pinning: what a definition held under a
    "__proto__" key was left out of its fingerprint, so hidden text added there passed as no change,
    and a tools/call for constructor, toString or __proto__ reached the server although no tool
    of that name was approved. Every key now counts, and a call passes only for a tool approved under
    its own name.
  • Trust on first use reached past the first listing: a server that had the client list again, or
    answered a cursor it never issued, replaced approved definitions. Only the first listing is trusted
    now, its first page and the pages asked for with the cursor each page returned, and none of them
    may redefine a tool pinned before.
  • The limit of 10,000 tools held for one page only. It now holds for what is pinned and pending
    together, across pages, listings and approvals.
  • Text a server controls reached the terminal raw: escape sequences in a tool's name could clear or
    rewrite what mcpcage diff shows before approval, and the server's stderr could print lines that
    read like mcpcage's own. Everything mcpcage prints from a server or a configuration spells out
    control and format characters as [U+XXXX], long names and keys show a 200-character excerpt
    with their length, and the new-tool view shows every field the user approves.
  • With a client that does not read mcpcage's stderr, log lines piled up in memory, and one long
    message went through whole. At most 1 MiB now waits; a message that does not fit is cut with its
    length or dropped, and the dropped lines are counted.
  • The signs of hidden instructions missed the keys of a definition, anything but a plain URI or
    JSON pointer under $schema, $id and $ref, and the address, name, title and description of a
    resource_link or an embedded resource in a result.

The cage and its mounts

  • wrap, protect --fix and run --mount reached places from which the machine later runs
    commands: other clients' MCP configurations (also where XDG_CONFIG_HOME, COPILOT_HOME or APPDATA
    move them), shell and login startup files, git's configuration and any repository's .git,
    project editor and agent settings, the programs on the PATH and where they are installed, and
    more Docker sockets. They are never mounted now, and the report names them.
  • A writable mount of a project let a caged server change the project's .git and editor
    settings, from which git and editors run commands on the host as soon as the project is open, or
    rename the directory holding them and write new ones in its place, or change the repository a
    .git file points to. Existing settings are now mounted read-only, the directories leading to
    them are held in place, and a repository a .git file or commondir points to is followed and kept
    read-only; anything that cannot be kept so refuses the start.
  • A server entry's env configured mcpcage itself once wrap or --fix routed it through mcpcage:
    NODE_OPTIONS or OPENSSL_CONF ran code on the host before the cage existed, DOCKER_HOST sent the cage
    to another daemon, a HOME pointed elsewhere turned the real ~/.ssh into an ordinary path, and
    MCPCAGE_HOME moved the pins to an empty store. NODE_* (except NODE_ENV), LD_*, DYLD_*,
    DOCKER_* (except a local-socket DOCKER_HOST), OPENSSL_*, GCONV_PATH, npm_config_* and
    the shell's BASH_ENV, SHELLOPTS, BASHOPTS, PS4, ZDOTDIR and BASH_FUNC_* now move into
    the cage as --env NAME=value; HOME, USERPROFILE and MCPCAGE_HOME are dropped; the mount
    check counts the account's own home whatever HOME says; a relative MCPCAGE_HOME is made absolute.
  • protect --inspect read a path argument ending in :rw as a mount option, so a directory named
    ~/.ssh:rw got the real ~/.ssh mounted writable, and it mounted sensitive paths for the listing.
    It now mounts each path argument read-only as written, never one that wrap refuses, and names in
    the report what a server was inspected without.
  • An entry's PATH chose the docker mcpcage runs, the credential helpers docker runs and the npm
    that packs a local package, and a VS Code envFile could set any of the variables above unseen.
    docker and npm now come from trusted places, an entry's PATH counts only when it stays within
    yours, and protect reads an envFile like env.
  • When a package declares several programs, the launcher in the image ran the first one where npx
    refuses to choose; it now chooses as npx does.
  • run --id and the id given to diff, approve, audit show and audit verify were used as
    given, so ../../x read and wrote outside mcpcage's store.

The report of mcpcage protect

  • protect said "caged" for any command named mcpcage, a look-alike or one next to a package.json
    that claims the name included, for entries whose run options open the cage, and for entries whose
    own PATH makes the client start another node. An entry now counts as caged only when its
    command is the same file as the mcpcage --fix writes or the one running the report; a
    look-alike is caged by --fix and by wrap; opened cages and a PATH that picks other programs
    are named, one line each, and not counted as caged.
  • One malformed entry or file stopped the whole report: an argument that is not a string, a value
    nested thousands of levels deep, a FIFO in a configuration's place or an npm view answer of an
    unexpected shape. Each now becomes a line of the report and the scan goes on; a file over 16 MiB
    is reported without being read.
  • The report printed credentials it promises to keep out: the second value of a repeated query
    name, a SAS signature or an Azure Functions key, a real key containing xxx or changeme, an
    address behind --url=, a token used as the user name of an address, and values a server copied
    into its tools during --inspect, whole, cut up, spliced with invisible characters or printed on
    several lines. All are masked now.
  • protect missed VS Code configurations under XDG_CONFIG_HOME on Linux and in named profiles.

wrap, unwrap and --inspect

  • wrap and unwrap wrote the configuration straight over the live file, stopped at one malformed
    entry, and dropped an env variable named __proto__. They now replace the file atomically, leave a
    malformed entry as it is with the reason, and keep every variable.
  • protect --inspect queued without bound the answers and requests for a server that does not
    read its input, and accepted a listing of any size over its pages. Nothing is added while 16 MiB
    wait to be sent, and a listing over 16 MiB in total is refused.

mcpcage 0.4.0

Choose a tag to compare

@github-actions github-actions released this 04 Nov 00:17

Hardening. Every change below came out of trying to break mcpcage: hostile servers against the
proxy, abuse inside the cage, mounts that undo it, and a first CodeQL scan.

Added

  • mcpcage run --allow-sensitive-mount and --allow-server-requests, each printing a warning when
    used.
  • The proxy reads every tools/call result with the hidden-instruction rules that make sense on free
    text, records the signs in the audit log (result-signs) and prints the high-severity ones. Results
    always pass unchanged.
  • Docker tests that abuse the cage: writes outside the mounts, a file run from /tmp, a fork bomb,
    a memory bomb, the environment, the capabilities, the absence of a Docker socket, DNS and TCP
    without and with --allow-net.
  • CodeQL on every change and every Monday; secret scanning with push protection and Dependabot
    security updates on the repository.

Changed

  • mcpcage wrap and protect --fix no longer cage a server that needs the whole disk, the home
    directory or its parents, the system configuration, a Docker socket, a directory with credentials
    (.ssh, .aws, .gnupg, .kube, .docker, gcloud, .azure, .npmrc, .netrc,
    .git-credentials, .password-store, the keychains, Colima's and OrbStack's sockets,
    .claude.json) or mcpcage's own pins and audit logs: the entry is left as it is, with the reason.
    run --mount refuses such a path unless --allow-sensitive-mount is given; protect names it.
    A server that 0.3.0 caged with such a mount is refused at its next start, with a message that says
    what to do.
  • The proxy reads the server's output with a bounded splitter: a line over 16 MiB is dropped and
    counted (oversize-line), output that is not JSON-RPC is dropped (stdout-noise), a response to
    an id the client is not waiting for is dropped (unsolicited-response), and an id must come back
    with the type the client sent.
  • Requests from the server to the client: ping and roots/list pass; sampling/createMessage,
    elicitation/create and any other method are refused with error -32001 unless
    --allow-server-requests is given (server-request-blocked).
  • A tools/list with more than 10,000 tools, or with a definition nested more than 256 levels
    deep, is refused whole: the client gets an error, nothing is pinned, the session is locked.
    diff and approve refuse such a pending file; protect --inspect reports such a server as
    refused and reads servers with the same limits.
  • The hidden-instruction rules read a text in windows of 1 MiB, at most 100 matches per rule per
    window, and at most 20,000 strings or 32 Mi characters per definition or result; a scan-budget
    sign stands for the rest.
  • Nothing a server sends that is nested more than 256 levels deep is serialized again or walked:
    a tool result like that passes unchanged, unmeasured (call-result records no size) and with a
    scan-budget sign; an answer nobody asked for or a batch message like that is dropped
    (deep-message); a pin or pending entry like that, written by an older version, is left out and
    the tool counts as new. The inspect client answers a server's requests only when their id is a
    string or a number.
  • The cage gets no swap: --memory-swap equals --memory. Before, Docker allowed as much swap
    again on a host that has some, and the limit doubled.

Fixed

  • The proxy crashed with EPIPE when the server exited while the client was still writing, when the
    client went away while the proxy wrote to it, or when the log pipe closed. It now ends cleanly
    with the server's exit code.
  • A client that reads slower than the server writes no longer lets the server's output pile up in
    memory, and answers to a server that does not read its input are capped.
  • The hidden-instruction rules could crash or stall on texts of millions of characters or strings
    and on definitions nested thousands of levels deep.
  • Backups of configuration files are created with an exclusive write, wrap reads the file instead
    of checking for it first, and the demo's probe server writes a file with a random name (the three
    findings of the first CodeQL scan).

Full Changelog: v0.3.0...v0.4.0

mcpcage 0.3.0

Choose a tag to compare

@github-actions github-actions released this 03 Nov 19:53

Added

  • Devin: mcpcage protect finds its MCP configuration files, ~/.config/devin/mcp_config.json
    (%APPDATA%\devin\mcp_config.json on Windows), <project>/.devin/mcp_config.json and
    <project>/.devin/mcp_config.local.json, and reports their servers; --fix routes their npx
    servers through mcpcage, with a backup, as it does for Cursor, and mcpcage wrap takes these
    files too. The Windsurf files of older installs are still read.

Changed

  • mcpcage protect lists the clients of the files it did not find on their own line, under the
    count, so the report stays readable in narrow terminals.

Full Changelog: v0.2.1...v0.3.0