Skip to content

feat(mcp): add standard Clerk-backed OAuth - #15

Merged
caio-pizzol merged 10 commits into
mainfrom
codex/mcp-auth-e2e
Aug 11, 2026
Merged

feat(mcp): add standard Clerk-backed OAuth#15
caio-pizzol merged 10 commits into
mainfrom
codex/mcp-auth-e2e

Conversation

@caio-pizzol

@caio-pizzol caio-pizzol commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • protect the canonical /mcp endpoint with standard OAuth 2.1 and Clerk sign-in
  • support OAuth discovery, dynamic client registration, Client ID Metadata Documents, PKCE, resource-bound tokens, refresh, and revocation
  • use branded ooxml.dev sign-in, sign-up, and consent pages
  • record successful tool calls with the Clerk user ID and dynamic OAuth client ID

Compatibility and cleanup

  • serve MCP 2026-07-28 with stateless compatibility for current 2024/2025 clients
  • remove the temporary /mcp-v2 route, fixed Clerk client workaround, custom CLI, and beta scripts
  • keep /mcp as the only MCP endpoint

Testing

  • bun test tests/mcp-server/mcp-auth.test.ts tests/mcp-server/oauth-authorization.test.ts tests/web/auth-navigation.test.ts (23 passing)
  • bun run typecheck
  • bun run build
  • bun run lint (passes with the existing unrelated warning in scripts/ingest-xsd/ingest.ts:34)
  • bunx wrangler deploy --dry-run from apps/mcp-server

Production E2E passed after a Wrangler deployment: Codex registered dynamically, completed Clerk sign-in and branded consent, exchanged the code, initialized MCP, discovered the tools, and called ooxml_element for w:p. The usage event was stored with the Clerk user ID, dynamic client ID, tool, and timestamp.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3bf87c8f8

ℹ️ 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".

Comment thread apps/web/package.json

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 33 files

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread apps/web/package.json
Comment thread apps/web/src/pages/auth/useAuthNavigation.ts
Comment thread .env.example Outdated
Comment thread scripts/probe-mcp-v2.ts Outdated
Comment thread apps/web/src/pages/auth/SignIn.tsx
Comment thread apps/mcp-server/src/index.ts Outdated
Comment thread scripts/ooxml-cli.ts Outdated
Comment thread scripts/login-mcp-v2.ts Outdated
Comment thread apps/web/vite.config.ts
Comment thread scripts/ooxml-cli.ts Outdated
@caio-pizzol caio-pizzol changed the title feat(auth): add Clerk login for MCP and CLI feat(mcp): add standard Clerk-backed OAuth Aug 11, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 22 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread apps/web/src/pages/auth/useAuthNavigation.ts Outdated
Comment thread apps/mcp-server/src/mcp-auth.ts Outdated
Comment thread tests/mcp-server/mcp-auth.test.ts Outdated
@caio-pizzol
caio-pizzol merged commit 28cd6b7 into main Aug 11, 2026
2 checks passed
@caio-pizzol
caio-pizzol deleted the codex/mcp-auth-e2e branch August 11, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants