Skip to main content
Glama

sudo-proxy

tarides/sudo-proxy MCP server

Repository

An MCP server that lets an agent run privileged, mutating commands — locally or over SSH — with a human keypress required on every one and no credential ever stored.

Privileged command execution proxy with an MCP server for AI agent integration. Receives requests over a Unix socket, shows a single-keypress TUI prompt for human approval, then escalates via sudo. Configure sudo-proxy-mcp in Claude Code or any MCP client and the model can run privileged commands — with explicit human approval on every one.

⚠️ Not yet independently audited. The security assurance in this repo is self-produced. Security reviewers: REVIEWING.md is a 15-minute on-ramp — the falsifiable claims, the trust boundary, and where we have no assurance. Reporting: SECURITY.md.

Architecture

AI model ──► sudo-proxy-mcp ──► Unix socket ──► sudo-proxy ──► TUI Y/N ──► sudo
             (MCP server)         │
                                  │
                            local socket, or SSH tunnel
                        (start_server spawns sudo-proxy --host
                         which sets up the tunnel and remote
                         server)

The TUI prompt asks for approval (single keypress), then sudo handles privilege escalation. The password prompt appears in the same terminal. This flow is identical for local and remote hosts. A non-privileged mode runs commands directly as the current user, still behind the same Y/N gate — see docs/usage.md.

Related MCP server: MCP SSH Proxy

Why not just use the Bash tool?

Bash tool

sudo-proxy MCP

Privilege escalation

Not possible

sudo with human approval

Human review

None — executes immediately

TUI Y/N gate on every command (privileged and unprivileged)

Timeout

Up to 10 min, no user prompt

60 s TUI prompt + configurable overall timeout

Remote hosts

Not supported

SSH tunnel with TUI on remote terminal

Environment

Inherits shell env

Sanitized allowlist only

Audit trail

None

Server logs each request (with -v)

sudo-proxy fills the gap when a model needs to install packages, edit system files, manage services, or run any other command — with the human always in the loop, even when Claude Code is run with --dangerously-skip-permissions.

It is deliberately not a way to run unprivileged commands with less scrutiny than the Bash tool: an unprivileged command targeting the local machine is refused and delegated back to the Bash tool (which already applies your permission rules), and loopback aliases like 127.0.0.1 cannot dodge that. sudo-proxy handles privilege escalation and commands on remote hosts; there, unprivileged commands are gated the same way, and the per-command gate is only relaxed if you deliberately mark a host eligible in hosts.json and confirm once per session name (a grant that is never persisted). See REVIEWING.md invariant G7.

Escalate vs. confine. sudo-proxy's security model is the inverse of an agent harness's. A harness (Claude Code, Codex CLI, …) gates with software — permission rules plus an optional classifier — and runs the agent at your own privilege, narrowing it to a safe subset. sudo-proxy inverts both: a human approves every command (no classifier, no auto-approve) and execution is escalated beyond what the agent has. The two are complementary — the harness bounds the agent to your privileges; sudo-proxy is how it reaches past them, with a human as the escalation authority. See docs/architecture.md.

For how this relates to mcp-firewall, sandboxing, polkit, doas, and other neighboring tools, see docs/comparison.md.

Features and non-features

What sudo-proxy does:

  • Per-command human approval — a single-keypress Y/N TUI gate on every command, privileged and unprivileged, with no way to bypass it.

  • Real privilege escalation via sudo — installs packages, edits system files, manages services; not limited to read-only diagnostics.

  • Local and remote over one flow — the same approval TUI whether the command runs on this machine or on a remote host over an SSH tunnel.

  • Stores no secret — the sudo password is typed live into the terminal; nothing is cached, encrypted-at-rest, or written to disk.

  • Explicit argv — commands are passed and displayed exactly as they run, with no shell-string interpolation.

  • Sanitized environment — a fixed allowlist, not the inherited shell environment.

  • Audit trail — each request is logged by the server (-v).

  • Works under --dangerously-skip-permissions — the human gate holds even when the agent's own permission prompts are disabled.

