Skip to main content
Glama
auth-vault

auth-vault

by borysttk

@mcp/auth-vault

MCP server for secure credential management, browser-based login automation, SSH key vault, TOTP/2FA auto-solving, and audit logging.

Status:  active    |    License: MIT    |    Version: 0.2.0

Overview

Auth Vault stores encrypted credentials, secrets, and SSH keys (AES-256-GCM), automates browser login flows via Playwright, auto-solves TOTP-based 2FA challenges, and tracks sensitive actions via an audit log. It provides both an MCP interface (for AI clients) and a Web UI dashboard (for manual management).

Interface

Port

URL

Web UI Dashboard

5600

http://<tailscale-ip>:5600/

MCP SSE

5501

http://<tailscale-ip>:5501/sse

MCP Health

5501

http://<tailscale-ip>:5501/health


Related MCP server: @aiwerk/mcp-server-vault

Features

  • Encrypted vault — credentials, secrets, and SSH keys stored with AES-256-GCM

  • SSH Key Vault — generate, store, retrieve, and export SSH keys (Ed25519, RSA-2048/4096)

  • SSH Config generation — export SSH config fragments and key files

  • Browser automation — Playwright-based login with form filling

  • CAPTCHA detection — automatic detection of CAPTCHA challenges during login

  • Trusted devices — device fingerprinting with trusted device management

  • TOTP/2FA auto-solve — RFC 6238 implementation, generates and submits 2FA codes

  • TOTP rotation detection — suggests code refresh when window is near expiry

  • QR code support — generate QR for Google Authenticator setup

  • Secrets management — API keys, bearer tokens, access/refresh tokens

  • Audit logging — JSONL audit log with auto-rotation for sensitive actions

  • Vault health monitoring — periodic integrity checks every 12 hours

  • Discovery API — metadata overview of all vault contents without decryption

  • Tailscale-only access — binds to Tailscale IP by default, blocks external traffic

  • Two service modes — STDIO (MCP standard) and SSE (HTTP for persistent connections)


Quick Start

Prerequisites

  • Node.js 22+

  • Playwright Chromium (installed via postinstall)

  • Tailscale (recommended for SSE mode)

Setup

# Install dependencies
pnpm install

# Build TypeScript
pnpm run build

# Configure environment
cp .env.example .env
# Edit .env: set VAULT_ENCRYPTION_KEY (64 hex chars) or leave empty for auto-generated

Configuration

All configuration via .env file or environment variables:

Variable

Default

Description

VAULT_ROOT

./vault

Storage directory for encrypted vault files

VAULT_ENCRYPTION_KEY

auto-generated

AES-256 key (64 hex chars, persist for data survival)

AUTH_SSE_PORT

—

Enable SSE mode on given port (empty = STDIO mode)

AUTH_BIND_ADDRESS

auto (Tailscale)

Explicit bind address for SSE mode

BROWSER_HEADLESS

true

Run Playwright in headless mode

BROWSER_TIMEOUT

30000

Browser operation timeout (ms)

AUDIT_LOG_MAX_BYTES

10485760

Audit log rotation threshold (10 MB)

LOG_LEVEL

info

Logging level: debug, info, warn, error


Usage

STDIO Mode (default for MCP clients)

node dist/index.js

SSE Mode (HTTP server for persistent connections)

# Set AUTH_SSE_PORT=5501 in .env, then:
node dist/index.js

Web UI Dashboard

node dist/web/server.js
# Dashboard at http://<tailscale-ip>:5600/

CLI Commands

Credentials

pnpm run add-creds       # Add credentials interactively
pnpm run list-creds      # List stored credentials (JSON)
pnpm run get-creds       # Get credential details (JSON)

Secrets

pnpm run add-secret      # Add a secret interactively
pnpm run list-secrets    # List stored secrets (JSON)

SSH Keys

pnpm run add-ssh-key       # Add existing SSH key interactively
pnpm run generate-ssh-key  # Generate new SSH key pair and store
pnpm run list-ssh-keys     # List stored SSH keys (JSON)
pnpm run get-ssh-key       # Get SSH key details (JSON)

REST API

Credentials

Method

Path

Description

GET

/api/credentials

List all credentials (metadata only)

GET

/api/credentials?includePassword=true

List all credentials (with passwords)

GET

/api/credentials/:id

Get credential details (password hidden by default)

POST

/api/credentials

Create a new credential

PUT

/api/credentials/:id

Update a credential

DELETE

/api/credentials/:id

Delete a credential

GET

/api/credentials/:id/devices

List trusted devices

POST

/api/credentials/:id/devices/add

Add a trusted device

DELETE

/api/credentials/:id/devices/:fingerprint

Remove a trusted device

GET

/api/credentials/:id/audit

Audit log entries for a credential

POST

/api/credentials/:id/trust-device

Shortcut to add a trusted device

Secrets

Method

Path

Description

GET

/api/secrets

List all secrets (metadata only)

POST

/api/secrets

Create a new secret

DELETE

/api/secrets/:id

Delete a secret

GET

