Skip to content

Stdio MCP servers can't be spawned directly under the base image's Deno sandbox #44

Description

@RatulMaharaj

The base image's entrypoint pins the Deno sandbox to --allow-run=bash, but a stdio MCP server (tools.mcp[].command) is spawned directly by StdioClientTransport. Inside the container, any command other than bash is denied by Deno before the server ever starts.

The gh-issues-mcp example works around this by launching the server through bash:

tools:
  mcp:
    - name: github
      command: ["bash", "-c", "exec /usr/local/bin/github-mcp-server stdio"]

The absolute path matters too: the server's env is scoped to its env: block, so there is no PATH for bash to search.

Two possible fixes:

  1. Compile tools.mcp[].command[0] into the entrypoint's --allow-run the same way permissions.run compiles to flags (needs the entrypoint to re-exec, or the CLI to assemble flags before the in-process run).
  2. Have connectMcpServers wrap stdio commands in bash -c exec ... itself, so configs can declare the real command and the docs example (docs/tools.md shows command: ["docker", "run", "-i", ...]) works unchanged in the container.

Either way, the config as documented should run in the container without the author knowing about the sandbox's allow-run list.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions