Works with the AI Agents you already use
mcp secrets lockdown
Find and migrate plain-text MCP secrets to secure environment variables across Claude Code, Cursor, and VS Code.
$5
mcp secrets lockdown
Example session with this skill installed
I think I have API keys in my Claude Code and Cursor configs. Can you help me move them to a safe place and set up environment variables?
- Read your context and instructions
- Compiled the mcp secrets lockdown
- Generated the document
I have scanned your project and user directories. I found plain-text secrets in three MCP configuration files. Two of these are in files tracked by git, meaning those keys should be rotated after we finish this lockdown.
MCP Secret Scan Results
| Tool | File | Server | Type | Status |
|---|---|---|---|---|
| Claude Code | .mcp.json | brave-search | API_KEY | FIXABLE (Git Tracked) |
| Cursor | .vscode/mcp.json | github-mcp | AUTH_TOKEN | FIXABLE (Git Tracked) |
| VS Code | settings.json | postgres-db | PASSWORD | FIXABLE |
I have prepared a plan to move these to ~/.mcp-secrets.env and replace the values with ${VAR} and ${env:VAR} references.
Action Taken:
- Created a plan.html report showing exactly which lines will be changed.
- Identified that
BRAVE_API_KEYandGITHUB_TOKENare in git history and require rotation. - Verified the syntax for Cursor (
${env:VAR}) vs Claude Code (${VAR}) to ensure compatibility.
Next steps
- Run
node scripts/lockdown.mjs applyto migrate the secrets and update configs. - Add
set -a; . ~/.mcp-secrets.env; set +ato your~/.zshrcor~/.bashrc. - Delete the temporary backup folder at
~/.mcp-secrets-lockdown-backups/once you verify the servers connect.
plan.html
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Hardcoded API keys and tokens in MCP configurations are a security failure waiting to happen. If you use Claude Code, Cursor, VS Code, or Gemini CLI, your mcp.json or settings.json likely contains plain-text secrets that could be leaked to git history or shared accidentally. This skill automates the discovery, extraction, and replacement of these secrets with secure environment variables.
What it does
- Secret Discovery scans project and user-level MCP configs for API keys, tokens, and passwords.
- Automated Extraction moves plain-text values into a single, private
.envfile stored outside your repositories. - Smart Rewriting replaces hardcoded values with tool-specific syntax like
${VAR}or${env:VAR}without breaking the server connection. - Git Leak Detection identifies if a secret was already committed to git, flagging it for mandatory rotation.
- Validation verifies that all referenced variables are correctly defined and accessible to your agents.
How it works
- Plan runs a read-only scan to show a table of findings, masked values, and the proposed variable names.
- Apply backs up existing configs, writes the private secrets file, and rewrites the original JSON/TOML files.
- Configure guides you through updating your shell profile or system environment variables so agents can read the new references.
- Verify runs a final check to ensure no plain-text secrets remain and all MCP servers still connect.
Frameworks & tools
Works with Node.js 18+ on Windows, macOS, and Linux. Supports configuration formats for Claude Code, Cursor, VS Code, Codex CLI, and Gemini CLI, including JSON, .mcp.json, and config.toml.
Why this beats prompting it yourself
Manual migration of MCP secrets is error-prone because every tool uses different environment variable syntax. This skill handles the specific escaping and formatting rules for multiple CLI tools simultaneously while ensuring you don't accidentally print a secret to your chat logs.
Use cases
- Repository Sanitization before pushing an MCP-enabled project to a public GitHub repo.
- Team Collaboration allowing developers to share
mcp.jsonfiles without sharing personal API keys. - Post-Leak Cleanup identifying which keys were compromised after an accidental commit to history.
Known limitations
Requires Node.js 18 installed on the host. GUI applications like Cursor or VS Code may require a full restart or launch from a terminal to pick up new environment variables.
Requires Node.js 18+. GUI apps like Cursor must be launched from terminal or restarted to see new env vars. Cannot fix secrets passed as CLI arguments automatically.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 month ago
Requires
Permissions
No special permissions declared or detected