/api/secrets/:id/detail

Get decrypted secret value

SSH Keys

Method

Path

Description

GET

/api/ssh

List all SSH keys

GET

/api/ssh/:id

Get SSH key details (private key hidden by default)

POST

/api/ssh

Store an SSH key

PUT

/api/ssh/:id

Update an SSH key

DELETE

/api/ssh/:id

Delete an SSH key

POST

/api/ssh/generate

Generate and store a new SSH key pair

GET

/api/ssh/:id/config

Get SSH config fragment

POST

/api/ssh/extract

Extract public key from private key

POST

/api/ssh/:id/rotate

Generate new key pair for existing entry

GET

/api/ssh/:id/public

Get public key in plain text

TOTP / 2FA

Method

Path

Description

GET

/api/totp/generate

Generate a new TOTP secret with QR code

POST

/api/totp/verify

Verify a TOTP code (returns rotationSuggested if near expiry)

POST

/api/totp/attach

Attach a TOTP secret to a credential

POST

/api/totp/regenerate

Replace TOTP secret on an existing credential

GET

/api/totp/:id/next-code

Get current + next TOTP codes

GET

/api/totp/:id/rotation-info

Get TOTP rotation status

Login Automation

Method

Path

Description

POST

/api/login/:id

Start automated login (returns needsCaptcha, needs2FA, trustedDevice, retryCount)

POST

/api/login/:id/2fa

Submit 2FA code during login

GET

/api/login/status/:sessionId

Check login session status

POST

/api/login/:id/cancel

Cancel an active login session

GET

/api/login/sessions

List active login sessions

GET

/api/login/:id/fallback

Get recovery options (TOTP recovery, backup codes)

Discovery

Method

Path

Description

GET

/api/discovery/overview

Metadata overview of all vault entries (no decryption)

GET

/api/discovery/stats

Aggregate statistics (counts by type, TOTP status)

GET

/api/discovery/recent

Recent activity (last 10 audit entries + updated credentials)

Audit

Method

Path

Description

GET

/api/audit/actions

List audit log entries (newest first)

POST

/api/audit/actions

Manually log an action

GET

/api/audit/summary

Activity summary for last 24 hours

GET

/api/audit/services

Services with audit activity

Health

Method

Path

Description

GET

/health

Service health check

GET

/api/health/integrity

Vault file integrity validation

GET

/api/health/summary

Combined health (integrity + storage stats + audit stats)


Systemd Services

# MCP SSE server (port 5501)
systemctl status mcp-auth-vault

# Web UI dashboard (port 5600)
systemctl status mcp-auth-vault-web

Both services restart automatically on failure and enable at boot.


Security

  • AES-256-GCM encryption for all stored credentials, secrets, and SSH keys

  • Tailscale-restricted — Web UI and SSE mode block non-Tailscale connections

  • Encryption key persisted in .env — if lost, data cannot be recovered

  • Headless browser — no visible UI during automated logins

  • Audit logging — all sensitive actions logged to append-only JSONL file

  • Vault integrity — periodic validation every 12 hours

  • Private key material — SSH private keys encrypted at rest, never exposed in list endpoints


Project Structure

src/
├── index.ts              # MCP server entry (STDIO + SSE)
├── config.ts             # Zod-validated configuration
├── credentials/
│   ├── totp.ts           # TOTP (RFC 6238) implementation
│   ├── qr.ts             # QR code generation + TOTP secret generator
│   ├── vault.ts          # Encrypted credential store
│   └── types.ts          # Credential type definitions
├── ssh/
│   ├── vault.ts          # Encrypted SSH key store
│   ├── generator.ts      # SSH key pair generation (Ed25519, RSA)
│   └── types.ts          # SSH key type definitions
├── secrets/
│   ├── manager.ts        # Encrypted secrets store
│   └── types.ts          # Secret type definitions
├── audit/
│   ├── log.ts            # JSONL audit log with auto-rotation
│   └── health.ts         # Vault integrity check module
├── authVault/
│   └── fingerprint.ts    # Trusted device fingerprinting
├── browser/
│   └── manager.ts        # Playwright session management
├── services/
│   └── definitions.ts    # Login templates (Google, etc.)
├── web/
│   ├── server.ts         # Web UI HTTP server + REST API
│   └── dashboard.ts      # HTML dashboard template
├── tools/
│   ├── credentials.ts    # MCP tool definitions for credentials
│   ├── ssh.ts            # MCP tool definitions for SSH keys
│   ├── secrets.ts        # MCP tool definitions for secrets
│   ├── services.ts       # MCP tool definitions for services
│   ├── login.ts          # MCP tool definitions for login
│   ├── audit.ts          # MCP tool definitions for audit/health
│   └── totp.ts           # MCP tool definitions for TOTP
└── cli/
    ├── add-credentials.ts
    ├── add-secret.ts
    ├── add-ssh-key.ts
    ├── generate-ssh-key.ts
    ├── get-ssh-key.ts
    ├── list-ssh-keys.ts
    ├── list-credentials.ts
    ├── list-secrets.ts
    └── get-credential.ts

Tech Stack

  • Runtime: Node.js 22+, TypeScript ESM

  • MCP: @modelcontextprotocol/sdk v1.16

  • Encryption: Node.js crypto (AES-256-GCM)

  • Browser: Playwright (Chromium)

  • Config: Zod validation

  • UI: Vanilla JS (no framework)

  • QR: qrcode npm package


License

MIT

Available Tools

32 tools
add_serviceB

Register a custom service login template at runtime

Inputs: id (required), label (required), loginUrl (required), usernameSelector (required), +4 more.

browser_closeA

Close a browser session

Inputs: sessionId (required).

browser_launchC

Launch a new browser session for logging into a service

Inputs: service (required), headless.

browser_navigateB

Navigate the browser to a URL within an active session

Inputs: sessionId (required), url (required).

check_sessionA

Check if a browser session is still active and optionally verify login status

Inputs: sessionId (required), verifyLogin.

click_submitC

Click the submit button on the login form (useful after captcha solving)

Inputs: sessionId (required), service (required).

delete_credentialsB

Permanently delete stored credentials by ID

Inputs: id (required).

delete_secretB

Permanently delete a stored secret by ID

Inputs: id (required).

detect_2faB

Check the current page for a 2FA code challenge

Inputs: sessionId (required), service.

detect_captchaC

Check the current page for captcha challenges

Inputs: sessionId (required).

generate_qrA

Generate a Google Authenticator QR code for a stored credential's TOTP secret

Inputs: credentialId (required).

get_credentialsC

Retrieve stored credentials by ID. Returns decrypted username and password.

Inputs: id (required), includePassword.

get_credentials_for_serviceB

Get all credentials for a specific service

Inputs: service (required), includePasswords.

get_secretA

Retrieve a stored secret by ID (returns decrypted value)

Inputs: id (required).

get_service_templateB

Get detailed login template for a specific service

Inputs: service (required).

list_credentialsC

List stored credentials, optionally filtered by service

Inputs: service.

list_secretsB

List stored secrets, optionally filtered by service or kind

Inputs: service, kind.

list_servicesA

List all supported services with their login templates

Inputs: no named parameters.

list_sessionsA

List all active browser sessions

Inputs: no named parameters.

login_serviceC

Automate login to a service using stored credentials. Launches browser, fills form, handles captcha.

Inputs: sessionId (required), credentialId (required), solveCaptcha.

solve_2faA

Generate a TOTP code from the stored secret and fill it into the 2FA input field

Inputs: sessionId (required), credentialId (required), service.

solve_captchaB

Solve a detected captcha on the current page using configured captcha service

Inputs: sessionId (required), apiKey.

store_credentialsB

Store login credentials for a service securely with AES-256-GCM encryption

Inputs: service (required), label (required), username (required), password (required), +2 more.

store_secretB

Store an API key, access token, or other secret encrypted with AES-256-GCM

Inputs: label (required), kind (required), service (required), value (required), +5 more.

test_all_servicesA

Test all registered service templates — check if login pages are reachable

Inputs: no named parameters.

test_browser_cdpB

Test Chrome DevTools Protocol connectivity — verify CDP endpoint is reachable

Inputs: port, host.

test_credentialB

Test if credentials exist in vault and validate their structure (returns non-sensitive info only)

Inputs: id, service.

test_secret_expiryA

Check all secrets for expiration — identifies expired, expiring soon, or valid secrets

Inputs: warningDays, service.

test_service_selectorB

Test if a CSS selector works on a service's login page (launches browser, checks selector matches)

Inputs: service (required), selectorType, selectorOverride.

test_session_integrityC

Check if browser sessions are alive and can interact with pages

Inputs: sessionId.

test_totpC

Verify TOTP secret by generating a current code and optionally checking against expected value

Inputs: credentialId (required), expectedCode.

vault_healthB

Comprehensive health check of the auth-vault system — encryption, storage, services, sessions

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 32 tools

    Disambiguation4/5

    Most tools have distinct purposes (credential management, browser automation, captcha/2FA, testing), but some overlap exists between test_* tools and session checks (e.g., test_session_integrity vs check_session), causing minor confusion.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, with clear prefixes (browser_, test_, get_, store_, etc.), making the set predictable and easy to navigate.

    Tool Count2/5

    With 32 tools, the server is over-scoped. Many testing and health tools could be consolidated, and the core authentication/secret operations could be separated into a smaller, focused set.

    Completeness3/5

    Core operations for credentials and secrets are present (store, retrieve, delete), but missing update functionality means agents cannot modify existing entries, creating a workflow gap.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for agent-native secrets management that stores encrypted secrets with AES-256-GCM, issues short-lived scoped tokens, and injects secrets into requests server-side so agents never handle plaintext credentials.
      57 npm
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      MCP server for secure AI agent access to Bitwarden/Vaultwarden vaults with BYOK, exposing tools to list items, reveal secrets via encrypted Sends, get TOTP codes, and save credentials.
      7
      274 npm
      MIT