Skip to content

The bridge and its tools

keypaste mcp is the bridge an AI tool starts. It holds no vault: it passes each request to the approver, the desktop app or keypaste approve, which answers it (How approvals work). This page is what the bridge reaches and the tools it offers an agent. Connect an AI tool sets it up.

An AI tool’s configuration passes these; you do not run the bridge yourself.

FlagEffect
--vault <path>A vault to ask, once for each vault this agent may reach. Or KEYPASTE_VAULT (below).
--all-vaultsEvery vault of this computer’s local account, in place of --vault; the app’s Connect registers it by default.
--expose <glob>What this agent can see at most (below). tag:env:* by default.
--client-label <name>The agent’s name: its agent settings follow it, and the audit log uses it.
--allow-runOffers the run tool (below).
--audit-log <path>Where the bridge records a call it refuses itself or that no approver answered. The approver records the calls it answers in its own log.
--approver <name>Which approver’s pipe to ask instead of the vault’s own. Or KEYPASTE_APPROVER.
  • With --all-vaults, as Connect registers by default, every vault of this computer’s local account, the vaults the app lists under On this Mac or On this PC, read from app.toml each time the bridge starts. A vault added to the account is reached from the tool’s next start, and one closed in the app is not. Nothing outside that list is reached, KEYPASTE_VAULT and the chosen vault included, and --all-vaults refuses a --vault or --approver beside it (THREATS T-63).
  • The vault named by --vault or KEYPASTE_VAULT, or each vault when --vault is given several times.
  • Otherwise, the vault chosen in the app’s Settings or with keypaste use <path>. A running bridge keeps its vaults until its tool restarts it.
  • With none, the bridge is refused.

--all-vaults finds the account and each vault’s approver under keypaste’s usual home, ~/.keypaste. A tool may start the bridge without KEYPASTE_HOME or KEYPASTE_APPROVER, so with either set in the app, Connect offers Only these alone and says why. In the app, a connected tool’s Vaults › Change… switches between All vaults and Only these and rewrites the tool’s configuration.

A key file goes to the approver (--keyfile <path> or KEYPASTE_KEYFILE), never to the bridge.

With --expose '**', as setup and Connect register, the agent sees every item’s title, group, tags and URL, and its username unless Agents see usernames is off. Each value it asks for is decided by its agent settings, which by default ask you.

With no --expose, the bridge sees only tag:env:*: the variables of items tagged into an environment. Any --expose replaces that default, so name it again when you add a group:

"args": [
"mcp", "--vault", "/absolute/path/to/vault.kdbx",
"--expose", "tag:env:*",
"--expose", "servers/staging/*"
]
  • * stays inside one group and ** spans any number.
  • tag:env:<project>[:<stage>] reaches only that environment’s variables, never an item’s password.
  • Every pattern discloses the names it matches.
ToolDoes
list_entry_namesLists the items the agent can see, with their fields and environments. Never a value.
find_accessSearches by text, host, kind, environment or a related item. Never a value (THREATS T-55).
request_credentialAsks for one field, or an item’s current TOTP code.
request_linked_setAsks for two to four related fields at once: all or none (Approvals, T-56).
request_attachmentAsks for one attachment, up to 5 MiB.
request_saveAsks you to save a value; the agent learns only whether it was saved (T-54).
request_item_changeAsks to move an item to Trash, mark it expired or delete one it created; tags needs-update without asking (Approvals, T-57).
runRuns a command with secrets, with --allow-run (below).

With several vaults, through --vaults or --all-vaults, results name each item’s vault, and a request takes vault when a name is in more than one.

Item names are data: anyone who can edit the vault can use them for prompt injection (THREATS T-1).

Running a command with secrets (--allow-run)

Section titled “Running a command with secrets (--allow-run)”

With --allow-run the bridge offers run. An agent runs nothing until you turn run on for it, in Agents or with keypaste clients <agent> --run on, and every run is asked (Approvals).

run takes a command (never through a shell), an absolute directory, a project (an environment’s name) or kp:// references in env, a reason, and an optional timeout_seconds (default 120, at most 600). It returns the exit code and the end of each stream, with each value replaced by [keypaste:NAME]. That replacement is not a boundary: a command can reveal a value another way (THREATS T-35).