Works with the AI Agents you already use
MCP Security Audit & PR Gate: Claude Code & Cursor
by luckystore1
Audit MCP configuration in Claude Code, Cursor and GitHub Actions: find plaintext secrets, stop a repository approving its own servers, and add a pull-request gate that blocks unsafe MCP and unpinned action changes.
$9
What it does
- Find plaintext secrets in MCP configs and settings files and point to the exact line
- Replace them with ${VAR} (Claude Code) or ${env:NAME} (Cursor), after rotating the exposed key
- Stop a repository approving its own MCP servers with disabledMcpjsonServers and --strict-mcp-config
- Add a read-only GitHub Actions gate that blocks unsafe MCP, settings and unpinned action changes
- Explain every check against documented CVEs and OWASP Secure Coding with AI controls
Who it's for
DevOps engineers rolling out Claude Code or Cursor
A one-pass audit that finds committed tokens and auto-approved servers before the rollout, plus a gate that keeps them out afterwards
Try asking: “Audit this repo's MCP configuration and tell me what to fix before we turn Claude Code on for the team”
Security engineers reviewing AI agent setup
A findings table with file, line and fix, and every check traced to a CVE or an OWASP control
Try asking: “Review our .claude and .cursor config for the patterns in CVE-2025-54135 and CVE-2026-47751”
Maintainers running claude-code-action in CI
Pinned-action checks, the fork-PR gap closed, and a gate that refuses secret-bearing or unpinned config
Try asking: “Check our agent workflow for unpinned actions and add the MCP pull-request gate”
MCP Security Audit & PR Gate: Claude Code & Cursor
Example session with this skill installed
Audit the MCP setup in this repo before we turn Claude Code on for the team. We have .mcp.json, .claude/settings.json, .cursor/mcp.json and one workflow that runs claude-code-action. Tell me what to fix, then add the pull-request gate.
- Read your context and instructions
- Compiled the mcp security audit
MCP config audit — acme/checkout-api @ 7f3c2a1
Three configuration files, six findings. Two are credentials that are already exposed, one is a switch that removes the approval prompt.
| # | Severity | File | Finding | Fix |
|---|---|---|---|---|
| 1 | block | .mcp.json:9 | literal GitHub token in server env | rotate, use ${GITHUB_MCP_TOKEN} |
| 2 | block | .cursor/mcp.json:14 | literal API key in Authorization | rotate, use ${env:MCP_TOKEN} |
| 3 | block | .claude/settings.json:3 | enableAllProjectMcpServers: true | set false, approve by name |
| 4 | block | .github/workflows/agent.yml:22 | claude-code-action@v1 is not pinned | pin to a commit SHA |
| 5 | warn | .mcp.json:6 | server local-shell runs an unpinned npx package | pin a version or remove it |
| 6 | warn | CLAUDE.md | agent instructions changed | read the diff |
The change, file by file
- "GITHUB_TOKEN": "ghp_…(redacted)",
+ "GITHUB_TOKEN": "${GITHUB_MCP_TOKEN}",
{
"enableAllProjectMcpServers": false,
"enabledMcpjsonServers": ["github"],
"disabledMcpjsonServers": ["local-shell"]
}
The gate on the fix PR
MCP config gate — PR #412
4 configuration file(s) changed · 0 blocking, 1 warning
warn .mcp.json:6 server 'local-shell' runs an unpinned npx package
Removed configuration: .cursor/mcp.json
Next steps
- Rotate the GitHub token, the MCP key and the database password before this merges.
- Merge the CODEOWNERS rules so .mcp.json, .claude/, .cursor/ and .github/workflows/ need a security owner.
- Make "MCP config gate" a required status check.
- Remove local-shell in a follow-up: nobody owns it.
Connects securely to your tools. The creator never sees your data.
About this skill
MCP servers are configuration that runs code. A .mcp.json, a .cursor/mcp.json or a .claude/settings.json entry names the command that starts on a developer's laptop and on your CI runner, with that machine's permissions and secrets. Those files live in the repository, so a pull request can change them: a new server, a new hook, a token pasted into a header, or an action tag that quietly moves.
This pack is the audit and the guard rail around that.
What it does
- Inventories every MCP and agent configuration file in the repository and shows what runs, and with which secrets.
- Finds plaintext credentials in env values, headers, URLs and arguments, and migrates them to ${VAR} (Claude Code) or ${env:NAME} (Cursor) - after telling you to rotate the exposed key first, because deleting a line does not delete a secret from git history.
- Hardens the approval path: enableAllProjectMcpServers false, approval by name only, and every unreviewed server in disabledMcpjsonServers, which rejects it in every permission mode and in headless runs where no prompt can appear.
- Adds a pull-request gate that runs with only contents: read and pull-requests: read, never checks out the PR, and blocks a literal credential, an ANTHROPIC_BASE_URL override, an auto-approve switch, an unpinned uses: line and a pull_request_target checkout of the PR head. Hooks, unpinned npx packages and edits to CLAUDE.md are flagged for the reviewer.
- Ships CODEOWNERS rules so a named owner reviews .mcp.json, .claude/, .cursor/ and .github/workflows/.
Why not just prompt the agent
A prompt can produce a plausible audit of one repository today. It will not run the same checks next week, will not fail a build, and will not leave anything behind. This is the checklist, the settings file and the CI job that survive after the chat closes.
Grounded in documented incidents
- CVE-2025-54135 (CurXecute) and CVE-2025-54136 (MCPoison): Cursor's name-bound MCP trust, fixed in 1.3.9 and 1.3.
- CVE-2025-59536: Claude Code running project configuration before the startup trust dialog, fixed in 1.0.111.
- CVE-2026-47751: claude-code-action reading .mcp.json from a pull request, fixed in 1.0.74.
- OWASP Secure Coding with AI, section 4 (MCP and tool security) and section 11 (CI/CD agents and confused-deputy risk).
Every check in the reference names the version it was checked against and links the advisory.
What it will not do
It is not a sandbox, and not a scanner that proves safety. A secret with no recognisable shape, a base64 payload or an instruction written in prose in CLAUDE.md passes every check. A clean run means nothing matched, not that the repository is safe.
Why it reads environment variables
Env vars are read, never collected. The gate workflow uses only the runner's own GH_TOKEN, GITHUB_REPOSITORY, the PR number, the head SHA and GITHUB_STEP_SUMMARY: it reads the pull request through the GitHub API and writes the step summary, with no checkout of the PR and no secret of its own. The audit reads variable names inside config env blocks so it can tell a pasted secret from a ${VAR} reference, and it redacts any value it finds. Nothing is uploaded.
Related skills
- MutantGate: Diff Mutation Testing for PRs (free) - mutation-tests only the lines a PR changed and returns the survivors. The scan this pack builds on.
- MutantGate Survivor Pack: Test-Gen Prompts & PR Gate Kit ($12) - template pack that turns those survivors into tests, with a GitHub Actions gate workflow and a monorepo preset.
Files: SKILL.md, workflows/mcp-config-pr-gate.yml, templates/CODEOWNERS.mcp, templates/claude-strict-mcp.json, templates/cursor-mcp-hardened.json, templates/settings-hardened.json, references/cve-and-owasp-checklist.md, examples/audit-report-example.md. Reads: .mcp.json, .claude.json, .claude/settings.json, .claude/settings.local.json, .claude/, .cursor/mcp.json, CLAUDE.md, AGENTS.md, .github/workflows/*.yml. Uses: Claude Code settings keys disabledMcpjsonServers, enabledMcpjsonServers and enableAllProjectMcpServers; claude --strict-mcp-config --mcp-config; Cursor ${env:NAME} interpolation; GitHub Actions with contents: read and pull-requests: read only. The gate is one workflow with an embedded Python 3 script (standard library only). It calls the GitHub REST API through the gh CLI already installed on GitHub-hosted runners: no checkout, no third-party action, no npm install, no secret of its own. Setup: copy the workflow, merge the CODEOWNERS rules, make the check required, copy the hardened settings, and pin anthropics/claude-code-action to a commit SHA. Versions checked: Claude Code 1.0.111+, Cursor 1.3.9+ (1.3+ for CVE-2025-54136), claude-code-action 1.0.74+, python3 and gh on the runner, ripgrep locally.
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
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed today
- Software
Python 3 (on the GitHub Actions runner)
GitHub CLI (gh, on the runner)ripgrep (rg, for local audits)
Env vars are read, never collected: the workflow uses the runner's GH_TOKEN, GITHUB_REPOSITORY, PR number, head SHA and GITHUB_STEP_SUMMARY to read the PR and write the summary. The audit reads names in config env blocks to spot pasted secrets; it prints no value and uploads nothing.
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.