Connect Claude Code in claude-sandbox#
Let Claude Code in claude-sandbox use a scrap running on the host, such as the one from “Try it” in the README on port 8000.
On the host, add this line to
~/.config/claude-sandbox.conf, keeping any lines already in it (details):local-port = 8000
If
~/.config/claude-sandbox.confdid not exist before, runclaude-sandbox --recreatein each project that already has a container.In the container (
claude-sandbox shell), add scrap:claude mcp add --transport http --scope user scrap http://localhost:8000/mcp claude mcp list
Install the
sccommands and the skills as in Connect a Claude Code session.
Remote scrap#
For a scrap on another machine, use allow-ip = <that machine's IP address> in
~/.config/claude-sandbox.conf instead of local-port (an IP address, not a hostname), then:
On that machine, make scrap listen beyond loopback (
--host 0.0.0.0, as in Try scrap on your LAN). An IP address is always accepted as aHost; to have page links in Claude’s replies use it, also addhttp://<IP address>:8000toSCRAP_PUBLIC_URLand restart scrap.Run
claude-sandbox --recreate.Add scrap with
http://<IP address>:8000/mcp.
Tokens and Cloudflare Access#
For a scrap that needs a bearer token or Cloudflare Access service-token headers, send them with a
headersHelper and an env file under ~/.config/terminal-config, which the jail already sees. See
If /mcp needs a token.