What sudo-proxy deliberately does not do:

  • No stored or managed credentials — it is not a password cache or a secrets manager.

  • No unattended execution — there is no auto-approve mode; a human approves each command or it does not run.

  • Not a sandbox — it grants real privilege rather than isolating or faking it.

  • Not a policy engine or ACL — the human at the keypress is the policy; there are no rules to write or maintain.

  • Not read-only — it is not restricted to a whitelist of safe diagnostic commands.

  • No hosted service — it runs on your own machine; commands never transit a third-party relay.

  • Not a general remote shell — no persistent interactive sessions, SFTP browser, or fleet manager; just gated one-shot commands.

Quickstart

Install the binaries (needs a Rust toolchain; prebuilt static binaries are on Releases):

cargo install sudo-proxy

Or fetch the prebuilt static binaries without compiling, via cargo binstall:

cargo binstall sudo-proxy

cargo binstall downloads the release tarball from GitHub and verifies its minisign signature (public key RWT7gwtBU0v4puI76u0oYwMAT9nmYwGimSOnqJJ+kHExsjTDQj1eZkMW, key ID A6F84B53410B83FB) before installing; a missing or bad signature aborts the install. Prefer cargo install if you'd rather build from source.

The daemon must run in a terminal window that no other process can type into: outside tmux/screen, on Wayland. It refuses to start otherwise; see Where to run the daemon.

Point your MCP client at the server — add to the project's .mcp.json or ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "sudo-proxy": {
      "command": "sudo-proxy-mcp"
    }
  }
}

Install as a Claude Code plugin

The repo is also a Claude Code plugin and its own marketplace. Instead of editing .mcp.json by hand:

/plugin marketplace add tarides/sudo-proxy
/plugin install sudo-proxy@tarides

The plugin registers the sudo-proxy MCP server and ships a skill that tells the model to reach for sudo-proxy only for privileged or remote work, to start the server before executing, and to write a clear description for each command so the approval prompt is easy to judge. It does not install the sudo-proxy-mcp binary — that must already be on your PATH (see the cargo install / cargo binstall steps above). A tool whose whole point is explicit human consent should not install itself silently.

Run commands

Then the model starts a server (opening a terminal with the approval TUI) and runs commands through it:

start_server()
execute({"argv": ["apt", "install", "nginx"], "description": "Install nginx"})

Each execute shows the exact command in the TUI; press y to approve, N (default) to deny. For remote hosts, pass host to start_server and execute. Invisible/format characters (e.g. emoji variation selectors, zero-width or bidi controls) are removed from description before it is shown.

When a prompt appears, the TUI rings the terminal bell and blinks the question line so a request is not missed while the daemon's terminal is unfocused or off-screen. The bell honors the terminal's own visual-bell/urgency setting (audible beep, taskbar/dock flash, or both). Both cues are on by default; set SUDO_PROXY_NO_BELL to silence the bell and SUDO_PROXY_NO_BLINK to stop the blink (same opt-out style as NO_COLOR).

MCP Registry

Listed in the official MCP Registry as mcp-name: io.github.tarides/sudo-proxy.

Documentation

AI-assisted development

sudo-proxy was developed with substantial AI assistance using Claude Code. Commits where AI contributed materially carry a Co-Authored-By trailer naming the specific model. All design decisions, threat modeling, and the final form of every committed change were reviewed and approved by the human maintainer, who takes responsibility for the codebase.

This disclosure is provided in line with emerging industry practice around transparency about generative-AI involvement in software development. It is not a statement that the project is "AI-generated": the human-in-the-loop principle that the tool itself enforces at runtime is also the principle under which it was built.

License

MIT

Available Tools

5 tools
executeA

