MCP OAuth 2.1 & Security Audit
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
Works with the AI Agents you already use
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).
| Check | Standard / Control | Status | Finding |
|---|---|---|---|
Unauth initialize challenge | RFC 9728 Sec 5.1 | PASS | Returns HTTP 401 with WWW-Authenticate: Bearer resource_metadata="https://mcp.example.com/.well-known/oauth-protected-resource" |
| Protected Resource Metadata | RFC 9728 | PASS | resource matches canonical URL; bearer_methods_supported: ["header"] |
| AS Metadata & PKCE | RFC 8414 / OAuth 2.1 | FAIL (HIGH) | code_challenge_methods_supported omits S256 (plain only) |
| CORS Posture | DNS-Rebinding / CSRF | FAIL (CRITICAL) | Reflects untrusted Origin with Access-Control-Allow-Credentials: true |
| Tool Surface & Poisoning | tools/list scan | PASS | 9 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)
- CRITICAL: Reject untrusted
Originheaders and removeAccess-Control-Allow-Credentials: truefor non-allowlisted origins. - HIGH: Require PKCE
S256incode_challenge_methods_supportedand enforce RFC 8707resourceaudience validation on JWT verification. - LOW: Split read (
mcp:read) and mutating (mcp:write) scopes inscopes_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
- Transport & Auth Challenge Check
- Unauthenticated
POSTJSON-RPCinitializeprobe. - Verify HTTP
401 UnauthorizedwithWWW-Authenticate: Bearer resource_metadata="...", scope="..."on protected servers and flag unauthenticated write-capable endpoints. - Confirm modern Streamable HTTP (
POST+Mcp-Session-Idor stateless JSON/SSE) over deprecated unauthenticated/sse-only transports.
- Unauthenticated
- OAuth 2.1 & Metadata Discovery Verification
- Validate RFC 9728 Protected Resource Metadata (
/.well-known/oauth-protected-resource), canonicalresource, HTTPSauthorization_servers, least-privilegescopes_supported, andbearer_methods_supported: ["header"]. - Validate RFC 8414 (
/.well-known/oauth-authorization-server) or OIDC discovery: mandatorycode_challenge_methods_supportedincluding"S256"(PKCE),response_types_supportedincluding"code", optional RFC 7591registration_endpoint, and strict RFC 8707resource/audience validation.
- Validate RFC 9728 Protected Resource Metadata (
- CORS, Host & SSRF Posture
- Probe with untrusted
Originheader; flag wildcardAccess-Control-Allow-Origin: *or reflected origins paired withAccess-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).
- Probe with untrusted
- Tool Surface, Token Bloat & Tool-Poisoning Scan
- Inspect
tools/listoutput (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 outboundcurl/fetchinstructions.
- Inspect
- Deterministic Report Format
- Outputs a
0-100score, 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.
- Outputs a
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
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
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 3 days ago
- Free with an Agensi account
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.