Connect Claude Code in claude-sandbox#

Let Claude Code in claude-sandbox use scrap.

scrap on Kubernetes or at DLS#

For scrap installed as in Install scrap on Kubernetes or Install scrap at DLS, scrap is at an HTTPS name, so claude-sandbox.conf needs no local-port or allow-ip line. Add scrap’s address as in Connect a Claude Code session, with a headersHelper and an env file under ~/.config/terminal-config, which the jail already sees (see If /mcp needs a token).

The DLS installer, run on the host, puts the token in that env file (SCRAP_DLS_MCP_TOKEN), and the helper and a connect script in ~/.config/terminal-config/.claude, the containers’ ~/.claude. In any container, run sh /user-terminal-config/.claude/scrap-dls-connect.sh once to add the server as scrap-dls, as in Claude Code.

Then install the sc commands and the skills as in Connect a Claude Code session.

scrap on the host#

For a scrap running on the host, such as the one from “Try it” in the README on port 8000:

  1. On the host, add this line to ~/.config/claude-sandbox.conf, keeping any lines already in it (details):

    local-port = 8000
    
  2. If ~/.config/claude-sandbox.conf did not exist before, run claude-sandbox --recreate in each project that already has a container.

  3. In the container (claude-sandbox shell), add scrap:

    claude mcp add --transport http --scope user scrap http://localhost:8000/mcp
    claude mcp list
    
  4. Install the sc commands and the skills as in Connect a Claude Code session.

scrap on another machine on your LAN#

For a trial on your LAN (Try scrap on your LAN), use allow-ip = <that machine's IP address> in ~/.config/claude-sandbox.conf instead of local-port (an IP address, not a hostname), then:

  1. On that machine, make scrap listen beyond loopback (--host 0.0.0.0, as in Try scrap on your LAN), add http://<IP address>:8000 to SCRAP_PUBLIC_URL (/mcp answers only loopback and the addresses listed there) and restart scrap.

  2. Run claude-sandbox --recreate.

  3. 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.