MCP OAuth 2.1 & Security Audit

    by Caliber Foundry

    1

    Audits remote MCP servers for OAuth 2.1 compliance (RFC 9728, RFC 8414, PKCE S256), Streamable HTTP transport safety, CORS/SSRF posture, schema token bloat, and tool-poisoning risks.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+23 more

    MCP OAuth 2.1 & Security Audit

    Example session with this skill installed

    Audit our remote MCP server at https://mcp.example.com/mcp for OAuth 2.1 compliance, Streamable HTTP transport safety, CORS/SSRF posture, schema token bloat, and tool-poisoning risks before production rollout.

    • Read your context and instructions
    • Compiled the mcp oauth 2

    Summary

    Audited https://mcp.example.com/mcp across Transport/Auth Challenge, RFC 9728/8414 OAuth 2.1 discovery, CORS/SSRF posture, and tools/list manifest safety. Score: 68 / 100 (Grade C — Needs Remediation before production).

    CheckStandard / ControlStatusFinding
    Unauth initialize challengeRFC 9728 Sec 5.1PASSReturns HTTP 401 with WWW-Authenticate: Bearer resource_metadata="https://mcp.example.com/.well-known/oauth-protected-resource"
    Protected Resource MetadataRFC 9728PASSresource matches canonical URL; bearer_methods_supported: ["header"]
    AS Metadata & PKCERFC 8414 / OAuth 2.1FAIL (HIGH)code_challenge_methods_supported omits S256 (plain only)
    CORS PostureDNS-Rebinding / CSRFFAIL (CRITICAL)Reflects untrusted Origin with Access-Control-Allow-Credentials: true
    Tool Surface & Poisoningtools/list scanPASS9 tools (~1,840 tokens); 0 hidden BiDi chars or injection tags
    
    # Expected 401 Challenge Header
    HTTP/1.1 401 Unauthorized
    WWW-Authenticate: Bearer resource_metadata="https://mcp.example.com/.well-known/oauth-protected-resource", scope="mcp:read"
    

    Next steps (ordered by severity)

    1. CRITICAL: Reject untrusted Origin headers and remove Access-Control-Allow-Credentials: true for non-allowlisted origins.
    2. HIGH: Require PKCE S256 in code_challenge_methods_supported and enforce RFC 8707 resource audience validation on JWT verification.
    3. LOW: Split read (mcp:read) and mutating (mcp:write) scopes in scopes_supported.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    MCP OAuth 2.1 & Security Audit Workflow

    Audit any remote Model Context Protocol (MCP) server before connecting it to Claude Code, Cursor, ChatGPT, or production workflows.

    Audit Sequence

    1. Transport & Auth Challenge Check
      • Unauthenticated POST JSON-RPC initialize probe.
      • Verify HTTP 401 Unauthorized with WWW-Authenticate: Bearer resource_metadata="...", scope="..." on protected servers and flag unauthenticated write-capable endpoints.
      • Confirm modern Streamable HTTP (POST + Mcp-Session-Id or stateless JSON/SSE) over deprecated unauthenticated /sse-only transports.
    2. OAuth 2.1 & Metadata Discovery Verification
      • Validate RFC 9728 Protected Resource Metadata (/.well-known/oauth-protected-resource), canonical resource, HTTPS authorization_servers, least-privilege scopes_supported, and bearer_methods_supported: ["header"].
      • Validate RFC 8414 (/.well-known/oauth-authorization-server) or OIDC discovery: mandatory code_challenge_methods_supported including "S256" (PKCE), response_types_supported including "code", optional RFC 7591 registration_endpoint, and strict RFC 8707 resource/audience validation.
    3. CORS, Host & SSRF Posture
      • Probe with untrusted Origin header; flag wildcard Access-Control-Allow-Origin: * or reflected origins paired with Access-Control-Allow-Credentials: true.
      • Verify outbound URL tools block private/loopback/metadata ranges (127.0.0.0/8, 10.0.0.0/8, 169.254.169.254/32, ::1, fc00::/7).
    4. Tool Surface, Token Bloat & Tool-Poisoning Scan
      • Inspect tools/list output (name, description, inputSchema) and estimate schema token footprint (Math.ceil(JSON.stringify(tools).length / 4), warning above 8,000 tokens or 25 overlapping REST wrappers).
      • Scan descriptions and schema fields for hidden prompt injection (<IMPORTANT>, <system>, "ignore previous instructions"), invisible Unicode/BiDi chars (U+200B..U+200F, U+202A..U+202E, U+2066..U+2069), credential paths (.ssh/, .aws/, .env), or covert outbound curl/fetch instructions.
    5. Deterministic Report Format
      • Outputs a 0-100 score, letter grade (A-F), RFC/control pass/fail checks, and severity-ordered remediations (CRITICAL -> HIGH -> MEDIUM -> LOW), backed by the included OAuth 2.1 verification checklist.

    Requires a reachable remote URL for probes. Focuses on protocol-level and manifest-level security rather than static binary analysis or fuzzing.

    How to use

    1. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Permissions

    Network Access
    Listed3 days ago

    What's inside

    Frequently Asked Questions

    This skill identifies critical vulnerabilities in Model Context Protocol (MCP) implementations, such as tool-poisoning, SSRF risks, and non-compliant OAuth flows that could lead to unauthorized data exfiltration or model hijacking.

    The skill is designed to audit any remote MCP server regardless of the agent framework, as long as the server is reachable via a remote URL and utilizes JSON-RPC, SSE, or Streamable HTTP.

    No, this skill performs an external protocol-level audit and manifest analysis; it does not require access to your private source code to identify PKCE, transport, or schema vulnerabilities.

    You receive the full audit engine capable of performing deterministic security sequences, OAuth 2.1 compliance checks, and tool-poisoning scans, along with documentation on how to interpret the risk reports.

    Yes, the skill includes a token optimization analysis that flags excessive schema footprints and tool overlapping, helping you minimize context window usage and operational costs.

    The skill requires a reachable remote URL for the MCP server and focuses on protocol and manifest security; it does not perform deep fuzzing or internal logic testing of the tools themselves.

    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.

    Free