kpxc-mcp
Fills KeePassXC usernames/passwords or TOTP codes into the active Brave/Chromium tab via the DevTools protocol, without exposing the values to the agent.
Lets an agent use KeePassXC logins and tokens without seeing them: fills credentials or TOTP into a browser tab, injects opt-in entry fields into approved commands with policy checks and output redaction, and searches entry titles/URLs without returning secrets.
Sends approval prompts for logins and secret-using commands to a Matrix DM and reads the approver's reactions to allow or deny the request.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@kpxc-mcp log me into this tab using my KeePassXC login"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
kpxc-mcp
An MCP server that lets an agent (Claude Code, Claude in Chrome sessions, anything that speaks MCP) use logins and tokens from KeePassXC without the agent seeing them. It is the KeePassXC counterpart of 1Password for Claude.
request_login(tab, mode): looks up the tab's site in KeePassXC, asks you which entry to use, and fills the username and password (or a one-time code withmode: "totp") straight into the page over the DevTools protocol. The agent gets backfilled,denied,no_login,no_fieldororigin_changed, never a value. It does not submit; the agent clicks the page's own button. One approval covers a login and the one-time code that follows it: same tab, same site, same entry, within 3 minutes, once. For a login stored under another URL, the agent passesentry(title,Group/Titleor UUID); the prompt then says the agent picked the entry.run_with_secrets(argv, env): runs a command without a shell, with entries injected as environment variables (GH_TOKENforgh, orcurl --variable %TOK --expand-header 'Authorization: Bearer {{TOK}}'). Each entry must opt in, the command and hosts are checked against the entry, you approve each run, and the secret (plain, URL, hex and base64 forms) is removed from the output. Each variable names its entry byurl(site match),entry(title,Group/Titlepath or UUID) or both, and may pick afieldthe entry allows.find_entries(query): titles, URLs and UUIDs of entries whose title or URL containsquery, no secrets. Only while you tick "Allow get-database-entries request" (Browser Integration → Advanced); without it, an exact title still works forentry, found by walking the group tree with KeePassXC'skeepassxc://by-path/lookup.KeePassXC up to at least 2.8.0-beta1 segfaults when a
by-uuid/by-pathlookup hits an entry without a URL (keepassxreboot/keepassxc#13865, fixed by PR #13887). Useentryonly with a KeePassXC that carries that fix.
Setup
KeePassXC: browser integration on (Settings → Browser Integration), and keep "Return advanced string fields which start with 'KPH: '" ticked (the default) so command policies can be read.
Brave or Chromium with
--remote-debugging-port=9222on loopback (override withKPXC_MCP_CDP).Build and pair once (KeePassXC asks you to approve and name the connection):
nix build -o ~/.cache/kpxc-mcp . ~/.cache/kpxc-mcp/bin/kpxc-mcp associateRegister it with Claude Code. Either as one shared HTTP server that runs only while it is used (recommended), or as a stdio server, which is one process per agent session for the whole session.
HTTP, started on demand. systemd listens on
127.0.0.1:47321and startskpxc-mcp httpon the first connection; the server exits afterKPXC_MCP_IDLE_EXITseconds (default 120) without a request, so nothing runs between uses. User units:# ~/.config/systemd/user/kpxc-mcp.socket [Socket] ListenStream=127.0.0.1:47321 [Install] WantedBy=sockets.target # ~/.config/systemd/user/kpxc-mcp.service [Service] ExecStart=%h/.cache/kpxc-mcp/bin/kpxc-mcp httpsystemctl --user enable --now kpxc-mcp.socket ~/.cache/kpxc-mcp/bin/kpxc-mcp claude-config # writes the http entry and token into ~/.claude.jsonLoopback HTTP is reachable by every local process and by web pages, so each request needs the bearer token from
~/.config/kpxc-mcp/http_token(mode 600, created on first start), theHostheader must be the loopback address, and requests that carry anOriginheader (browsers) are refused.run_with_secretsruns in the calling agent's working directory unless it passescwd.stdio:
claude mcp add --scope user kpxc -- ~/.cache/kpxc-mcp/bin/kpxc-mcp serve
Related MCP server: secure-browser-mcp
Approving from the phone (Matrix)
Every prompt also goes to a Matrix DM from a bot account. The bot pre-reacts ✅/❌ (or 1️⃣…9️⃣ when several entries match), so answering on the phone is one tap. Only reactions from the configured approver count, and the first answer on either the phone or the desktop wins. The other prompt is withdrawn and the message is edited with the outcome. When nobody answers within two minutes, the request is denied.
One-time setup:
Create a bot account on your homeserver, then run
kpxc-mcp matrix-login https://<homeserver> <bot>. It asks for the password and stores only the access token in~/.config/kpxc-mcp/matrix_token(mode 600).Run
kpxc-mcp matrix-setup https://<homeserver> @<you>:<server>. This creates an unencrypted DM with you (the server has to read your reactions) and writes~/.config/kpxc-mcp/matrix.json.Accept the invite.
Or keep the token on a server: if a server you reach by ssh already holds a bot's access token, kpxc-mcp can
make the Matrix calls there. The token file is read with sudo -n and never leaves the server. Use a plain bot
token, not an appservice as_token: an as_token can act as every user in its namespace, including you. Write
~/.config/kpxc-mcp/matrix.json by hand:
{"homeserver": "https://matrix.example.org", "ssh_host": "my-server",
"token_file": "/srv/matrix-bot/access_token",
"bot": "@approvals-bot:example.org", "room_id": "!<existing unencrypted DM>", "approver": "@you:example.org"}The ssh connection is multiplexed (socket in $XDG_RUNTIME_DIR/kpxc-mcp), so polling costs about 0.5 s per call.
When ssh fails (for example, a locked agent), the phone channel counts as no answer and the desktop prompt decides.
The request text (site, entry title and username, or the full command) is stored on your homeserver in plain text. Secrets never are.
KeePassXC's own dialogs (database unlock, first access to an entry, passkeys) only appear on the desktop. When
KeePassXC keeps a login request waiting on one of them for more than 2 seconds, the bot posts a notice saying which
one (locked database or entry access for the site) and edits it with the outcome; the request gives up after
3 minutes with dialog_unanswered. For a
request to be answerable from the phone alone, the entry must already allow that site ("Remember" in KeePassXC's
access dialog). The phone or desktop prompt is then the only approval.
Passkeys
Passkeys go through KeePassXC-Browser, not this server. Turn on "Enable passkeys" in the extension's options. The agent clicks the site's passkey button, and KeePassXC shows its passkey confirmation; KeePassXC signs the request itself, so nothing reaches the agent. This works only in your normal profile where the extension runs, and the confirmation is desktop-only.
Letting an entry be used by commands
Add attributes to the entry in KeePassXC (Advanced → Additional attributes). Only you can set them; the agent
cannot. An entry the agent names explicitly (entry without url) may have no attributes at all: then any command
except shells and interpreters, any host and any field are allowed, and your approval of the prompt (which shows the
whole command and says the entry has no policy) is the only limit. Entries found by site still need the opt-in.
Attribute | Meaning |
| Allowed commands, whitespace separated: names on the system PATH or |
| Hosts URLs in the arguments may point at; |
| Fields the agent may inject, whitespace separated: |
Commands resolve through /run/current-system/sw/bin and the per-user profile only, and must land in /nix/store,
so a script dropped in ~/bin cannot stand in for gh.
Approvals and what they protect
Every prompt offers Allow once or Allow always. "Always" is remembered in
~/.local/state/kpxc-mcp/remembered.json (mode 600): for run_with_secrets the program name plus the exact
entries and fields it receives (arguments may differ; the entry's KPH: policy still applies), for request_login
the site's origin plus the entry. kpxc-mcp forget drops them all.
Every request_login and run_with_secrets opens a desktop prompt (zenity) and, when configured, a Matrix
message, each showing the site or full command and the entry. KeePassXC's own access dialog comes first for entries that have not been allowed for that host.
Limits, stated plainly:
The agent runs as your user. A process that reads
~/.local/state/kpxc-mcp/association.jsoncan talk to KeePassXC directly and skip the zenity prompt. KeePassXC's access dialog is then the only gate, so do not tick "Remember" in it for entries you want asked about every time.AGENTS.mdforbids agents to read that file.Redaction covers common encodings, not every transformation a program could apply. Only allow commands whose output does not echo request bodies, and keep
agent-hostsnarrow.The fill runs in the tab's top frame. Login forms inside cross-origin iframes are not filled.
Tests
nix develop -c python -m pytest -q testsThe KeePassXC side runs against a mock that follows src/browser/BrowserAction.cpp. The browser tests start a
headless Brave/Chromium with a throwaway profile and skip without one.
License
GPL-3.0-or-later. See LICENSE.
Available Tools
3 toolsfind_entriesA
Find KeePassXC entries by part of their title or URL. Returns title, URL and UUID only, never a secret; pass the UUID as entry to the other tools. Works only while the user allows get-database-entries in KeePassXC (Browser Integration → Advanced).
Inputs: query (required).
request_loginA
Fill the login form of a browser tab from the user's KeePassXC. The user approves each request in KeePassXC and a desktop prompt; the credentials go straight into the page and are never returned. Call it when the tab shows a sign-in form, then click the page's own sign-in button. For username-first sign-ins call it again on the password step. mode 'totp' fills a one-time code field.
Inputs: tab (required), mode, entry.
run_with_secretsA
Run a command (no shell) with KeePassXC secrets in environment variables, e.g. GH_TOKEN for gh or a curl --variable/--expand-header token. Only commands and hosts listed in the entry's 'KPH: agent-commands' and 'KPH: agent-hosts' attributes are allowed, the user approves each run, and secret values are removed from the output.
Inputs: env (required), argv (required), cwd, timeout.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools have clearly distinct purposes: finding entries, filling login forms, and running commands with secrets injected. There is no meaningful overlap, and find_entries explicitly supports the other two by supplying UUIDs.
All tools use consistent snake_case imperative verb phrases: request_login, run_with_secrets, find_entries. The pattern is predictable and readable throughout.
Three tools are well-scoped for a narrow credential-integration server: entry discovery, form filling, and approved command execution. Each tool has a clear role and no filler.
The core workflows are covered: find an entry, then either fill a login form or run an allowlisted command with its secrets. Minor gaps exist around entry management and standalone TOTP retrieval, but these appear intentionally out of scope for a safety-focused agent integration.
Maintenance
Related MCP Connectors
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Password vault for AI agents with scoped, user-approved access
Let AI agents use any website you're logged in to. Sessions stay encrypted on your machine.
Agent social posting via your logged-in Chrome. Remote MCP + OAuth. Not clawpost.dev.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables secure retrieval of credentials from 1Password vaults for use by AI agents, supporting integration with browser automation for automated login.1-

secure-browser-mcpofficial
FlicenseNot gradedqualityBmaintenanceEnables secure browser automation by letting agents fill Turnkey-stored secrets into web forms without the secret values ever appearing in the conversation, transcript, or model context.6-- AlicenseAqualityBmaintenanceEnables AI agents to look up stored logins by URL, name, or alias and use them without seeing the secrets, injecting authentication into HTTP requests, running commands with credentials in the environment and scrubbed output, and fetching 2FA codes, subject to per-credential policies and user approval.23MIT
- AlicenseAqualityCmaintenanceEnables MCP clients to look up, save, and update logins and TOTP codes in a running, unlocked KeePassXC database over its browser-integration socket, along with password generation and group management, without ever opening the .kdbx file or handling the master password.10MIT