Works with the AI Agents you already use
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.
Free
MCP Config Secret Scan
Example session with this skill installed
Check our mcp.json for pasted secrets before I commit it. Do not print any values.
- Read your context and instructions
- Compiled the mcp config secret
Ran python3 templates/mcp_secret_scan.py mcp.json (no network, values masked). Exit 1.
MCP secret scan: mcp.json
Servers: 7 (mcpServers) Secrets found: 6
| # | Server | Where | Key | Value (masked) | Replace with |
|---|---|---|---|---|---|
| 1 | tickets | env | TICKETS_API_KEY | FA*** (24 chars) | `"TICKETS_API_KEY": "${TICKETS_API_KEY}"` |
| 2 | tickets | env (password in URL) | DATABASE_URL | FA*** (14 chars) | `"DATABASE_URL": "${DATABASE_URL}"` |
| 3 | crm-sync | header | Authorization | FA*** (26 chars) | `"Authorization": "Bearer ${CRM_SYNC_TOKEN}"` |
| 4 | crm-sync | url ?api_key= | api_key | FA*** (24 chars) | `header from ${CRM_SYNC_API_KEY} if the server accepts one, else ?api_key=${CRM_SYNC_API_KEY}` |
| 5 | mail-relay | args[4] | SMTP_PASSWORD | FA*** (14 chars) | `"-e", "SMTP_PASSWORD" plus env "SMTP_PASSWORD": "${SMTP_PASSWORD}"` |
| 6 | search | args[3] | api-key | FA*** (24 chars) | `"--api-key", "${SEARCH_API_KEY}"` |
Set these before starting the client (values not shown): TICKETS_API_KEY, DATABASE_URL, CRM_SYNC_TOKEN, CRM_SYNC_API_KEY, SMTP_PASSWORD, SEARCH_API_KEY
6 secrets found. Rotate each one (it has been saved in plain text), move it to an env var, then re-run until this exits 0.
Values are masked: first 2 characters (8+ char values only) and length.
mcp.json: 6 pasted secrets in 4 of 7 servers. Do not commit this file yet.
No values are shown below; each is masked to 2 characters and a length.
1. tickets env TICKETS_API_KEY FA*** (24 chars) -> "${TICKETS_API_KEY}"
2. tickets env DATABASE_URL password FA*** (14 chars) -> "${DATABASE_URL}" (whole URL moves to the env)
3. crm-sync header Authorization FA*** (26 chars) -> "Bearer ${CRM_SYNC_TOKEN}"
4. crm-sync url ?api_key= FA*** (24 chars) -> header "X-Api-Key": "${CRM_SYNC_API_KEY}"
(the crm-sync docs say it accepts X-Api-Key),
and drop api_key from the URL
5. mail-relay docker -e SMTP_PASSWORD FA*** (14 chars) -> args "-e", "SMTP_PASSWORD" + env "SMTP_PASSWORD": "${SMTP_PASSWORD}"
6. search --api-key FA*** (24 chars) -> "--api-key", "${SEARCH_API_KEY}"
Not flagged, correctly: MAX_TOKENS (a number), REPO_TOKEN (already ${REPO_TOKEN}),
docs (Bearer ${DOCS_TOKEN}), files (no secrets).
Do this in order:
1. Rotate all six at their providers. This file has been in a shared folder, so treat them as exposed.
2. Put the new values in your shell profile or secret manager as:
TICKETS_API_KEY, DATABASE_URL, CRM_SYNC_TOKEN, CRM_SYNC_API_KEY, SMTP_PASSWORD, SEARCH_API_KEY
3. Replace the literals as shown, then confirm your client expands ${VAR} in env, args and headers
(check its docs) and that each server still connects.
4. Re-run the scan; commit only when it exits 0.
5. Add the pre-commit hook from SKILL.md so the next pasted key is caught before it lands.
Connects securely to your tools. The creator never sees your data.
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
mcpServersconfigs (Claude Desktop, Claude Code, Cursor and similar) and VS Codeserversconfigs. - Detection in the four places secrets hide:
envvalues under secret-like names,args(NAME=value,--token value, docker-e NAME=value),headerssuch asAuthorizationandX-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.
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
- 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 buying a skill.
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
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 3 days ago
- Free with an Agensi account
- Software
Python 3.10+ (standard library only)
An MCP config JSON (mcpServers shape: Claude Desktop, .mcp.json, Cursor; VS Code servers also works)
Permissions
What's inside
Frequently Asked Questions
New in Security
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.