clerkBLOCK
Put your agent in control with the Clerk CLI
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
The Clerk command-line interface.
Add Clerk to an app
npx -y clerk@latest init
clerk init is the setup path for developers and coding agents. It detects the framework, installs the matching Clerk SDK for npm-based projects when it is missing, and scaffolds the Clerk wiring it can safely generate.
For accountless-capable frameworks (Next.js, Astro, Nuxt, TanStack Start, and React Router), unauthenticated agent runs can start without a Clerk account or browser login. With no --app and no linked project, a first clerk init run creates an unclaimed development application, writes local development keys, and stores a claim breadcrumb for a later clerk auth login. Later runs keep an existing unclaimed application instead of replacing it, unless you pass --fresh. Frameworks without accountless support need an authenticated app target before keys can be pulled: pass --app , use a linked project, or run npx -y clerk@latest init --login in an interactive terminal to log in and link one.
What clerk init changes:
- Installs missing Clerk SDK packages in npm-based projects.
- Creates or updates supported framework files, such as provider wiring,
middleware or proxy files, and sign-in/sign-up routes.
- Writes Clerk keys to an env file when a real or accountless app is available.
- When it creates a new accountless application, writes
.clerk/keyless.json
and adds .clerk/ to .gitignore.
- In npm-based projects, offers to install Clerk agent skills; agent mode runs
that step non-interactively unless --no-skills is passed.
After setup, run clerk doctor to verify the integration:
npx -y clerk@latest doctor
Installation
Homebrew (macOS / Linux)
brew install clerk/stable/clerk
npm
npm install -g clerk
Usage
Usage: clerk [options] [command] Clerk CLI Options: -h, --help Display help for command --input-json Pass command options as a JSON string,
cc4e1a5bee28OBSERVED · 2026-10-11Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add clerk-fixture-fastify --env CLERK_AUTH_TIMEOUT_MS=${CLERK_AUTH_TIMEOUT_MS} --env CLERK_OAUTH_BASE_URL=${CLERK_OAUTH_BASE_URL} --env CLERK_OAUTH_CLIENT_ID=${CLERK_OAUTH_CLIENT_ID} --env CLERK_OAUTH_SCOPES=${CLERK_OAUTH_SCOPES} -- npx -y [email protected]{
"mcpServers": {
"clerk-fixture-fastify": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"CLERK_AUTH_TIMEOUT_MS": "${CLERK_AUTH_TIMEOUT_MS}",
"CLERK_OAUTH_BASE_URL": "${CLERK_OAUTH_BASE_URL}",
"CLERK_OAUTH_CLIENT_ID": "${CLERK_OAUTH_CLIENT_ID}",
"CLERK_OAUTH_SCOPES": "${CLERK_OAUTH_SCOPES}"
}
}
}
}Exposed tools (17)
13 read · 3 write · 1 destructive. Blast radius: 1 tool can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
A | read | the A |
DELETE | destructive | Delete resource |
GET | read | Read resource |
PATCH | write | Partially update resource |
POST | write | Create resource |
PUT | write | Replace resource |
agent | read | Non-interactive agent mode |
auth | read | Manage authentication |
canary | read | Latest canary (pre-release) build |
dev | read | Development instance |
human | read | Interactive terminal mode |
item_id | read | Item ID |
latest | read | Latest stable release |
orgs | read | Organizations only |
prod | read | Production instance |
user_id | read | The ID of the user |
users | read | Users only |
Trust audit
BLOCKgrade F · trust 34/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | WARN |
| L1 | Static analysis of the code | FAIL |
| L2 | Instruction surface (what it tells the agent) | FAIL |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (5 observation(s))
- Network
- declared (7 observation(s))
- Shell
- declared (3 observation(s))
- Dependencies
- not all pinned
- Secrets in source
- found
Findings (25)
!contents.includes("-----BEGIN PRIVATE KEY-----") ||Two cases report success without anything actually being revoked server-side, both inherent to RFC 7009 §2.2, which specifies `200` for an unrecognised token: an already-expired session, and a token a
clerk webhooks listen --token "$(clerk webhooks token)" --forward-to http://localhost:3000/api/webhooks
| `GET` | `/oauth/userinfo` | Fetches the user's `email` and `sub` (user ID) using the stored access token. Base URL defaults to `https://clerk.clerk.com`. |
`components` says which of the four pieces were verified when the run ended: `dns`, `ssl` and `mail` from the domain-status response, `oauth` from whether every required provider has production creden
# Or append to ~/.bashrc:
.agents/skills/audit-clerk-skill
.agents/skills/changesets
const redirectUri = `http://127.0.0.1:${authServer.port}${CALLBACK_PATH}`;"-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQg\n-----END PRIVATE KEY-----\n",
"-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQg\n-----END PRIVATE KEY-----\n",
"missing the -----BEGIN PRIVATE KEY----- framing",
"-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQg\n-----END PRIVATE KEY-----\n",
publishable_key: "pk_live_aWRlYWwtbG91c2UtNjEuY2xlcmsuYWNjb3VudHMuZGV2JA",
publishable_key: "pk_live_aWRlYWwtbG91c2UtNjEuY2xlcmsuYWNjb3VudHMuZGV2JA",
publishable_key: "pk_live_aWRlYWwtbG91c2UtNjEuY2xlcmsuYWNjb3VudHMuZGV2JA",
publishable_key: "pk_live_aWRlYWwtbG91c2UtNjEuY2xlcmsuYWNjb3VudHMuZGV2JA",
const result = decodePublishableKey("pk_live_Y2xlcmsuZXhhbXBsZS5jb20k");DELETE
.env.local.example
.oxfmtrc.json
.oxlintrc.json
.oxlintrc.json
test/e2e/fixtures/astro/CLAUDE.md
import { useCaptureLog, stubFetch } from "../../test/lib/stubs.ts";Gates applied: critical_finding, no_behavioural_pass, undeclared_transfer.
cc4e1a5bee28full audit observations/trust-audit/mcp-server/clerk__cli.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-11 | cc4e1a5bee28 | BLOCK | F | 34 | first audit |
Questions
What is the clerk MCP server?
Put your agent in control with the Clerk CLI
What tools does clerk expose?
17 in total: 13 read-only, 3 that write, and 1 that can delete or overwrite (DELETE). Every one is listed on this page with its risk.
Is clerk safe to connect to an agent?
No — not without reading the findings first. The audit graded it F (34/100) and found 6 critical or high issues in the source. Each one is listed on this page with the file and line it is on. Separately from the audit: 1 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does clerk need?
It reads CLERK_AUTH_TIMEOUT_MS, CLERK_OAUTH_BASE_URL, CLERK_OAUTH_CLIENT_ID, CLERK_OAUTH_SCOPES, CLERK_PLATFORM_API_KEY, CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY, EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY, GITHUB_TOKEN, HOMEBREW_TAP_TOKEN, NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and NUXT_PUBLIC_CLERK_PUBLISHABLE_KEY from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does clerk run?
It speaks streamable-http, so it runs as a service you connect to over the network. It is published on npm as clerk-fixture-fastify at 0.0.0.
How current is this page?
The grade is for one exact copy of the source (cc4e1a5bee28), read on 2026-10-11. The repository is watched and re-audited when it changes.