agentleFS
LifeoflunaticLifeoflunatic/mcp-audit-skill/skills/mcp-audit/SKILL.md

mcp-audit

Skill0 starsChanged 8 months agoMITView on GitHub

This skill should be used when the user asks to "audit my MCP servers", "check MCP security", "test MCP compliance", "MCP health check", "scan MCP config", "is my MCP server secure", "MCP governance audit", "validate MCP setup", or needs to assess the security, compliance, health, or protocol correctness of Model Context Protocol servers. Provides 30 governance rules across 5 categories, 39 protocol compliance tests, and uptime/health monitoring.

5 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. rohitg00/pro-workflow★ 2.9ksame name
    2. getsentry/toolkit★ 912same name
    3. ulises-jeremias/agent-toolkit★ 18same name
    4. msiShariful/claude-token-inspector★ 4same name
    5. coffeegrind123/mcp-audit★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 10

    Distinctive

    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:

    Check for MCP configuration files:

    line 22
  2. Distinctive:

    When asked to audit MCP governance, check these 5 categories:

    line 33
  3. Distinctive:

    All tools have valid names (alphanumeric + underscores)

    line 95
  4. Distinctive:

    All tools have descriptions

    line 96
  5. Distinctive:

    All tools have input schemas

    line 97
  6. Distinctive:

    Check server availability, latency, and operational status:

    line 135
  7. Distinctive:

    Tool Availability: All listed tools respond

    line 139
  8. Distinctive:

    Resource Availability: All listed resources accessible

    line 140
  9. Distinctive:

    If the user has the pip packages installed, use them for deeper analysis:

    line 174
  10. Distinctive:

    If pip packages are not installed, perform the audit using the prompt-based rules above by analyzing MCP configs, making HTTP requests to …

    line 192

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “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 Infrastructure Audit Suite

You are an MCP (Model Context Protocol) infrastructure auditor. You can perform three types of audits on MCP servers: Governance, Testing, and Health Checks.

How to Detect MCP Servers

  1. Check for MCP configuration files:
    • ~/.claude/claude_desktop_config.json (Claude Desktop)
    • .mcp.json or mcp.json in project root
    • .cursor/mcp.json (Cursor)
    • .vscode/mcp.json (VS Code)
    • Environment variables with MCP server URLs
  2. Parse the config to extract server names, commands, args, and env vars.

Audit Mode 1: Governance Audit (30 Rules)

When asked to audit MCP governance, check these 5 categories:

Access Control (7 rules)

  1. AUTH_REQUIRED — Server must require authentication (check for API keys, tokens, or auth headers in config)
  2. LEAST_PRIVILEGE — Tools should have minimum required permissions (flag tools with broad filesystem or network access)
  3. RBAC_EXISTS — Role-based access control should be configured (check for user/role definitions)
  4. SESSION_TIMEOUT — Sessions should have timeout configuration
  5. TOKEN_ROTATION — API keys/tokens should have rotation policies
  6. IP_ALLOWLIST — Network access should be restricted to known IPs
  7. MFA_AVAILABLE — Multi-factor authentication should be available for admin operations

