keypaste setup
Connects this computer’s AI tools to your vault, or takes keypaste out of them.
Synopsis
Section titled “Synopsis”keypaste setup [--vault <path>] [--client <a,b>] [--label <name>] [--expose <globs>] [--dry-run] [--remove] [--yes] [--link]Options
Section titled “Options”| Option | Effect |
|---|---|
--vault <path> | The vault the tools’ bridge asks. Or KEYPASTE_VAULT; with neither, the vault chosen with keypaste use or in the app. |
--client <a,b> | Only these tools: claude-code, codex, gemini-cli, devin, vscode, cursor, claude-desktop. |
--label <name> | The --client-label each tool’s bridge gets, which agent settings and the audit log follow. The tool’s id by default. |
--expose <globs> | Narrows what every agent these tools start can see. ** by default, with each agent’s settings deciding each value. |
--dry-run | Prints every step and changes nothing. |
--remove | Takes keypaste out of each tool, leaving its other servers alone. |
--yes | Answers the question; needed without a terminal. |
--link | Prints links that have Cursor and VS Code add keypaste. |
Each tool’s bridge gets --client-label, --expose '**' and --allow-run (the bridge’s flags). No master password or key file goes into a tool’s configuration. Running it again is safe and updates a moved vault path.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
| 0 | A tool was connected, removed, or found not connected |
| 3 | No tool found |
| 6 | Every tool refused |
Each tool
Section titled “Each tool”setup keeps the first original of a file it edits as <file>.keypaste-backup.
| Tool | setup writes |
|---|---|
| Claude Code | claude mcp add --scope user |
| Codex | codex mcp add, into ~/.codex/config.toml |
| Gemini CLI | gemini mcp add --scope user; it starts keypaste only in trusted folders |
| Devin | devin mcp add -s user |
| VS Code | your user mcp.json, under servers with "type": "stdio" |
| Cursor | ~/.cursor/mcp.json; restart Cursor |
| Claude Desktop | its config file, on macOS and Windows |
On Windows, a tool installed with pnpm or yarn is refused.
By hand
Section titled “By hand”setup --dry-run prints the exact entry for each tool. Paths must be absolute; on Windows, escape backslashes in JSON ("C:\\Users\\you\\keypaste.exe"). Give each tool its own --client-label.
Claude Code, for one repository:
claude mcp add --transport stdio --scope project keypaste \ -- /absolute/path/to/keypaste mcp \ --vault /absolute/path/to/vault.kdbx \ --client-label claude-code--scope project writes .mcp.json in the repository root, which teammates get if you commit it. Its absolute paths can reveal usernames; --scope local keeps it to your machine.
Claude Desktop, and any tool that reads mcpServers JSON:
{ "mcpServers": { "keypaste": { "command": "/absolute/path/to/keypaste", "args": [ "mcp", "--vault", "/absolute/path/to/vault.kdbx", "--client-label", "claude-desktop" ] } }}| Claude Desktop’s file | |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
| Windows, Store or MSIX | %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json, once it has one |
Claude Desktop doesn’t see your shell’s variables, so with KEYPASTE_HOME set, use setup or the app’s Connect instead.
Troubleshooting
Section titled “Troubleshooting”Start with keypaste doctor, which reports the vault, the process holding it and each tool’s registration.
| What you see | What to do |
|---|---|
| The server fails to start | Check the path is absolute and executable, and ~/.keypaste is writable. |
| “Nothing holds this vault unlocked.” | Unlock the vault in the app, or start keypaste approve --vault <path>, with the same --approver as the bridge. |
| Nothing in the audit log | Check KEYPASTE_HOME: the approver writes in its own home. |
| Protocol errors | Remove wrappers or shell profiles that print to stdout. |
| An old command is refused | It names its replacement. |
Examples
Section titled “Examples”keypaste setup --dry-runkeypaste setup --client claude-code,cursor --vault ~/vaults/work.kdbxkeypaste setup --expose 'tag:env:*'keypaste setup --remove --yesThe bridge does not protect against a tool that keeps released values or sends them to a remote model, another local program using an agent’s label, or an agent that edits its own tool’s configuration (THREATS T-3, T-14).