# mcp secrets lockdown

> Find and migrate plain-text MCP secrets to secure environment variables across Claude Code, Cursor, and VS Code.

mcp secrets lockdown is a paid AI agent skill on Agensi by Giuseppe Bellamacina, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $5 (one-time purchase)
- Creator: [Giuseppe Bellamacina](https://www.agensi.io/creators/giuseppe-bellamacina)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.1
- Last updated: 2026-10-09
- Security: scan passed (2026-10-09); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/mcp-secrets-lockdown
- Tags: llm-ops, security, mcp, devops, claude-code, cursor

## 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 `.env` file 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
1. **Plan** runs a read-only scan to show a table of findings, masked values, and the proposed variable names.
2. **Apply** backs up existing configs, writes the private secrets file, and rewrites the original JSON/TOML files.
3. **Configure** guides you through updating your shell profile or system environment variables so agents can read the new references.
4. **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.json` files 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
- Secrets MCP

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the mcp secrets lockdown skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does MCP Secrets Lockdown prevent my API keys from being leaked?

This skill scans your local configuration files to identify hardcoded API keys and tokens, automatically migrating them to a secure environment variable setup to prevent accidental exposure in git history or logs.

### Which AI agents and IDEs are compatible with this skill?

It is compatible with Claude Code, Cursor, VS Code, and Gemini CLI, supporting configuration formats including JSON, .mcp.json, and config.toml across Windows, macOS, and Linux.

### Can I preview which secrets will be moved before the skill makes changes to my files?

Yes, the 'Plan' step performs a read-only scan and displays a table of masked findings and proposed changes, allowing you to review everything before any files are actually modified.

### Will I need to manually update the syntax for each different IDE after the migration?

The skill automatically identifies the correct syntax for each specific tool—such as ${VAR} or ${env:VAR}—ensuring that your MCP servers continue to connect seamlessly after the migration.

### What is included with my purchase of this skill?

You receive the full skill package including the Secret Discovery, Automated Extraction, and Git Leak Detection modules, along with lifetime updates to support new MCP-enabled tools as they beome available.

### Do I need to restart my IDE after running the lockdown process?

While the skill automates the configuration rewrite, GUI applications like Cursor or VS Code typically need to be restarted or launched from a terminal to recognize the new environment variables you've set up.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
