Read-only access to secrets in a local KeePassXC vault. Runs commands with them injected.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
kdbx keeps a project's secrets in a per-project, per-environment KeePassXC vault
(KDBX4, unlocked by a key file only β no master password) and gets them into the tools that
need them without kdbx ever printing them into a transcript, a log file, or your shell
history.
Discovery is automatic: kdbx walks up from your current directory to a committed
.keepassxc.json pointer file, works out which environment is active, and takes it from
there. The headline command is kdbx run -- <cmd>, which resolves that environment's
variable mappings and injects them into a child process' environment. It replaces .env
files as the source of truth; the vault stays outside the repo, so there is nothing secret
to accidentally commit.
Every install method below is live β the curl installer, Homebrew,
go install, theghcr.iocontainer image, and the signed release archives (SHA256SUMS+ cosign, with reproducible builds). The badge above tracks the current version.
Windows: download the _windows_ archive from the
releases page and put kdbx.exe on your PATH.
Building from source needs Go 1.25 or newer (the KDBX engine and golang.org/x/term
both declare a 1.25 floor). Release binaries are static and impose no toolchain
requirement on users.
Shell completions:
1. Commit a pointer file at the repo root. It names the project and its environments; it contains no secrets, so it is safe to check in.
An empty env object is fine β kdbx derives the artifact paths from the project and
environment name: <keepassxc-dir>/demo/dev.kdbx and <keepassxc-dir>/demo/dev.keyx,
where <keepassxc-dir> is $KEEPASSXC_DIR if set, else %LOCALAPPDATA%\keepassxc on
Windows, else $XDG_CONFIG_HOME/keepassxc or ~/.config/keepassxc. Set vault and
keyFile explicitly if you want them somewhere else; both accept a ${KEEPASSXC_DIR}
token and a leading ~.
2. Create the vault and its key file.
3. Store a secret and map it to an environment variable. The value never appears on
the command line β it arrives on stdin, from --from-env, or from an interactive prompt.
--var records the mapping in the pointer file, preserving existing key order so the diff
stays reviewable:
4. Run something with the secrets injected.
The child inherits your environment plus the mapped variables. Its exit code is passed straight back out. Nothing is written to disk, and the value never appears in your shell history.
Reading is deliberately boring:
Every operation accepts --env NAME. Read operations additionally accept --json.
Operations marked β¦ print the banner ACTIVE ENV: <env> vault=<path> (source: <src>) to
stderr; pure display operations do not.
| Op | Flags | Behavior (stdout / stderr / exit) |
|---|---|---|
init β¦ | --here, --mode standard|strict | create vault + key file; with no pointer anywhere above, or with --here, first writes a fresh .keepassxc.json in the current directory (project named after it, dev/prod envs, dev active) so starting a project is one command; inside another project's tree, plain init names the pointer file it is about to use and asks for confirmation first (TTY only, exit 4 otherwise), pointing at --here as the way to start a separate project; stderr created <vault> plus a KEYFILE backup warning; refuses to overwrite an existing vault, key file, or pointer; --mode records the env's policy in the pointer, and strict anchors it into the new vault |
policy bless β¦ | anchor the pointer's current policy (its policy and run.allow sections) into the vault; interactive-only, like rekey, and denied to agents by the guard; strict run refuses until the anchor matches | |
set PATH β¦ | --var NAME, --from-env VAR, --raw | value from --from-env, else an interactive prompt with confirmation on a TTY, else stdin (empty β error; one trailing newline stripped unless --raw); an empty or whitespace-only value is refused; --var adds the mapping to the pointer file |
get PATH | --reveal | --clip | default: prints (set, hidden) β no length or prefix leak; --reveal prints the value with a stderr warning; --clip copies it and auto-clears after ~15 s; missing entry or field β exit 2 |
list [GROUP] | sorted group/β¦/title lines, filtered by the GROUP prefix, Recycle Bin excluded; never prints values | |
delete PATH β¦ | --purge | soft-deletes to the Recycle Bin by default; --purge prompts y/N (TTY only β a non-TTY refuses with exit 4) then removes permanently |
mv SRC DST β¦ | moves or retitles an entry, creating destination groups; re-points the active environment's var mappings that referenced SRC, keeping any :field suffix; stderr re-pointed N var mapping(s) β¦ | |
run β¦ | --allow-missing, --no-mask, --any, -- CMDβ¦ | if the pointer has a run.allow list, refuses an unlisted command before the vault is even opened (exit 7, NotAllowed) unless --any; resolves the active environment's vars map, injects it into the child's environment, resolves argv[0] through PATH (PATHEXT on Windows), forwards signals, and passes the child's exit code through; when a child stream is captured (not a TTY), injected values β₯ 8 bytes in it become *** (--no-mask disables; the guard denies it for agents); no command β exit 2; an unresolved var β exit 5 unless --allow-missing |
export β¦ | --out FILE, --allow-missing | renders the mappings as dotenv (always double-quoted; \, " and newlines escaped); --out writes atomically at 0600 with a gitignore reminder, otherwise stdout |
import FILE β¦ | parses a dotenv file (no $VAR interpolation), stores each KEY at imported/KEY and registers the mapping; stderr reminds you to delete or rotate the source file | |
check | prints MISSING VAR -> path per broken mapping; exit 0 when clean, 5 on drift | |
envs | one line per environment, the active one marked * ; stderr active: <env> (source: <src>); no pointer file β exit 2 | |
rekey β¦ | prompts y/N (TTY only, else exit 4), mints a new key file, re-keys the vault, replaces the old key file atomically; stderr reminds you to redistribute it |
Integration surfaces:
| Command | Purpose |
|---|---|
kdbx mcp | read-only MCP server over stdio (five tools: kdbx_list, kdbx_envs, kdbx_check, kdbx_get, kdbx_run) |
kdbx guard --hook pretooluse | evaluates a PreToolUse hook payload on stdin and denies agent-issued human-only operations |
kdbx completion <shell> | emits a completion script for bash, zsh, fish, or powershell |
kdbx --version | prints kdbx <version> |
--json--json gives read operations a machine-readable stdout. Secret values are never included.
--json with --reveal is rejected (exit 7). On failure, stdout carries
{"error":{"op":"check","exit":5,"kind":"Drift"}} alongside the usual stderr line and exit
code.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/kdbx)<a href="https://allmcps.com/mcp/kdbx"><img src="https://allmcps.com/api/badge/kdbx?style=directory" alt="Kdbx on AllMCPs" /></a>