Public API with API keys and hosted MCP server#33
Merged
Conversation
Add an organization-scoped public API surface separate from the internal cookie-authed API: - API keys via the better-auth apiKey plugin, managed from a new "API" settings page (create/copy-once/revoke), scoped to the active org. - Public /v1 REST API (key-authed) with explicit public DTOs decoupled from internal entities: interviews, assessments, submissions, invites, candidates. - Hosted MCP server (Cloudflare McpAgent Durable Object) wrapping /v1 at /mcp and /sse, sharing one API-key verifier with the REST middleware. - API settings page shows ready-to-paste MCP client config, pre-filled with the new key on creation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
coderscreen-web | c0f3794 | Jul 26 2026, 07:12 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
coderscreen-api | c0f3794 | Jul 26 2026, 07:12 PM |
…-ideas # Conflicts: # pnpm-lock.yaml
- Move the apikey table out of the better-auth apiKey plugin into our own
packages/db/src/apikey.db.ts with organizationId as a real, indexed FK
column (no more JSONB metadata filtering) and createdBy for attribution.
- Remove the better-auth apiKey plugin; own key generation, SHA-256 hashing,
and verification in lib/apiKeyAuth.ts.
- Add per-key Cloudflare Worker rate limiting (API_RATE_LIMITER binding).
- Trim McpProps to { apiKey, baseUrl } and set ctx.props via a typed
assignment instead of an unknown double-cast.
- Make ApiKeysView full width and drop the extra divider.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Adds an organization-scoped public API that is a separate surface from the internal cookie-authed API, authenticated with API keys (better-auth apiKey plugin) that users create, copy once, and revoke from a new "API" settings page. The public
/v1REST API is key-authed and returns explicit public DTOs decoupled from internal entities (interviews, assessments, submissions, invites, candidates), so the external contract can stay stable while internal shapes change freely. A hosted MCP server (CloudflareMcpAgentDurable Object) wraps/v1at/mcpand/sse, sharing a single API-key verifier with the REST middleware and exposing one thin tool per endpoint. The API settings page also renders a ready-to-paste MCP client config, pre-filled with the new key at creation time.Note: the
apikeytable is added to the DB schema, so runpnpm --filter @coderscreen/db db:pushbefore this goes live.🤖 Generated with Claude Code