Execute a command (or multi-stage pipeline) on a sudo-proxy host after a human approves it at that host's terminal. Provide argv for a single command or pipeline for piped stages (e.g. [["ls", "/tmp"], ["wc", "-l"]]); host targets a remote daemon started via start_server (omit for localhost). Unprivileged commands on the local machine are refused — use your Bash tool, which applies the same controls. timeout is in milliseconds (max 600000); it defaults to 120000 for privileged commands but is opt-in for unprivileged ones (omitted = wait as long as the daemon needs, so an approved-but-slow command is not falsely timed out). Invisible/format characters (e.g. emoji variation selectors, zero-width or bidi controls) are removed from description before it is shown to the approver. Blocks until the human answers, then returns the final stage's stdout plus per-stage stderr and exit codes. Errors: 'Request denied by user.' if the human declines, a timeout error if unanswered within 60s, and 'sudo-proxy is not running' if the daemon is down — call start_server first.

Inputs: env, argv, host, plan, +6 more.

start_serverA

Start a sudo-proxy approval daemon: with no host, opens a local terminal window running the approval TUI; with host, opens a terminal running SSH to that host with a Unix-socket tunnel so subsequent execute calls reach it. Idempotent: if the daemon (or tunnel) is already live it returns 'already running' without spawning anything. Blocks while polling for end-to-end socket readiness — up to 5s locally, up to 30s for remote tunnels — and returns as soon as the daemon answers. Set forward_agent: true to enable SSH agent forwarding for unprivileged remote commands (ignored locally); errors if no terminal emulator is found or the socket is not ready within the polling window.

Inputs: host, forward_agent.

statusA

Report the status of sudo-proxy daemons without executing any command: with host, checks that one daemon; with no arguments, checks the local daemon plus every host in the registry. For each host it reports whether the socket exists and answers, the live daemon version (learned via a ping that needs no human approval), and registry metadata (description, OS, last connected). Read-only except for refreshing the registry's last-connected/version cache after a successful ping. Hosts that are down are reported as 'not running' — that is a normal result, not an error.

Inputs: host.

stop_serverA

Stop a running sudo-proxy daemon: sends a stop request over its socket; the daemon prints a shutdown notice on its terminal (no approval prompt is required), exits, and its terminal window — and SSH tunnel, for remote hosts — closes. host selects a remote daemon started via start_server; omit it for the local one. Returns a non-error 'not running' message if no socket exists; on success, confirms after briefly polling for the socket to disappear and removes any stale tunnel socket. If the target runs a sudo-proxy version that predates remote stop, returns an error asking you to press q or Ctrl+C in that daemon's terminal instead.

Inputs: host.

update_hostA

Record or update metadata for a host in the sudo-proxy registry (~/.config/sudo-proxy/hosts.json), which is surfaced in this server's instructions and in status output. Partial update: only the description and/or os fields you provide are changed; omitted fields keep their current values. A host not yet in the registry is added automatically. Returns 'Updated host '; errors only if the host name contains characters outside [A-Za-z0-9._@:-].

Inputs: host (required), os, description.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.6/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool targets a distinct operation: execute runs commands, start_server/stop_server manage the daemon lifecycle, status is a read-only health check, and update_host edits registry metadata. The descriptions explicitly cross-reference each other (e.g. status performs no execution, stop_server requires no approval), leaving no realistic chance of misselection.

    Naming Consistency4/5

    Three tools follow a clear verb_noun pattern (start_server, stop_server, update_host) and 'execute' is a clean bare verb that fits the domain. 'status' is a bare noun rather than a verb form like 'get_status' or 'check_status', a minor deviation but still instantly readable.

    Tool Count5/5

    Five tools is exactly the surface needed: one action tool plus the full daemon lifecycle and host metadata management. Nothing is padded or redundant, and no tool could be folded into another without losing clarity.

    Completeness4/5

    Lifecycle coverage is solid (start, stop, status, execute) and update_host covers registry writes, with status enumerating the registry when called without arguments. The notable gap is the absence of a delete/remove_host or list_hosts operation, so an agent cannot deregister a host and must infer listing from status output.

    Maintenance

    ActivityActive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A human-in-the-loop SSH bridge for AI agents that requires approval for every command before execution on configured servers.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides local command execution, remote SSH, interactive terminals, file read/write, and source search for AI CLI through stdio, with large output pagination and safety confirmations.
      13 npm
      2
      Apache 2.0