Skip to main content

MCP server for the sandbroker typed-return secret broker: USE secrets, never SEE their values.

Project description

sandbroker MCP server

A stdio Model Context Protocol server that lets any MCP host (Claude Code and others) natively drive the sandbroker broker. The model can USE secrets through pinned verbs but can NEVER SEE their values.

It is a thin MCP wrapper over the exact same daemon protocol bin/sandbroker speaks. It adds no new daemon-side surface: it consumes the existing catalog and invoke actions only.

What it exposes

Tool Wraps Purpose
secret_catalog catalog action List the item references available in a vault. Returns item ids + titles only, never a value.
secret_invoke invoke action Run a pinned verb that USES a secret and return the typed OUTCOME (ok/error), never the value or the operation's output.

The human-only, direct-socket actions (lock, status, set_retention) are not exposed. Those are operator actions, not model actions.

Security guarantee (values never cross the tool boundary)

The product promise holds structurally, not by filtering:

  • sandbroker's response schema has no field a secret value can occupy. A verb returns the OUTCOME of an operation ({ok} / {error}), never its output.
  • This server passes through only the daemon's own typed keys (ok, error, verb, items, status, retry_after) and re-filters them on ingress as defense in depth, so even a tampered daemon reply cannot smuggle an extra field to the model.
  • This server never reads a secret from anywhere; it holds no tokens.

The approval code surfaced on a confirm-tier request is not a secret: it is a one-time code the human types into the Windows approval window. Only its sha256(sid:code) hash is ever sent to the daemon; the plaintext lives only in the chat and the human's typing, exactly as with sandbroker.

Transports

Two transports, tried in sandbroker's order, so this works sandboxed or not:

  1. Direct UNIX socket to sandbroker (SANDBROKER_SOCKET, default /opt/sandbroker/run/sandbroker.sock). This is the normal path: the MCP server runs UNSANDBOXED, launched over stdio by the host.
  2. File-queue bridge (SANDBROKER_BRIDGE_DIR, default /tmp/sandbroker-bridge) for parity with sandboxed contexts whose seccomp filter blocks AF_UNIX connect. The per-session queue carries only the operation in and {ok,error} out, never a value.

Environment variables

Var Default Meaning
SANDBROKER_SOCKET /opt/sandbroker/run/sandbroker.sock Daemon UNIX socket path.
SANDBROKER_BRIDGE_DIR /tmp/sandbroker-bridge File-queue base for the bridge transport.
SANDBROKER_SID (unset -> daemon default _nosid) Session id, normally injected by the launcher.
SANDBROKER_NO_BRIDGE (unset) 1 = socket only, never fall back to the bridge.
SANDBROKER_FORCE_BRIDGE (unset) 1 = bridge only, skip the socket (sandbox parity testing).

Install

pipx install sandbroker-mcp     # puts the `sandbroker-mcp` command on PATH

From a checkout instead: cd mcp && python3 -m venv .venv && .venv/bin/pip install . (provides the sandbroker-mcp console script and python -m sandbroker_mcp).

Register in Claude Code

After pipx install sandbroker-mcp, the command is on PATH:

claude mcp add sandbroker --scope user -- sandbroker-mcp

From a checkout venv instead, point at its absolute path, e.g. /path/to/mcp/.venv/bin/sandbroker-mcp.

Pass a non-default socket or force a transport with --env:

claude mcp add sandbroker --scope user \
  --env SANDBROKER_SOCKET=/opt/sandbroker/run/sandbroker.sock \
  -- sandbroker-mcp

settings.json snippet (equivalent)

{
  "mcpServers": {
    "sandbroker": {
      "command": "/absolute/path/to/mcp/.venv/bin/sandbroker-mcp",
      "args": [],
      "env": {
        "SANDBROKER_SOCKET": "/opt/sandbroker/run/sandbroker.sock"
      }
    }
  }
}

Usage flow

  1. secret_catalog(vault="Dev") -> discover item ids/titles. Build a ref like op://Dev/<id-or-title>/password.
  2. secret_invoke(verb="canary.probe", ref="file://canary") -> auto-tier verbs return {ok:true} immediately.
  3. Confirm-tier vaults (e.g. Production, Infra) require one human approval:
    • First call returns {ok:false, error:"hello_pending"} plus a 6-digit approval_code in guidance.
    • Relay the code to the human. They type it into the Windows approval window and approve with Windows Hello.
    • Call secret_invoke again with the same verb/ref/justification to poll. You will see hello_waiting until they confirm, then ok.
    • An auditor-enabled vault may instead return auditor_reviewing; just call again with the same arguments. The daemon fail-closes to a human by its own deadline.

secret_invoke requires a justification for confirm-tier vaults (a short, human-readable reason). Never put a secret in args; secrets come only from the ref.

Relationship to sandbroker

This server mirrors bin/sandbroker exactly: same request shape, same per-invocation code + code_hash derivation, same auditor retry loop (sleep retry_after, re-send the same request, up to 6 times). The difference is surface only: sandbroker writes human banners to stderr; this server returns that guidance in the tool result so the model relays it to the human.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sandbroker_mcp-0.1.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sandbroker_mcp-0.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file sandbroker_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: sandbroker_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sandbroker_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c42a2d4552ac9622b6aaa4f04bfb8f241a70bf6ff62cab0e89b4e7e53389cb46
MD5 bb2393a8a72af8922c35e422a3992a58
BLAKE2b-256 2fad75e1e24503472833a40cf20382f0ba452723fbe54b73106313927983b984

See more details on using hashes here.

Provenance

The following attestation bundles were made for sandbroker_mcp-0.1.0.tar.gz:

Publisher: release-mcp.yml on 312-dev/sandbroker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sandbroker_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sandbroker_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sandbroker_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85ed4a402a059004456b344fa2b269b9051e4cd803a1d7a5ae8035735ede71eb
MD5 7daed00e7dc4ce6d3779e23ab0e384a3
BLAKE2b-256 9d2130304d5a2bcf2d662693b3d2d68d27674615d3fdc09706386261afa7c0fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for sandbroker_mcp-0.1.0-py3-none-any.whl:

Publisher: release-mcp.yml on 312-dev/sandbroker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page