mcp-server-pentest

mcp-server-pentest is a skill for Claude Code, Codex from forefy/.context. It costs 50 tokens per session (3,618 once invoked), scanned C, original, MIT.

A security testing procedure for an MCP server, a service that exposes tools to AI clients. It checks for authentication bypasses, server-side request forgery, and unsafe tool arguments from the server's URL or codebase.

In plain words
What is it for?
Use it to inventory an MCP server, inspect its transport and credentials, and test session forgery, unauthorised access, confused-deputy SSRF, and tool-argument injection with permission.
Why use it?
It can expose cases where an attacker reaches tools without proper identity checks, makes the server contact unintended destinations, or changes what a tool does through its inputs.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to inventory an MCP server, inspect its transport and credentials, and test session forgery, unauthorised access, confused-deputy SSRF, and tool-argument injection with permission.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/forefy/.context/mcp-server-pentest
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add forefy/.context --skill mcp-server-pentest
Clone the repo
git clone --depth 1 https://github.com/forefy/.context

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-server-pentest

README.md
[![agentmods](https://agentmods.dev/badge/skills/forefy/.context/mcp-server-pentest/github.svg)](https://agentmods.dev/skills/forefy/.context/mcp-server-pentest)
Your own site
<a href="https://agentmods.dev/skills/forefy/.context/mcp-server-pentest"><img src="https://agentmods.dev/badge/skills/forefy/.context/mcp-server-pentest/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-server-pentest

Your own site · 80×15
<a href="https://agentmods.dev/skills/forefy/.context/mcp-server-pentest"><img src="https://agentmods.dev/badge/skills/forefy/.context/mcp-server-pentest.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,618 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 4 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00050 $0.03618
Opus 5.5 $0.00020 $0.01447
Sonnet 5.5 $0.00010 $0.00724
Haiku 4.5 $0.00005 $0.00362

Measured 2mo ago against content hash 3044adab9e28, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

mcp-server-pentest scanned grade C with 4 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads MCP configurationlowAgent snooping

mcp.json carries server URLs and auth tokens; reading it lets a mod discover and abuse other integrations.

Inspect `claude_desktop_config.json`, `.mcp.json`, `.vscode/mcp.json`, container env, compose files, and any systemd unit. Run the secret patterns from `../../applicative-pentest/webapp-probe/references/secret-regexes.md

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Cloud metadata endpointmediumServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

- AWS IMDSv2 is a two-step and needs method plus header control: `PUT http://169.254.169.254/latest/api/token` with `X-aws-ec2-metadata-token-ttl-seconds: 21600`, then `GET .../latest/meta-data/iam/security-credentials/`

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sik -X POST "$URL" -H 'Content-Type: application/json' \

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

Target tools whose name or description implies a shell, a filesystem, a query language, or template rendering. With repo access, grep for `child_process`, `spawn`, `exec`, `subprocess`, `os.system`, `eval`, and unnormali
skills/llms/mcp-server-pentest/SKILL.md · 178 lines

How it starts

The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Contents

  • Scope & authorization (blast-radius labels)
  • Input modes: what a URL gets you, what a repo adds
  • Passive:
    1. Inventory & transport fingerprint
    2. Destination-shaped tool parameters
    3. Credential scope & identity blast radius
    4. Config & secret storage (repo/host only)
  • Active: 5. Session forgery, unauthenticated access & reachability 6. Confused-deputy SSRF via caller-chosen destination 7. Tool-argument injection
  • False-positive gates
  • Runnable snippets
  • Output

Scope & authorization

Only run against an MCP server you own or are contractually engaged to test. Note the unusual consent shape: these checks speak JSON-RPC to the server directly, which bypasses the agent's tool-approval UI. Anything the operator believed a human would confirm before it ran will run unattended here. Confirm that is in scope before check 5.

Blast-radius labels:

  • Passive (1, 2, 3, 4) - reads the server's own manifest, config and schemas. Check 1 completes the MCP handshake, which is one benign request the server is built to answer; nothing else leaves your machine.
  • Active (5, 6) - live JSON-RPC to the target. Check 6 also reaches third parties (your OAST host, cloud metadata endpoints).
  • Aggressive (7) - sends injection payloads through tools that may execute them. Run last, in a low-traffic window.

Input modes

The protocol is self-describing, so a URL alone carries most of the surface: tools/list returns a machine-readable schema of every tool and parameter before you send a single payload.

Input Runs Notes
Remote URL (default) 1, 2, 5, 6, 7, partial 3 Everything except config storage.
+ repo or host access adds 4, completes 3, sharpens 7 Source tells you which tools shell out, so check 7 targets instead of fuzzes; env/config tells you the real grants behind check 3.

Transport decides more than source does. A stdio server has no URL and no listener: spawn it yourself, run 1, 2, 3, 4, 7, and skip 5 and 6 unless it also serves HTTP.

Read the full file on GitHub · 178 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 178 lines · 50 tokens per session scan C 3044adab9e28

Subscribe to this mod's changes

mcp-server-pentest is a skill published in the GitHub repository forefy/.context (156 stars, last pushed yesterday), licensed MIT. It adds 50 tokens to every session and 3,618 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 4 findings (reads mcp configuration, cloud metadata endpoint, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-08.

Related

mcp-server-pentest compared with skills from other repositories

mcp-server-pentest next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mcp-server-pentestforefy/.contextSkill156yesterdayMITC50Claude Code, Codex
eresus-manual-security-auditEresusSecurity/appsec-skillsSkill77mo agoApache-2.0A145Claude Code, Codex
eresus-php-auditEresusSecurity/appsec-skillsSkill77mo agoApache-2.0A92Claude Code, Codex
eresus-sast-scannerEresusSecurity/appsec-skillsSkill77mo agoApache-2.0A100Claude Code, Codex
eresus-python-auditEresusSecurity/appsec-skillsSkill77mo agoApache-2.0A101Claude Code, Codex
eresus-remediatorEresusSecurity/appsec-skillsSkill77mo agoApache-2.0A84Claude Code, Codex
eresus-variant-analysisEresusSecurity/appsec-skillsSkill77mo agoApache-2.0A85Claude Code, Codex