Skip to content

Add Clerk CLI and REST APIs; merge declared surfaces by any locator facet - #80

Open
manovotny wants to merge 6 commits into
UsefulSoftwareCo:mainfrom
manovotny:add-clerk-cli-and-apis
Open

manovotny wants to merge 6 commits into
UsefulSoftwareCo:mainfrom
manovotny:add-clerk-cli-and-apis

Conversation

@manovotny

@manovotny manovotny commented Sep 23, 2026 •

Copy link
Copy Markdown

clerk.com is listed only as an MCP server (it enters the catalog via the Claude MCP directory feed). Clerk also ships a CLI and three documented HTTP APIs with published OpenAPI specs; discovery finds them, but buildDiscoveredEntries skips discovered surfaces for domains already present in the static catalog, so the listing never picks them up.

This adds them through the hand-maintained sources (same route as Railway's CLI entry):

sources/cli.json — the clerk CLI

sources/openapi-manual.json — Clerk's three documented HTTP APIs, from stable vendor URLs that always resolve to the newest published spec (backed by clerk/openapi-specs):

src/lib/discover.ts — one pipeline fix, found by dogfooding the publishing flow: clerk.com now publishes /.well-known/integrations.json (validated against your OwnerDeclaredDiscovery schema), api-catalog, and mcp/server-card.json, and triggering re-discovery surfaced a mergeDeclared bug — it keyed existing surfaces by a single locator (spec || url || …), so a declared surface carrying a spec never matched its discovered twin that only has a base url. clerk.com's stored row now holds clerk-backend-api (discovered) and clerk-backend-api-2 (declared, spec) — the duplicate (domain, type, name) shape validate:batch exists to catch. Matching now tries every facet a surface can be recognized by, ending with type+name (the validator's own duplicate definition) — except that a spec-bearing surface never matches by url, since distinct APIs can share a base url (Clerk's Backend and Platform APIs both live at api.clerk.com/v1). Tests added, including the shared-base-url case; a re-discovery of clerk.com after this deploys collapses the duplicates.

Every fact verified against primary sources: the clerk/cli repo and docs, the published specs (titles, servers, security schemes), and a live authless-initialize probe of https://mcp.clerk.com/mcp (200, streamable-http). Branch is merged up to current main (Datadog entries kept alongside in openapi-manual.json); bun test (55 pass) and bun run build pass.

Disclosure: I work at Clerk — the seed entries cover the static catalog side; the well-known files on clerk.com cover the discovery side.

🤖 Generated with Claude Code

manovotny and others added 5 commits July 6, 2026 10:48
clerk.com was listed only as an MCP server (via the Claude MCP directory
feed). Clerk also ships a CLI and three documented HTTP APIs with published
OpenAPI specs; the discovered entry for clerk.com carries them, but discovered
surfaces are skipped for domains already present in the static catalog, so
they never reached the listing.

- sources/cli.json: the clerk CLI (npm i -g clerk / brew install
  clerk/stable/clerk, OAuth login via `clerk auth login`), docs at
  https://clerk.com/docs/cli
- sources/openapi-manual.json: Backend API (2026-05-12), Frontend API
  (2026-05-12), and Platform API (beta) specs from the canonical
  clerk/openapi-specs repo

Every fact verified against primary sources: the clerk/cli repo, the
clerk/openapi-specs published YAMLs (titles, servers, security schemes),
and clerk.com/docs. MCP endpoint re-probed (authless initialize 200).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
clerk.com now serves the newest spec of each API at a stable URL
(/docs/reference/spec/{bapi,fapi,platform}/latest.yml), so the catalog no
longer pins dated raw.githubusercontent files that go stale on each Clerk
API version release.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…dotsh into add-clerk-cli-and-apis

# Conflicts:
#	sources/openapi-manual.json
mergeDeclared keyed existing surfaces by a single locator (spec || url ||
command || package || name), so an owner-declared surface carrying a spec
could never match its discovered twin that only has a base url — clerk.com's
re-discovery produced clerk-backend-api (discovered, no spec) alongside
clerk-backend-api-2 (declared, spec), the duplicate (domain, type, name)
shape validate:batch exists to catch.

Matching now tries every facet a surface can be recognized by, ending with
type+name — the same pair the batch validator treats as a duplicate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@manovotny
manovotny marked this pull request as ready for review September 23, 2026 15:43
Distinct APIs can share a base url — Clerk's Backend and Platform APIs both
live at api.clerk.com/v1 — so matching a declared surface by url alone let
the Platform declaration merge into the Backend surface and vanish. A
surface with a spec now matches on the spec (and type+name), never its url;
spec-less surfaces keep url matching. Regression test with both APIs added.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant