# infrabroker

An access broker for infrastructure. The agent asks for an action, the broker runs it with a throwaway credential and hands back only the output.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 13
- Author: luisgf
- License: GPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/luisgf/infrabroker
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/infrabroker

## What it does

The model never holds a key. It sends an intent — a host and a command, or a cluster operation — and infrabroker checks that intent against policy before doing anything. Execution uses a certificate minted for that one call by the broker's own CA, or a bound ServiceAccount token with a short lifetime. Both are dropped once the call returns, so a prompt-injected agent finds nothing worth stealing in its context.

A single `infrabroker` binary carries the same engine and tool surface across three transports, picked by subcommand. `infrabroker serve-mcp` runs over stdio for local use and relies on the user launching the process rather than transport auth. `infrabroker serve-mcp-http` speaks Streamable HTTP and validates an OIDC bearer token against the issuer's JWKS, passing user identity and groups down to the signer for per-user RBAC. `infrabroker serve-http` exposes `POST /v1/ssh_run` for agents that authenticate with a client certificate. Available tools include `ssh_execute`, the `ssh_session_open` / `ssh_session_exec` / `ssh_session_close` trio, `ssh_list_servers`, `ssh_put_file` and `ssh_get_file`; with clusters configured you also get `k8s_get`, `k8s_list`, `k8s_logs`, `k8s_apply`, `k8s_delete` and `k8s_list_clusters`.

Escalation is decided on the signing side, through `allow_sudo` and `allowed_sudo_users`. A broker that gets compromised still cannot raise privileges where policy says no.

## Requirements
- Needs: Docker

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add infrabroker -- docker run -i --rm ghcr.io/luisgf/infrabroker:3.1.3
```

### Codex

**Platform CLI**
```bash
codex mcp add infrabroker -- docker run -i --rm ghcr.io/luisgf/infrabroker:3.1.3
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "infrabroker": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "ghcr.io/luisgf/infrabroker:3.1.3"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "infrabroker": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "ghcr.io/luisgf/infrabroker:3.1.3"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add infrabroker docker run -i --rm ghcr.io/luisgf/infrabroker:3.1.3
```

## When to use it
- run a command on a remote host without exposing a private key to the agent
- pull pod logs from a cluster with no kubeconfig
- block risky commands through allow/deny policy
- permit sudo only where policy allows it
- trace who ran what through the audit chain

## Example prompts
- Run `uptime` on web-01 through infrabroker
- Show me the logs for pod `api-7d9f` in the prod cluster
- Copy `deploy.sh` to build-02

## Similar
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [Oh My Posh Validator](https://affpapa.org/en/nevibecode/mcp/oh-my-posh-validator.md) — MCP server · ★ 23643
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18727
- [Coder](https://affpapa.org/en/nevibecode/mcp/coder.md) — MCP server · ★ 17160
- [mcp](https://affpapa.org/en/nevibecode/mcp/kubeshark-mcp.md) — MCP server · ★ 12109

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
