Repository navigation
feat(agents): auth.md, Web Bot Auth, A2A Agent Card, OAuth discovery - #1244
Conversation
…very Add agent discovery surfaces on capgo.app: - /auth.md: how agents get credentials (OAuth 2.1 for the hosted MCP server, API keys, CLI login) and how to use them - /.well-known/http-message-signatures-directory: Ed25519 JWKS, signed when WEB_BOT_AUTH_PRIVATE_JWK is set; worker outbound fetches to GitHub and status.capgo.app are signed with Web Bot Auth - /.well-known/agent-card.json (+ legacy agent.json): A2A Agent Card for the hosted MCP server, declared as a custom MCP Streamable HTTP binding - /.well-known/oauth-protected-resource: RFC 9728 metadata for capgo.app pointing at the api.capgo.app authorization server - /.well-known/oauth-authorization-server: cached mirror of the api.capgo.app RFC 8414 metadata, plus an empty /.well-known/jwks.json since access tokens are opaque API keys Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 25 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b79ac6a527
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (metadata.issuer !== CAPGO_API_ORIGIN) throw new Error(`Unexpected issuer ${String(metadata.issuer)}`) | ||
| return { ...metadata, jwks_uri: metadata.jwks_uri ?? `${CAPGO_ORIGIN}${OAUTH_JWKS_PATH}` } |
There was a problem hiding this comment.
Avoid publishing authorization metadata for a different issuer
When a client performs OAuth discovery for https://capgo.app, this endpoint returns metadata whose issuer is https://api.capgo.app. RFC 8414 §3.3 requires the returned issuer to match the issuer used to construct the discovery URL, so conforming clients must reject this response even when the upstream fetch succeeds. Checking the upstream issuer does not make the mirrored document valid at the website origin. Keep discovery pointed at the canonical API-origin endpoint rather than exposing this mirror as an authorization-server discovery endpoint.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
All reported issues were addressed across 12 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
capgo.app becomes the RFC 8414 issuer of the hosted MCP authorization server (endpoints stay on api.capgo.app). The worker serves the metadata the API generates and only when it names https://capgo.app as issuer. Protected resource metadata, the A2A card and auth.md point at the capgo.app issuer. Remove the placeholder /.well-known/jwks.json: access tokens are opaque API keys, so there are no signing keys to publish. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|



Summary
Agent-readiness discovery surfaces on capgo.app (isitagentready checks), each describing something that actually exists:
/auth.md: how agents get credentials: OAuth 2.1 + PKCE for the hosted MCP server (api.capgo.app/mcp), API keys, and CLI login. Also lists the headers to send. Linked from llms.txt guidance and the markdown 404./.well-known/http-message-signatures-directoryserves an Ed25519 JWKS (application/http-message-signatures-directory+json). The response is signed (tag="http-message-signatures-directory") when theWEB_BOT_AUTH_PRIVATE_JWKsecret is set. The worker's outbound fetches (GitHub sponsors, status.capgo.app) are signed via Cloudflare'sweb-bot-authlibrary. Without the secret, behaviour is unchanged (unsigned)./.well-known/agent-card.json(+ legacy/.well-known/agent.json) describes the hosted MCP server. The interface uses a custom binding URI (A2A spec §5.8) for MCP Streamable HTTP, so A2A clients don't send JSON-RPC calls to an endpoint that can't answer them. Skills come from the same tool groups asmcp.json. Security schemes are OAuth (PKCE) and a Bearer API key./.well-known/oauth-protected-resourcewithresource: https://capgo.app(must match the origin),authorization_servers: [https://capgo.app], scopecapgo./.well-known/oauth-authorization-serverserves the hosted MCP authorization server's metadata. The API generates it (feat(mcp): use https://capgo.app as the OAuth issuer capgo.app#3803 setsMCP_OAUTH_ISSUER=https://capgo.app). The response is cached for 1h with a stale fallback, and is only served whenissuer === "https://capgo.app"; until then it returns 503. Endpoints stay onapi.capgo.app. Nojwks_uri: access tokens are opaque API keys, so nothing is signed.Not implemented on purpose: ACP, AP2, UCP and x402 (no agent checkout or payment flow exists), and DNS-AID (Cloudflare DNS, not in this repo).
Deploy order
Deploy this PR before Cap-go/capgo.app#3803. That PR points MCP clients at
https://capgo.appas the issuer, so this route must already be live.Deploy follow-up
Enable Web Bot Auth signing with the matching private key (kept outside the repo):
A key that doesn't match the published public key is ignored.
Test plan
bun test apps/web/test apps/web/src/worker: 254 passbun run lintastro check: 0 errorsastro buildemitsdist/auth.mdweb-bot-authverify(). The directory signature verifies for capgo.app and fails for another authority.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.