Skip to main content
Glama
credential-use-mcp

credential-use-mcp

by aorizondo

credential-use-mcp

An MCP server that lets an AI agent manage and use passwords, tokens and API keys, with your approval at every step and, whenever possible, without seeing them.

  • Credentials live in a KeePassXC / KeePass (KDBX) file you can open and edit yourself.

  • When a task needs a secret, the agent asks for it with cred_add: you type it in a form or a web page, and it goes straight to the file. The agent only learns the name, kind, host and username.

  • The agent can run the whole CRUD itself: what it proposes (even a secret it already has, such as a password it generated) comes prefilled in the form, and you check or edit it before submitting. Reading a secret (cred_reveal) needs your approval each time.

  • To call an API, the agent opens a local proxy (proxy_open). You approve it for some minutes and/or a number of requests; the agent sends requests to http://127.0.0.1:<port> and the proxy adds the authentication. The secret never enters the conversation.

  • An MCP event, credentials.changed, fires when a credential is added, updated or removed (also when you edit the file in KeePassXC).

  • The server tells the agent how to use it (MCP instructions) and ships a skill with worked examples.

It speaks stdio and both MCP protocol eras (2026-07-28 and 2025), so it works with OpenCode, Claude Code, Hermes, VS Code and any client that supports elicitation (forms).

Quick start

Requires Node 22 or later.

// OpenCode (opencode.json)
{
  "mcp": {
    "servers": {
      "credential-use": {
        "type": "local",
        "command": ["npx", "-y", "credential-use-mcp"],
        "environment": {
          "CREDUSE_KDBX_PATH": "~/.config/credential-use/credentials.kdbx",
          "CREDUSE_KDBX_PASSWORD_FILE": "~/.config/credential-use/password"
        }
      }
    }
  }
}
# Claude Code
claude mcp add credential-use -e CREDUSE_KDBX_PASSWORD_FILE=~/.config/credential-use/password -- npx -y credential-use-mcp

The file is created on first use if it does not exist. Put the master password in a file only you can read (chmod 600), or pass it in CREDUSE_KDBX_PASSWORD.

Then ask the agent something like "store my GitHub token and list my repos".

Related MCP server: keymaster-mcp

Tools

Tool

What it does

cred_list

Names, kinds, hosts and usernames of the stored credentials. Never a secret.

cred_add

A new credential, in a form prefilled with what the agent proposes (name, kind, URL, username, header, notes, and the secret only if it already has it). Without a proposed secret you type it.

cred_edit

Changes one: the form shows its public fields plus the agent's proposed changes. An empty secret keeps it.

cred_remove

Deletes one after you confirm.

cred_reveal

Gives the agent a secret's value, after you approve that one read (you see its reason).

proxy_open

Opens a local proxy to an HTTP credential's service, after your approval.

proxy_list

Open proxies and approvals still valid.

proxy_close

Closes a proxy and ends its approval.

Credential kinds and what the proxy sends:

Kind

Header

http-bearer

Authorization: Bearer <secret>

http-basic

Authorization: Basic <username:secret>

api-key

<header>: <secret> (header name defaults to x-api-key)

generic

bearer, or basic when it has a username

ssh, database

stored, but not proxied yet

How you are asked: form or page

Mode

What you see

Secret while typing

form

A form inside your agent app

Visible

url

A link to a page served by this server, with a real password field

Hidden

CREDUSE_SECRET_INPUT picks the one you prefer. If your client cannot show it (or the page cannot be served), the other one is used. Pages live on 127.0.0.1, use a random single-use link that expires in thirty minutes, and the answer goes straight to this process. For an agent on another machine, CREDUSE_URL_ACCESS=opentunnel (or both) also publishes the page on an OpenTunnel route.

Approvals

Nothing is stored, changed, deleted or revealed until you submit the form or page. When the agent proposes a secret, it is shown in clear (the agent already knows it) so you can check it; a secret you type stays hidden on the page and is never shown to the agent. The answer tells the agent whether you kept its proposed secret, never the value you typed instead.

proxy_open asks you, every time there is no valid approval for that credential:

  • allow for some minutes, for a number of requests, or both;

  • allow one request;

  • deny.

While an approval lasts, proxy_open returns the same proxy without asking, and every request through the proxy uses one. When it runs out the proxy answers 403 and the agent must call proxy_open again. Approvals and proxies live in memory: they end with the server process (your agent session). A proxy also closes when its credential is changed or removed.

The proxy only reaches the credential's own origin (scheme, host and port), drops the agent's Authorization, Cookie and Proxy-Authorization headers, and replaces the secret with [REDACTED] if a text response echoes it.

Configuration

All settings are environment variables.

Variable

Default

Meaning

CREDUSE_KDBX_PATH

~/.config/credential-use/credentials.kdbx

The KDBX file

CREDUSE_KDBX_PASSWORD

Master password

CREDUSE_KDBX_PASSWORD_ENV

Name of another variable that holds the master password

CREDUSE_KDBX_PASSWORD_FILE

File whose first line is the master password

CREDUSE_KDBX_KEYFILE

KeePass key file (alone or with a password)

CREDUSE_KDBX_GROUP

credential-use

Group where new entries go

CREDUSE_KDBX_CREATE

true

Create the file when missing

CREDUSE_MIN_SECRET_LENGTH

6

Shorter secrets are refused

CREDUSE_SECRET_INPUT

form

Preferred way to ask: form or url

CREDUSE_URL_ACCESS

loopback

Where pages are offered: loopback, opentunnel, both

CREDUSE_APPROVAL_MINUTES

15

Minutes proposed when approving a proxy

CREDUSE_APPROVAL_USES

0

Requests proposed (0: propose a time limit only)

One of the password, password file or key file is required; without it every tool explains what to set.

Entries in the file

Each credential is an entry whose title is its name: username, password (the secret), URL and notes are the standard fields. The kind is the custom field apex:kind and the API-key header the custom field header (compatible with files created by opencode-apex). You can edit entries in KeePassXC; the server notices and emits credentials.changed.

Events

With the MCP Events extension (protocol 2026-07-28) a client can subscribe to credentials.changed (events/stream, arguments { action?, name? }). In OpenCode it can trigger an automation:

{ "type": "event", "server": "credential-use", "event": "credentials.changed", "args": { "action": "added" } }

Security notes

  • In form mode the secret is visible on screen while you type, and passes through your agent app's memory (never the model). Use url mode to type it in a hidden field.

  • The KDBX file is written atomically with mode 0600. Keep its password out of config files and shell history: prefer CREDUSE_KDBX_PASSWORD_FILE, or CREDUSE_KDBX_PASSWORD_ENV naming a variable your agent app already has (local MCP servers inherit its environment).

  • Anything that can reach 127.0.0.1 on your machine can use an open proxy while its approval lasts. Keep approvals short on shared machines.

  • Responses from the proxied API reach the agent as they are (except the secret itself, scrubbed).

Development

npm install
npm test          # end-to-end over stdio (Bun), build, smoke test of the build under Node
npm run typecheck

License

MIT

Available Tools

8 tools
cred_addAdd a credential (the user confirms)A

Store a new password, token or API key. Everything you pass comes prefilled in a form or page the user checks, edits and submits; nothing is stored until then. Without secret the user types it, so you never see it: do that whenever a task needs a secret the user has not stored, and never ask for one in the chat. Pass secret only when you already have it (you generated it, or the user gave it to you). You get public metadata back; then use the credential through proxy_open.

Inputs: url, kind, name, notes, +3 more.

cred_editEdit a credential (the user confirms)A

Change a stored credential. The form comes prefilled with its public fields plus the changes you propose (rename, kind, URL, username, header, notes, and a new secret only if you already have it); the user checks, edits and submits. Propose nothing to let the user make the changes. The stored secret is never shown to you.

Inputs: name (required), url, kind, notes, +4 more.

cred_listList stored credentialsA
Read-onlyIdempotent

List the stored credentials: name, kind, host and username only, never a secret.

Inputs: no named parameters.

cred_removeDelete a credential (the user confirms)A
DestructiveIdempotent

Delete a stored credential after the user confirms it.

Inputs: name (required).

cred_revealRead a credential's secret (the user approves each time)A
Read-only

Get a stored secret's value, after the user approves this one read (they see your reason). Use it only when the secret itself is needed (a CLI flag, a config file) and proxy_open cannot do the job; for HTTP APIs use proxy_open. Do not repeat the value in your messages or write it anywhere it is not needed.

Inputs: name (required), reason (required).

proxy_closeClose a proxyA
Idempotent

Close a proxy (by credential name or proxy id) and, unless keepApproval is true, end its approval.

Inputs: credential (required), keepApproval.

proxy_listList open proxiesA
Read-onlyIdempotent

List the open proxies (URL, target, requests made) and the approvals still valid.

Inputs: no named parameters.

proxy_openOpen an authenticated proxy (asks the user)A
Idempotent

Open a local proxy to a stored HTTP credential's service: requests to the returned http://127.0.0.1 URL reach the service with the credential's authentication added, so you never handle the secret. The user approves it for some minutes and/or requests; while that lasts, calling it again returns the same proxy without asking.

Inputs: credential (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 8 tools

    Disambiguation5/5

    The set splits cleanly into two namespaced groups: cred_* for credential CRUD/reveal and proxy_* for proxy lifecycle. Within each group every tool targets a distinct action, and the descriptions explicitly resolve the only potential confusion (cred_reveal vs proxy_open) by stating when each should be used.

    Naming Consistency5/5

    All eight tools follow a uniform snake_case prefix_verb pattern (cred_list, cred_add, cred_edit, cred_remove, cred_reveal, proxy_list, proxy_open, proxy_close). The two prefixes map predictably to the two resource families.

    Tool Count5/5

    Eight tools is well-scoped for a credential vault plus proxy surface, with no redundant or filler tools. Each tool earns its place in a clear lifecycle.

    Completeness4/5

    Credential lifecycle (list/add/edit/remove/reveal) and proxy lifecycle (list/open/close) are both covered, with no dead ends for core workflows. Minor gaps exist, such as no standalone way to inspect or revoke a single approval beyond closing its proxy, but these are workaroundable.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to search, create, and update password vault entries, manage folders and sharing permissions, while delivering secrets to a configured server-side handler.
      1
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      23
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to list entries and metadata, run commands with secrets injected as environment variables while scrubbing every value from the output, copy secrets straight to the clipboard, and generate or store new secrets without their plaintext ever entering the conversation. Obvious dumpers are refused and destructive edits require explicit confirmation, closing off accidental exposure paths.
      35 PyPI
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to request passwords, API keys, passkeys, and other secrets from a person through one-time links encrypted in the browser, then store them in a local vault the agent can use without ever seeing them. Secrets can be referenced in commands and outputs are redacted, so agents can sign in or call APIs without exposing credentials in chat.
      MIT