Skip to main content
Glama
bradley-t-t

cryptofort

by bradley-t-t

Why CryptoFort

Secrets sprawl across .env files, shell history, and plaintext columns — and agents have no safe, structured way to ask for them. CryptoFort seals every secret with authenticated encryption, keeps the key out of the database entirely, and hands agents an MCP interface that returns metadata and nothing else. A conversational agent keeps whatever it is told, so the value itself is reached by a process that runs one operation with it, not by the agent that decided to run it.

Related MCP server: MCP-Secrets-Vault

Stack

Layer

Technology

Language

TypeScript 5, ESM-first with a CJS build

Encryption

Web Crypto (crypto.subtle) — AES-256-GCM, 32-byte key from the environment

Validation

Zod 4 (MCP tool schemas)

Agent interface

@modelcontextprotocol/sdk over stdio, metadata-only by default

Backends

@supabase/supabase-js, postgres, or better-sqlite3 — all optional peers

Build

tsup (ESM + CJS + .d.ts)

Tests

Vitest

Runtime

Node 20 or newer

Getting started

Install

npm install cryptofort
# plus the driver for your backend:
npm install @supabase/supabase-js   # or: better-sqlite3 | postgres
# and, to run the MCP server:
npm install @modelcontextprotocol/sdk

Every driver — and the MCP SDK — is an optional peer dependency, so nothing is pulled in that you do not use. Requires Node 20 or newer.

CryptoFort is also published to GitHub Packages as @bradley-t-t/cryptofort. Point the @bradley-t-t scope at the GitHub registry and authenticate with a token that has read:packages — GitHub Packages requires auth even for public packages:

@bradley-t-t:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
npm install @bradley-t-t/cryptofort

Documentation

The rest of this page is the tour. docs/ is the manual.

Page

Covers

Getting started

Install, generate a key, store and read a credential, wire up an MCP client.

Configuration

Every environment variable, and what CryptoFort refuses to accept.

Library API

Vault, Crypto, the adapters, and every exported type.

MCP server

The six tools, the three permission flags, and client configuration.

Backends

Supabase, Postgres, and SQLite — setup, schema, and how they differ.

Security model

The threat model, key rotation, and what is deliberately not protected.

Troubleshooting

Every error CryptoFort raises, what it means, and how to clear it.

Library usage

import { Vault, Crypto, SqliteAdapter } from 'cryptofort';

const adapter = new SqliteAdapter('vault.db');
await adapter.init();

const vault = new Vault({
  adapter,
  crypto: new Crypto({ key: process.env.CRYPTOFORT_MASTER_KEY! }),
});

await vault.put({
  name: 'stripe-secret-key',
  secret: 'sk_live_…',
  provider: 'stripe',
  tags: ['payments'],
});
await vault.search('stripe'); // metadata only — never the secret
await vault.get('stripe-secret-key'); // the decrypted secret

CryptoFort encrypts only the secret field. name, description, provider, tags and metadata stay plaintext so search works without the master key. Never put a secret in one of them. Getting started covers generating the master key, expiry, and namespaces.

MCP server

The MCP server needs @modelcontextprotocol/sdk installed alongside CryptoFort. Point any MCP client at the cryptofort-mcp binary:

{
  "mcpServers": {
    "cryptofort": {
      "command": "cryptofort-mcp",
      "env": {
        "CRYPTOFORT_ADAPTER": "supabase",
        "SUPABASE_URL": "https://<ref>.supabase.co",
        "SUPABASE_SERVICE_ROLE_KEY": "<service-role-key>",
        "CRYPTOFORT_MASTER_KEY": "<base64-32-bytes>"
      }
    }
  }
}

The server serves metadata only by default: it can say what the vault holds, and nothing that would tell you a secret. Three flags widen that, and they are separate because they answer different questions.

  • "args": ["--allow-secret-read"] exposes credential_get, which returns a decrypted secret to whoever called it. Give it to a process that will use the value and exit — not to an agent whose conversation is written to disk, because a secret handed to one stays in that transcript for as long as the transcript does.

  • "args": ["--allow-write"] exposes credential_put and credential_purge_expired. A put can be put again, and a purge only removes what an expiry had already killed.

  • "args": ["--allow-delete"] exposes credential_delete. It is separate because it is the one call the vault cannot answer for afterwards: the secret is gone and no copy is kept.

With no flag the server registers only credential_search and credential_list. The MCP server page documents all six tools, and the configuration page every environment variable.

Architecture

flowchart TD
    A["Agent / MCP client"] -->|"stdio"| M["cryptofort-mcp — read-only by default"]
    App["Your app"] --> V["Vault"]
    M --> V
    V --> C["Crypto — AES-256-GCM"]
    C -->|"master key from env, never stored"| K["CRYPTOFORT_MASTER_KEY"]
    V --> AD["Adapter"]
    AD --> S[("Supabase")]
    AD --> P[("Postgres")]
    AD --> Q[("SQLite")]

Contributing

Branch off develop, open the pull request against develop, and run what CI runs before you push:

npm ci
npm run format:check && npm run lint && npm run typecheck && npm test && npm run build

CONTRIBUTING.md covers the rest: the checks, the branch flow, and how to add a backend adapter or an MCP tool.

Security

Report a vulnerability through a private security advisory, never a public issue. SECURITY.md has the process, and the security model says what CryptoFort protects and what it deliberately does not.

License

Released under the MIT License.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP-native credential vault that enables AI agents to authenticate with external services without exposing secrets, supporting bearer, basic, OAuth2, and other auth patterns via MCP tools.
    0
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    An encrypted credential vault for MCP clients that stores and uses sensitive material without exposing values to the model, enabling secure command execution, HTTP requests, and template rendering.
    2 npm
    1
    MIT
  • 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.
    20 npm
    MIT