agentleFS
patonkikhpatonkikh/APES/skills/mcp/mcp-security-review/skill.md

mcp-security-review

Skill3 starsChanged 5 months agoMITView on GitHub

Conduct a security review of MCP server and client implementations: threat modeling, auth validation, tool risk assessment, and remediation plan aligned with OWASP LLM and MCP-specific risks. Use when working on MCP servers, MCP tools, MCP clients, or Model Context Protocol integrations.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Document trust boundaries: agent, MCP client, MCP server, external API.

    line 45
  2. Distinctive:

    No full API responses logged at debug in production

    line 72
  3. Distinctive:

    Use allowlists for URLs (SSRF), paths (traversal), and commands.

    line 123

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
skill.md

MCP Security Review

Purpose

Conduct a security review of MCP server and client implementations: threat modeling, auth validation, tool risk assessment, and remediation plan aligned with OWASP LLM and MCP-specific risks.

Input: MCP server/client specification, tool designs, auth model, data classification, deployment context
Output: MCP Security Review Report with findings ranked by severity, threat model, and remediation checklist Examples: See examples.md for worked input/output.


Workflow

Step 1: Classify data and deployment

DimensionClassification
Data sensitivityPublic / Internal / Confidential / PII
DeploymentLocal stdio / Self-hosted / Third-party
User scopeSingle user / Multi-tenant
Write accessRead-only / Read-write / Destructive

Step 2: Build threat model

Apply STRIDE to MCP components:

ComponentThreatsExample
TransportSpoofing, tamperingMITM on HTTP transport
AuthElevation, spoofingToken leakage in logs
ToolsTampering, DoSUnbounded query exhausting API
ResourcesInfo disclosureExposing secrets via resources
Agent → ToolInjectionLLM passes malicious args to shell tool

Document trust boundaries: agent, MCP client, MCP server, external API.

Step 3: Review authentication and secrets

CheckPass/FailNotes
Secrets in environment only
No secrets in tool responses
Token scope minimal (least privilege)
OAuth refresh handled securely
Per-user vs shared credentials documented

Step 4: Assess tool risk

Per tool:

ToolRiskControls presentGap
run_querySQL injectionParameterized queriesNone
delete_fileData lossconfirm flagMissing confirm

Flag: command injection, path traversal, SSRF, excessive permissions, missing rate limits.

Step 5: Review logging and audit

  • Arguments with PII redacted in logs
  • Audit trail for destructive operations
  • No full API responses logged at debug in production
  • Correlation ID for incident investigation

Step 6: Produce findings and remediation

Rank findings: Critical / High / Medium / Low / Info.

Run Validation checklist.


Decision Rules

ConditionAction
Critical finding (RCE, secret leak, unauth access)Block deployment until fixed
Destructive tool without confirmationRate High; require remediation
HTTP transport without TLSBlock production deployment
PII in tool responses without redactionRequire data minimization
Third-party MCP server with write accessRequire sandbox and explicit user consent
Shell/command execution toolCritical review; prefer API-based alternatives

Validation

  • Data classification and deployment context documented
  • Threat model with trust boundaries
  • Auth and secrets review completed
  • Every tool assessed for risk with controls/gaps
  • Logging and audit requirements specified
  • Findings ranked with severity and remediation
  • Critical/High findings have owner and deadline
  • Residual risk accepted explicitly or mitigated

Anti-patterns

  • Security theater — checklist without tool-level analysis.
  • Trust the LLM — assuming model will never call dangerous tools with bad args.
  • Shared admin token — one API key for all users in multi-tenant setup.
  • Log everything — recording tokens and PII for debugging.
  • Skip review for read-only — read access to secrets still requires review.

Best Practices

  • Apply least privilege to every API token scope.
  • Validate and sanitize all tool inputs server-side.
  • Use allowlists for URLs (SSRF), paths (traversal), and commands.
  • Rate limit per user and per tool.
  • Re-review on every new tool or auth model change.

Output Structure

# MCP Security Review: [Server/Client Name]
**Date:** [YYYY-MM-DD]
**Reviewer:** [Name or "automated skill"]

## Context
| Dimension | Value |
|-----------|-------|

## Threat Model
[Trust boundaries diagram and STRIDE table]

## Auth & Secrets Review
| Check | Status | Finding |
|-------|--------|---------|

## Tool Risk Assessment
| Tool | Risk | Severity | Remediation |
|------|------|----------|-------------|

## Findings Summary
| ID | Severity | Description | Remediation | Status |
|----|----------|-------------|-------------|--------|

## Deployment Gate
[ ] Approved  [ ] Approved with conditions  [ ] Blocked

## Residual Risks
| Risk | Acceptance rationale |
|------|---------------------|

Next Skills

OutcomeRecommended Skill
Fix tool design issuesmcp/mcp-tool-generator
Harden implementationmcp/mcp-best-practices
Broader LLM securityai-security/llm-threat-modeler
Re-review after fixesmcp/mcp-security-review
Client auth hardeningmcp/mcp-client-generator

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.