MCP server for creating and managing SOPS-encrypted secrets
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
MCP server for creating and managing SOPS-encrypted secret files using age encryption.
Designed for Claude Code (or any MCP client) to produce encrypted secrets.enc.yaml files without the model ever seeing plaintext values. All file content is passed as text parameters and returned as text β the server has no filesystem access to the client.
Two goals drive the design:
1. Keep secrets in your source tree without leaking them. For a small project, running a full secrets manager (Vault, AWS Secrets Manager, etc.) is overkill for a handful of credentials. Encrypting secrets at rest in git and decrypting them in your CI/CD pipeline at deploy time is much cheaper:
secrets.enc.yaml via this server β age-encrypted against your public key, safe to commit.The age private key lives in exactly one place: your CI/CD secrets store. Everywhere else β your laptop, your git remote, your container images β sees only ciphertext. See the worked example below.
2. Let an AI coding agent generate secrets it can never read. Claude (or any MCP client) can create passwords, rotate them, derive hashes, rename and delete them β but plaintext values never cross the MCP boundary back to the model. The server holds the encryption key; the client only submits requests and receives metadata. There is deliberately no "decrypt this one secret" tool. If a prompt injection or a misbehaving agent tried to exfiltrate a secret via tool output, there is no tool output to exfiltrate.
This pattern assumes a single age recipient (the one CI private key). For multi-recipient / team key management, use the sops CLI directly for recipient rotations and this server for content management.
Three ideas shape the tool surface:
sops decrypt yourself with the age private key._meta_unencrypted block sits alongside the encrypted values (using SOPS's unencrypted_suffix feature) and records each secret's source, how it was generated, and when it was last rotated. This lets the server list and rotate secrets without decrypting.sops_update_external.Every secret is one of three sources, recorded in _meta_unencrypted:
generated β Cryptographically random values (Python secrets / OS CSPRNG). You specify length and charset; the server stores both so it can regenerate on rotation.external β User-provided values encrypted as-is (SMTP credentials, third-party API keys, etc.). Preserved across rotation. Updated via sops_update_external.derived β Computed from another key in the same file via a named transform. When the source is rotated (or an external source is updated), the derived value is automatically recomputed in topological order. Useful for things like Authelia's PBKDF2 hashes of OIDC client secrets.derived secrets)| Transform | Purpose | Deterministic |
|---|---|---|
pbkdf2_sha512_authelia | PBKDF2-SHA512 hash in Authelia's configuration.yml format ($pbkdf2-sha512$310000$...) | No β random salt per call |
sha256_hex | Hex-encoded SHA-256 digest | Yes |
| Tool | What it does |
|---|---|
sops_create_secrets | Create a new encrypted file with one or more secrets (any mix of sources). |
sops_list_secrets | List keys, sources, and descriptions from a file without decrypting. |
sops_create_oidc_secret | Convenience: create an Authelia OIDC client secret as a generated + derived (pbkdf2_sha512_authelia) pair in one call. The hash is returned in the response for pasting into configuration.yml. |
SOPS_AGE_KEY)| Tool | What it does |
|---|---|
sops_rotate_generated | Regenerate all generated secrets. Derived secrets whose source was rotated are recomputed; others are preserved. External secrets are preserved. |
sops_add_secrets | Add new secrets to an existing file. Supports all three sources. Rejects collisions with existing keys. |
sops_update_external | Replace the value of an external secret. Cascades to any derived secrets that reference it. Rejects attempts to update generated or derived. |
sops_rename_secret | Rename a key, preserving its value and metadata. Updates from: references in any derived secrets. |
sops_delete_secrets | Remove one or more keys. Rejects deleting a secret that another derived secret still references (unless the dependent is deleted in the same call). |
sops_add_metadata | Retrofit _meta_unencrypted onto a legacy SOPS file that lacks it. Supports generated, external, and derived entries. |
If you don't already have one, install age and run:
The file looks like:
age1...) β pass to this server as SOPS_MCP_AGE_PUBLIC_KEY. Safe to share anywhere.AGE-SECRET-KEY-...) β store as a CI/CD secret (commonly named SOPS_AGE_KEY). Never commit to source control. Anyone with this key can decrypt every secrets.enc.yaml encrypted to the matching public key.Back up the private key somewhere safe (password manager, hardware token). Losing it means losing access to every secret you've encrypted.
Add to your project's .mcp.json:
| Variable | Required | Purpose |
|---|---|---|
SOPS_MCP_AGE_PUBLIC_KEY | Yes* | Age public key for encryption |
SOPS_AGE_RECIPIENTS | Yes* | Alternative to SOPS_MCP_AGE_PUBLIC_KEY |
SOPS_MCP_SOPS_BINARY | No | Path to sops binary (default: sops) |
SOPS_MCP_LOG_LEVEL | No | Log level (default: WARNING) |
SOPS_AGE_KEY | Sometimes | Age private key β required for any mutation tool (rotate, add, update, rename, delete) |
SOPS_MCP_TRANSPORT | No | stdio (default) or sse |
SOPS_MCP_HOST / SOPS_MCP_PORT | No | Bind host/port for SSE transport (default: 127.0.0.1:55090). Binding to 0.0.0.0 requires SOPS_MCP_API_TOKEN β the server refuses to start otherwise. |
SOPS_MCP_ALLOWED_HOSTS | No | Comma-separated allowlist for the SSE Host header (DNS rebinding protection). Default: 127.0.0.1,127.0.0.1:*,localhost,localhost:*. Set explicitly when binding to a non-loopback address β e.g. mcp.example.com,mcp.example.com:*. |
SOPS_MCP_API_TOKEN | Sometimes | Required when SSE transport binds to 0.0.0.0; otherwise optional. When set, SSE requires Authorization: Bearer <token>. |
* One of SOPS_MCP_AGE_PUBLIC_KEY or SOPS_AGE_RECIPIENTS must be set.
finally block.secrets module (backed by /dev/urandom).^[A-Z][A-Z0-9_]*$.No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/sops-mcp)<a href="https://allmcps.com/mcp/sops-mcp"><img src="https://allmcps.com/api/badge/sops-mcp?style=directory" alt="Sops MCP on AllMCPs" /></a>