# MCP Config Secret Scan

> Find API keys, tokens and passwords pasted into MCP configs (env, args, headers, URLs), masked, with the env var reference to use instead. Exits 1 on a find, for pre-commit. Stdlib Python, no network.

MCP Config Secret Scan is a free AI agent skill on Agensi by Signal Over Noise, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Signal Over Noise](https://www.agensi.io/creators/jammin411)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.0.0
- Last updated: 2026-12-01
- Security: scan passed (2026-12-01); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/mcp-config-secret-scan
- Tags: security, mcp, json, python, devops

## About this skill

MCP server READMEs tell you to paste a key into the config. Then the config gets committed, synced, or pasted into a ticket, and the key goes with it.

**What you get**

- A small Python script (standard library only, no network, starts no servers) that reads `mcpServers` configs (Claude Desktop, Claude Code, Cursor and similar) and VS Code `servers` configs.
- Detection in the four places secrets hide: `env` values under secret-like names, `args` (`NAME=value`, `--token value`, docker `-e NAME=value`), `headers` such as `Authorization` and `X-Api-Key`, and URLs (passwords in connection strings, key-like query parameters).
- A short table per file: server, where, key name, masked value (2 characters and the length, never more), and the exact reference to paste in its place, `${VAR}` or `${env:VAR}` to match the file.
- Exit 1 on any find, so it works as a pre-commit hook. Several files in one run.
- A worked example: a 7-server fictional config, 6 findings, the fixed config, and the clean re-run.

**What makes it different**

It does one job and tells you how to finish it: rotate, set the env var, replace the literal, re-run until exit 0. References already in place, numbers like `MAX_TOKENS`, and `${input:...}` prompts are left alone.

**What it does not do**

It checks for pasted secrets only. It does not review package pinning, filesystem or shell scope, tool descriptions, duplicate tools, or auto-approve settings, and it is not a repo-wide secret scanner.

## Requires

- Python 3.10+ (standard library only)

An MCP config JSON (mcpServers shape: Claude Desktop, .mcp.json, Cursor; VS Code servers also works)

## Known limitations

Does not support JSONC. Secrets under generic names (e.g., "DATA=xyz") may be missed if they lack a known prefix. Only scans local files; does not detect leaked keys already in git history.

## 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 Config Secret Scan skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What specific security problem does this skill address for MCP users?

This skill scans MCP configuration files locally to find and mask exposed API keys, tokens, and passwords. It helps you identify security risks before you commit code to git, share snippets in chat, or paste configs into support tickets.

### What do I need to have installed or ready to use this skill?

You need a Python 3.10+ environment and your local MCP JSON configuration files, such as mcp.json or claude_desktop_config.json. The skill works with standard JSON formats used by various MCP-compatible desktop and code editors.

### What kind of report does the skill generate when it finds a secret?

The skill generates a Markdown table that lists flagged servers and keys along with masked values to keep your logs safe. It also provides the exact variable syntax needed to replace hardcoded secrets with environment variable references tailored to your specific client.

### How does this protect my data compared to just asking an AI to check my config?

This skill runs entirely on your local machine and never makes network calls or prints actual secret values. This is safer than prompting an LLM with your config, which would involve sending your raw secrets to a model provider.

### Are there any types of files or secrets that this skill cannot detect?

It cannot parse JSONC files that contain comments or trailing commas. Additionally, it relies on name-based detection and known prefixes, so it might not catch secrets stored under generic or non-standard key names that do not look like credentials.

### How should I direct my AI agent to perform a scan?

You can ask your agent to scan a specific configuration file for secrets or request that it help you set up a pre-commit hook using this skill to prevent future leaks. You can also specify a reference style, like VS Code syntax, for the suggested fixes.

---

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.
