Repository navigation
Conversation
… can sign in to /api/mcp Ported from ThreatCrush (#450). Existing crp_ API keys keep working on /api/mcp; an OAuth access token (crp_oat_, 1h, rotating 90-day refresh) is accepted there too and nowhere else. - /.well-known/oauth-protected-resource (+ /api/mcp suffix): resource is exactly https://crawlproof.com/api/mcp, AS = crawlproof.com - /.well-known/oauth-authorization-server: DCR, S256, code, refresh, public - POST /api/oauth/register (RFC 7591), /api/oauth/token (form or JSON), /api/oauth/revoke (RFC 7009), /api/oauth/grants (connected apps) - /oauth/authorize consent page on the Supabase session; signed-out users go through /login and back; same-origin POST; iss in every redirect (RFC 9207) - 401 resource_metadata pinned to the public origin; tools/list carries resultType/ttlMs/cacheScope - OAuth endpoints skip the crawl gateway and session refresh in proxy.ts - Connected apps card on the API tokens page - migration 20261111140000_mcp_oauth.sql (hashes only, service role only) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThreatCrush Security Scan50 finding(s) HIGH/CRITICAL: 2 | MEDIUM: 30 | LOW: 18
Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the CrawlProof MCP server listable in the Claude Connectors Directory and ChatGPT, which accept only no-auth or OAuth 2.1. Ported from ThreatCrush #450.
Connector URL:
https://crawlproof.com/api/mcp(unchanged). Existingcrp_API keys keep working there; an OAuth access token works too.What
/.well-known/oauth-protected-resource(+/api/mcpsuffix):resource=https://crawlproof.com/api/mcpexactly,authorization_servers[0]=https://crawlproof.com/.well-known/oauth-authorization-server(+ suffix):registration_endpoint, S256 only,code,authorization_code+refresh_token,token_endpoint_auth_methods_supported: ["none"]POST /api/oauth/register: RFC 7591 DCR, public clients only; https redirects (claude.ai, chatgpt.com, ...) and http loopback with any port (RFC 8252)/oauth/authorize: consent page on the existing Supabase session (password, Google, CoinPay sign-in all bind by Supabase user id, never by CoinPay email). Signed out ->/login?redirect=round trip. Unknown client/redirect is shown, never followed. Names the client. Not frameable.POST /api/oauth/authorize: the consent form target; same-origin only (Origin / Sec-Fetch-Site); 303 back withcode,state,iss(RFC 9207)POST /api/oauth/token: form-encoded (JSON too); single-use 5-min code bound to client + redirect + PKCE; rotating refresh;POST /api/oauth/revoke(RFC 7009)crp_oat_access tokens (1h) act as the approving user, resolved only by/api/mcp; refresh 90d; hashes only/api/mcp: 401WWW-Authenticate: Bearer resource_metadata="https://crawlproof.com/.well-known/oauth-protected-resource"pinned to the public origin;tools/listnow carriesresultType/ttlMs/cacheScope(Claude Code requires them)proxy.ts: OAuth machine endpoints skip the crawl gateway and the Supabase session refresh20261111140000_mcp_oauth.sql:oauth_clients,oauth_codes,oauth_tokens, RLS on, service role onlyTests
tests/mcp-oauth.test.ts(19): discovery docs, redirect rules, DCR (public ok, confidential/bad redirect refused), consent (cross-site refused, signed-out -> login, unregistered redirect never followed, deny, missing PKCE), code -> token (form-encoded) -> refresh rotation -> replay refused -> grants list/disconnect, revoke, loopback any port,/api/mcp401 + resource_metadata, OAuth token lists tools with cache fields, existing crp_ key still lists tools.Local:
bun run typecheckclean; full suite 3083 passed, 9 skipped.🤖 Generated with Claude Code