Skip to content

[feature] Add optional bearer auth to the MCP HTTP gateway #13

Open

Description

@mitsuakki

Problem this solves
The gateway (localhost:3100) and Ghidra headless (localhost:8089) currently have no authentication. The README already warns that exposing 0.0.0.0:3100 grants arbitrary command execution via shell__exec. Loopback-only binding is safe by default, but there's no safety net if someone deploys this on a shared/cloud VM or changes the port mapping.

Proposed solution

  • Add a GATEWAY_AUTH_TOKEN env var (mirroring GHIDRA_MCP_AUTH_TOKEN), empty by default for local dev.
  • When set, require Authorization: Bearer <token> on all /mcp requests.
  • Document in README: "required if binding to a non-loopback interface."

Acceptance criteria

  • Gateway rejects requests without valid token when GATEWAY_AUTH_TOKEN is set
  • No behavior change when the var is unset (backward compatible)
  • README updated with a warning + example

Affected component(s)

  • Container / Dockerfile
  • MCP gateway
  • Ghidra bridge (bridge_mcp_ghidra.py)
  • Shell server (shell-mcp.py)
  • r2mcp / radare2 tools
  • angr MCP
  • Agents (.claude/agents/)
  • CI / build
  • Docs

Additional context
Relevant links, upstream issues, or prior discussion.

Activity

  1. self-assigned this
    on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions