Skip to main content

MCP server for mounting and unmounting VeraCrypt containers with secure password handling

Project description

veracrypt-mcp

MCP (Model Context Protocol) server for mounting and unmounting VeraCrypt containers, with a security-first approach to password handling.

Once a container is mounted, your MCP client (e.g. Claude Code) can read and edit the files inside it with its normal file tools. Say "mount my vault", work on the files, then "unmount my vault".

mcp-name: io.github.bitterdev/veracrypt-mcp

Features

  • mount_container: mount a VeraCrypt container (optional mount point, PIM, read-only)
  • unmount_container: dismount by container path or mount point
  • list_mounted_containers: show all mounted VeraCrypt volumes
  • Default vault: configure your container once via environment variables; "mount my vault" then works without any arguments

Security model

The volume password is never passed as a command line argument. Command line arguments are visible to every process on the machine (ps aux), so this server always pipes the password to VeraCrypt via stdin using VeraCrypt's official --stdin option.

There are two password sources:

1. OS keyring (recommended)

Store the password once in the OS keyring. The MCP tool then only receives a keyring account name, so the password never enters the LLM context, chat logs, or transcripts.

macOS (Keychain):

security add-generic-password -s veracrypt-mcp -a my-container -w
# you will be prompted for the password interactively

Linux (libsecret / GNOME Keyring, requires libsecret-tools):

secret-tool store --label="veracrypt-mcp my-container" service veracrypt-mcp account my-container

Then mount with keychain_account: "my-container".

2. Direct password (fallback)

You can pass password directly to the tool. It is still piped via stdin to VeraCrypt (never visible in the process list), but it passes through the LLM conversation and may be stored in chat logs. Use the keyring source whenever possible.

Additional notes:

  • Passwords are never logged and never included in tool results or error messages.
  • Python cannot securely wipe strings from memory; for maximum security, use the keyring source and a dedicated container password.

Requirements

  • Python >= 3.10
  • VeraCrypt with the command line binary available (veracrypt on PATH, the macOS app bundle, or set VERACRYPT_PATH)
  • macOS: macFUSE (required by VeraCrypt for mounting)
  • Linux keyring source: libsecret-tools (secret-tool)

Installation

pip install git+https://github.com/bitterdev/veracrypt-mcp.git

Or from a local clone:

git clone https://github.com/bitterdev/veracrypt-mcp.git
cd veracrypt-mcp
pip install .

Configuration

Claude Code

claude mcp add veracrypt -- veracrypt-mcp

With a default vault (recommended):

claude mcp add veracrypt \
  -e VERACRYPT_MCP_CONTAINER="/path/to/vault.hc" \
  -e VERACRYPT_MCP_KEYCHAIN_ACCOUNT="my-vault" \
  -- veracrypt-mcp

Claude Desktop / generic MCP client

{
  "mcpServers": {
    "veracrypt": {
      "command": "veracrypt-mcp",
      "env": {
        "VERACRYPT_MCP_CONTAINER": "/path/to/vault.hc",
        "VERACRYPT_MCP_KEYCHAIN_ACCOUNT": "my-vault"
      }
    }
  }
}

The server runs over stdio.

Usage examples

With a configured default vault:

Mount my vault

Unmount my vault

Explicit, without defaults:

Mount the container /Users/me/secret.hc using the keychain account "my-container"

Mount read-only at a specific mount point:

Mount /Users/me/secret.hc read-only at ~/mnt/secret, keychain account "my-container"

Environment variables

Variable Description
VERACRYPT_MCP_CONTAINER Default container path used when no container_path is given
VERACRYPT_MCP_KEYCHAIN_ACCOUNT Default keyring account used when no password source is given
VERACRYPT_MCP_MOUNT_POINT Default mount directory (otherwise VeraCrypt auto-selects)
VERACRYPT_PATH Absolute path to the VeraCrypt binary if it is not on PATH

License

MIT, see LICENSE.

Author

Fabian Bitter (fabian@bitter.de)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

veracrypt_mcp-0.2.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

veracrypt_mcp-0.2.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file veracrypt_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: veracrypt_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for veracrypt_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a0871d4bdb4e27512b2692e6d9438cc4b42c0690537bdc2fa14a87109b311748
MD5 219b269b1ad8fa332253dfe70311d8fb
BLAKE2b-256 7ea07cda628dd7d4bb632a41b0412c37fefc546620cf76cfae5884a96f9a45f4

See more details on using hashes here.

File details

Details for the file veracrypt_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: veracrypt_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for veracrypt_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69464d6c8d9a6d267eaa294d64fa9b440443ae8dfd37ae9a14cf82d06edc4b1c
MD5 4468601cde1357d90e0bb0e59510b58a
BLAKE2b-256 b497d9324a2c6c36f7a82be8a54ad31d40f876167a8656c0d755e8108462ba22

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page