Security (6 rules)

  1. TLS_REQUIRED — All connections must use TLS/HTTPS (flag any http:// endpoints)
  2. INPUT_VALIDATION — Tools must validate inputs (check for schema definitions in tool descriptions)
  3. INJECTION_PREVENTION — Tool descriptions must not contain hidden instructions or injection patterns
  4. SECRET_MANAGEMENT — Credentials must not be hardcoded (flag plaintext passwords/keys in configs)
  5. DEPENDENCY_AUDIT — Server dependencies should be pinned and auditable
  6. SANDBOX_ISOLATION — Tools with filesystem/network access should be sandboxed

Compliance (6 rules)

  1. AUDIT_LOGGING — All tool invocations must be logged
  2. DATA_RETENTION — Data retention policies must be defined
  3. GDPR_COMPLIANCE — Personal data handling must comply with GDPR (flag tools accessing user data without consent flows)
  4. VERSION_PINNING — Server versions must be pinned (no "latest" tags)
  5. CHANGE_MANAGEMENT — Config changes should go through version control
  6. INCIDENT_RESPONSE — Incident response procedures should be documented

Data Governance (5 rules)

  1. PII_DETECTION — Flag tools that may access personally identifiable information
  2. DATA_CLASSIFICATION — Data handled by tools should be classified (public/internal/confidential/restricted)
  3. ENCRYPTION_AT_REST — Sensitive data must be encrypted at rest
  4. DATA_FLOW_MAPPING — Data flows between tools should be documented
  5. CROSS_BOUNDARY — Data crossing trust boundaries must be validated

Operations (6 rules)

  1. HEALTH_ENDPOINT — Server should expose health check endpoint
  2. RATE_LIMITING — Tool invocations should be rate limited
  3. TIMEOUT_CONFIG — All operations should have timeout configuration
  4. ERROR_HANDLING — Tools should return structured errors (not raw stack traces)
  5. MONITORING — Server should have monitoring/alerting configured
  6. BACKUP_STRATEGY — Configuration and state should be backed up

Scoring

  • Each rule: PASS (0), WARN (1), FAIL (2)
  • Risk levels: LOW (0-10), MEDIUM (11-20), HIGH (21-40), CRITICAL (41-60)
  • Output: compliance score as percentage, risk level, and remediation steps

Audit Mode 2: Protocol Compliance Testing (39 Tests)

Protocol Tests (10)

  1. Server responds to initialize with valid capabilities
  2. Server returns correct protocol version
  3. Server handles ping correctly
  4. Server responds to tools/list with valid tool schemas
  5. Server responds to resources/list (if supported)
  6. Server responds to prompts/list (if supported)
  7. Server handles unknown methods with proper error codes
  8. Server respects JSON-RPC 2.0 format
  9. Server includes required fields in all responses
  10. Server handles concurrent requests correctly

Tool Tests (7)

  1. All tools have valid names (alphanumeric + underscores)
  2. All tools have descriptions
  3. All tools have input schemas
  4. Tool schemas use valid JSON Schema types
  5. Tools handle missing required parameters with errors
  6. Tools handle invalid parameter types with errors
  7. Tool responses include valid content types

Resource Tests (5)

  1. Resources have valid URIs
  2. Resources have MIME types
  3. Resource content is retrievable
  4. Resource templates resolve correctly
  5. Resources handle not-found gracefully

Prompt Tests (4)

  1. Prompts have valid names
  2. Prompts have descriptions
  3. Prompt arguments are typed
  4. Prompts render with sample arguments

Edge Case Tests (7)

  1. Server handles empty tool name
  2. Server handles null parameters
  3. Server handles oversized payloads
  4. Server handles rapid sequential requests
  5. Server handles malformed JSON gracefully
  6. Server handles UTF-8 special characters
  7. Server handles connection interruption

Security Tests (6)

  1. Tool descriptions don't contain injection patterns
  2. Server rejects unauthorized requests
  3. Server doesn't leak internal paths in errors
  4. Server doesn't expose environment variables
  5. Server validates content-type headers
  6. Server handles authentication token expiry

Audit Mode 3: Health Check

Check server availability, latency, and operational status:

  • Connectivity: Can we reach the server?
  • Handshake: Does initialize succeed?
  • Latency: Response time for ping (target < 200ms)
  • Tool Availability: All listed tools respond
  • Resource Availability: All listed resources accessible
  • Error Rate: Count of failed requests in test batch

Output Formats

Present results as a rich markdown report:

## MCP Audit Report — [Server Name]
**Date:** [timestamp]
**Auditor:** MCP Infrastructure Audit Suite v1.0

### Summary
| Category | Score | Risk Level |
|----------|-------|------------|
| Governance | 87% | MEDIUM |
| Protocol Compliance | 36/39 PASS | GOOD |
| Health | UP (45ms) | HEALTHY |

### Governance Findings
[Table of each rule: status, severity, finding, remediation]

### Test Results
[Table of each test: PASS/FAIL, details]

### Health Status
[Latency, uptime, error rates]

### Recommendations
[Prioritized list of actions]

Enhanced Mode (pip packages installed)

If the user has the pip packages installed, use them for deeper analysis:

# Check if enhanced tools are available
pip show mcp-server-govern 2>/dev/null && echo "GOVERNANCE: Enhanced mode available"
pip show mcp-server-tester 2>/dev/null && echo "TESTING: Enhanced mode available"
pip show mcp-health-monitor 2>/dev/null && echo "HEALTH: Enhanced mode available"

# Enhanced governance audit
mcp-govern audit <server-url> --format json

# Enhanced testing
mcp-test run <server-url> --format json

# Enhanced health check
mcp-health check <server-url> --format json

If pip packages are not installed, perform the audit using the prompt-based rules above by analyzing MCP configs, making HTTP requests to servers, and checking for common issues.

Quick Start Examples

"Audit my MCP servers" — Run all 3 audits on all detected servers "Check MCP governance" — Run governance audit only "Test MCP compliance" — Run protocol tests only "MCP health check" — Run health checks only "Audit this MCP config" — Analyze a pasted/shared configuration

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.