Skip to main content
Glama

πŸ”¨ anvil

A throwaway Docker sandbox for agents.

Run code or shell commands in a resource-limited, network-isolated, single-use container and get back a structured result β€” stdout, stderr, exit_code, timed_out, duration_ms. So an agent can verify its work, reproduce a bug, or check output without ever touching the host.

Part of tools-for-agents. Zero npm dependencies β€” drives the docker CLI directly.


Safe by default

Every run is launched with:

  • --network none β€” no network unless you opt in (network: "on")

  • --memory 512m --cpus 1 --pids-limit 512 β€” bounded resources

  • --cap-drop ALL --security-opt no-new-privileges β€” minimal privileges

  • --rm ephemeral container, work dir is a fresh temp mount, removed after

  • a hard timeout (default 30s, max 300s) that docker kills the container

  • optional secure: true β†’ read-only rootfs + tmpfs /tmp

Related MCP server: PRIMS – Python Runtime Interpreter MCP Server

CLI

node src/cli.js check                          # docker version + presets
node src/cli.js run python 'print(2**10)'      # β†’ 1024
node src/cli.js run node 'console.log(6*7)'    # β†’ 42
echo 'print("hi")' | node src/cli.js run python -
node src/cli.js sh 'apk info 2>/dev/null | head'

MCP server (for agents)

{
  "mcpServers": {
    "anvil": { "command": "node", "args": ["/abs/path/to/anvil/mcp/mcp-server.js"] }
  }
}

Tools

Tool

Use it to…

anvil_run_code

Run a bash / node / python snippet, get structured output.

anvil_run_command

Run a shell command with supplied files and/or a host dir mounted read-only at /repo (e.g. run a test suite).

anvil_check

Docker availability + language presets.

Example: verify a repo's syntax without copying it

{ "name": "anvil_run_command",
  "arguments": { "image": "node:22-alpine", "mount": "/path/to/repo/src",
                 "cmd": "node --check /repo/core.js && echo OK" } }

Result shape

{ "ok": true, "exit_code": 0, "timed_out": false, "duration_ms": 178,
  "image": "python:3.12-alpine", "stdout": "...", "stderr": "" }

The agent toolkit

anvil is the execute/verify leg of the tools-for-agents toolkit:

  • πŸ›°οΈ agent-hq β€” coordinate (memory, kanban, dashboard)

  • πŸ”Ž lens β€” read efficiently (token-budgeted retrieval)

  • πŸ”¨ anvil β€” run safely (sandboxed execution)

MIT licensed.

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tools-for-agents/anvil'

If you have feedback or need assistance with the MCP directory API, please join our Discord server