KeePassXC MCP Server
Allows interaction with a KeePassXC password database through its browser integration protocol, including credential lookup by URL, TOTP retrieval, login saving/updating, password generation, database locking, group listing, database hash retrieval, and association management.
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., "@KeePassXC MCP Server get the login for github.com and grab its TOTP code"
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.
KeePassXC MCP Server
MCP (Model Context Protocol) server for KeePassXC password manager. Uses the same browser integration protocol as the KeePassXC Firefox/Chrome extension — communicating over Unix domain sockets or TCP with NaCl box encryption.
Features
get_logins — Look up credentials by URL
get_totp — Retrieve TOTP codes for entries
set_login — Save or update credentials
generate_password — Generate a password via KeePassXC's generator
lock_database — Lock the database remotely
get_database_groups — List the group/folder tree
get_database_hash — Get database hash (detect changes)
associate — Manually (re-)associate with the database
Related MCP server: onepassword-mcp-server
Prerequisites
KeePassXC running with Browser Integration enabled:
Settings → Browser Integration → Enable browser integration
The database must be unlocked for most operations
Python ≥ 3.10
Setup
Install
cd keepassxc-mcp
pip install .Or for development:
pip install -e .Local (KeePassXC on same machine)
The server auto-detects the Unix socket path:
Linux:
$XDG_RUNTIME_DIR/kpxc_serveror/run/user/<uid>/kpxc_servermacOS:
$TMPDIR/kpxc_serveror/tmp/kpxc_server
Remote (KeePassXC on a different machine)
When KeePassXC runs on a host and the MCP server runs in a VM/container, forward the socket over TCP.
On the host (where KeePassXC runs):
macOS:
socat TCP-LISTEN:19455,reuseaddr,fork UNIX-CONNECT:${TMPDIR}kpxc_serverLinux:
socat TCP-LISTEN:19455,reuseaddr,fork UNIX-CONNECT:${XDG_RUNTIME_DIR}/kpxc_serverWindows (native bridge — no dependencies):
A native C bridge is included in bridge/kpxc-bridge.c. It runs as a system tray application,
forwarding TCP connections to the KeePassXC named pipe
(\\.\pipe\org.keepassxc.KeePassXC.BrowserServer).
Install via the Windows installer (recommended):
Download kpxc-bridge-VERSION-setup.exe from
Releases. The installer:
Installs the bridge to
Program Files\KeePassXC BridgeAdds a Start Menu shortcut
Registers the bridge to start on login (HKCU Run key)
Creates a Windows Firewall rule for the configured TCP port
Starts the tray app immediately
Or run the standalone binary:
Download kpxc-bridge.exe from Releases.
kpxc-bridge.exe Run as tray app (default)
kpxc-bridge.exe -console Run in console mode (Ctrl+C to stop)
kpxc-bridge.exe -port 19455 Set TCP listen port (default: 19455)
kpxc-bridge.exe -bind 192.168.0.1 Bind to specific interface
kpxc-bridge.exe install Add to user startup (login)
kpxc-bridge.exe uninstall Remove from user startupThe tray icon indicates connection status (idle vs active) and logs to
kpxc-bridge.log next to the executable.
Build from source (cross-compile from any OS with Zig):
zig cc -O2 -target x86_64-windows-gnu bridge/kpxc-bridge.c bridge/resources/kpxc-bridge.rc \
-lws2_32 -ladvapi32 -lshell32 -luser32 -Wl,--subsystem,windows -o kpxc-bridge.exeThen configure the MCP server to connect via TCP (see environment variables below).
Windsurf Configuration
Add to ~/.codeium/windsurf/mcp_config.json:
Local socket
{
"mcpServers": {
"keepassxc": {
"command": "keepassxc-mcp",
"env": {}
}
}
}Remote via TCP
{
"mcpServers": {
"keepassxc": {
"command": "keepassxc-mcp",
"env": {
"KEEPASSXC_HOST": "192.168.0.1",
"KEEPASSXC_PORT": "19455"
}
}
}
}Environment Variables
Variable | Default | Description |
| (unset) | TCP host (enables TCP mode instead of Unix socket) |
| (unset) | TCP port |
| auto-detected | Unix domain socket path |
|
| Path to persistent association identity |
|
| Response timeout in milliseconds |
First Use
On the first tool call, the server will:
Connect to KeePassXC (socket or TCP)
Exchange ephemeral session keys
Request association — a dialog will appear in KeePassXC asking you to confirm
Store the association identity for future sessions
Subsequent connections reuse the stored identity (validated via test-associate).
Security Notes
All messages (except the initial key exchange) are encrypted with NaCl box (X25519 + XSalsa20-Poly1305)
The identity file at
~/.local/share/keepassxc-mcp/identity.jsonis created with mode0600Session keys are ephemeral — regenerated on every connection
The identity key is equivalent to what the browser extension stores; protect it accordingly
If using TCP forwarding, the NaCl encryption protects the payload, but consider using SSH tunneling for defense in depth
Donations
If you find this project useful, consider a small donation:
Currency | Address |
BTC |
|
LTC |
|
PEPE (Ᵽ) |
|
DOGE |
|
Known Limitations
The keepassxc-browser protocol has no search-by-title, list-all-entries, or filter-by-group action. get_logins requires a URL and only returns entries whose URL field matches. Entries without a URL, or with a URL you don't know, cannot be discovered programmatically.
This is a protocol-level constraint — the browser integration was designed for browser extensions that always operate in the context of a URL. keepassxc-cli supports richer queries but requires direct access to the database file, which is incompatible with remote/TCP deployments.
If you need to look up an entry, you must know (or guess) the URL stored on it.
Protocol Reference
This server implements the keepassxc-browser protocol.
License
BSD 2-Clause. See LICENSE.
Available Tools
8 toolsassociateA
Manually (re-)associate this MCP server with the KeePassXC database. A confirmation dialog will appear in KeePassXC. Usually not needed — association happens automatically on first use.
Inputs: no named parameters.
generate_passwordB
Generate a random password using KeePassXC's password generator. Note: this may open the KeePassXC password generator dialog on the host and wait for the user to confirm.
Inputs: no named parameters.
get_database_groupsA
List all groups (folders) in the KeePassXC database as a tree.
Inputs: no named parameters.
get_database_hashA
Get the SHA-256 hash of the current KeePassXC database. Useful for detecting if the database has changed.
Inputs: no named parameters.
get_loginsB
Retrieve saved credentials (username + password) from KeePassXC for a given URL. Returns all matching entries including login, password, name, and UUID.
Inputs: url (required), submitUrl.
get_totpA
Get the current TOTP (time-based one-time password) code for a KeePassXC entry. Requires the entry UUID (obtain via get_logins first).
Inputs: uuid (required).
lock_databaseA
Lock the currently open KeePassXC database.
Inputs: no named parameters.
set_loginB
Save or update credentials in KeePassXC. To update an existing entry, provide its uuid.
Inputs: url (required), login (required), password (required), uuid, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a clearly distinct action: retrieving logins, retrieving TOTP, saving logins, generating passwords, locking, listing groups, hashing, and associating. get_logins and get_totp are related but explicitly separated by the UUID requirement and output type. No two tools could be reasonably confused.
Most tools follow a consistent snake_case verb_noun pattern (get_logins, set_login, generate_password, lock_database, get_database_groups, get_database_hash). The lone 'associate' lacks a noun and is a minor deviation, but the overall convention is predictable.
Eight tools is well-scoped for a KeePassXC integration, covering credentials, TOTP, password generation, and database metadata. Each tool earns its place without excessive surface area.
Core read/create/update workflows exist, but there is no delete operation for entries, and group management is read-only (no create/delete groups). Additionally, there is no unlock tool despite lock_database being present. These are notable gaps for a password-manager lifecycle.
Maintenance
Related MCP Connectors
Approve Nostr signatures with your own browser signer without exposing a private key.
Web search, data extraction and controlled browser automation for AI assistants via OAuth.
Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.
Let AI agents use any website you're logged in to. Sessions stay encrypted on your machine.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Bitwarden/Vaultwarden for password and secure note management, including creation, updating, deletion, and search of items and folders.1-
- FlicenseBqualityDmaintenanceEnables secure retrieval of credentials from 1Password vaults for use by AI agents, supporting integration with browser automation for automated login.1-
- 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