A read-only MCP OAuth discovery diagnostic. One inspect command tells you whether an MCP endpoint advertises its OAuth authorization metadata the way an agent expects to discover it. No login, no token exchange.
oauthdoctor is a command-line tool that walks the OAuth discovery flow an MCP client follows to find an endpoint's authorization server. It checks the 401 challenge, the WWW-Authenticate resource_metadata pointer, the Protected Resource Metadata document, the referenced authorization server metadata, and the PKCE S256 declaration. It is a discovery diagnostic, not a login tool and not a security certifier.
A common failure: my MCP server returns 401 and the agent cannot find the authorization server metadata. The MCP Authorization spec expects the metadata to be discoverable through a specific chain of documents. oauthdoctor follows that chain read-only and reports where it breaks — so you can fix your server's discovery before an agent ever connects.
S256 declaration are present and well-formed.PASS only means the observed discovery documents passed the implemented checks.npm install -g oauthdoctor # or run without installing:
npx oauthdoctor inspect <url> --json
npx oauthdoctor inspect https://mcp.example.com/mcp --json
WWW-Authenticate header carrying the resource_metadata parameter.authorization_servers → Authorization Server Metadata: issuer, authorization endpoint, token endpoint presence and HTTPS.S256 code challenge method declaration.HTTP targets are refused except 127.0.0.1 / localhost / ::1 (fixture mode) to keep the tool read-only against remote servers.
Representative structure of what oauthdoctor reports. A real public OAuth-protected MCP endpoint positive case has not yet been published by the project; the tool's local positive/negative fixture tests pass.
{
"endpoint": "https://mcp.example.com/mcp",
"status": "PASS",
"checks": [
{ "name": "401_challenge", "status": "PASS" },
{ "name": "www_authenticate_resource_metadata", "status": "PASS" },
{ "name": "protected_resource_metadata", "status": "PASS" },
{ "name": "authorization_server_metadata", "status": "PASS" },
{ "name": "pkce_s256", "status": "PASS" }
]
}
| Code | Meaning |
|---|---|
0 | PASS — all implemented discovery checks passed |
1 | FAIL — at least one implemented check failed (findings in JSON) |
2 | UNKNOWN — target could not be conclusively evaluated |
3 | usage error (bad arguments or non-HTTPS remote target) |
PASS is not an OAuth security certification — only that the observed discovery documents passed the implemented checks.0.1.0): local positive/negative fixture tests pass; a real public OAuth-protected MCP endpoint positive case has not yet been validated.Experimental (0.1.0). Local positive/negative fixture tests pass; a real public OAuth-protected MCP endpoint positive case has not yet been validated.
Package: oauthdoctor — published by npm user eidonze, version 0.1.0, MIT.
Source: xka0085-byte/oauthdoctor — issues and the full README live there.
Part of the Agent / Chain Evidence Tools suite · MIT · Node ≥ 18 · read-only, no keys, no payments