Clerk
MCP server by keshavkatwe Verified · npm:@toolgrain
Clerk provides OAuth access-token verification for Toolgrain MCP servers. Toolgrain is a TypeScript framework for building schema-validated MCP tools with Zod and serving them over stdio or HTTP. It is aimed at developers who want to protect HTTP endpoints with Clerk.
Install Clerk
Built from the published package, never by AI.
claude mcp add clerk -- npx -y @toolgrain/clerkRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"clerk": {
"args": [
"-y",
"@toolgrain/clerk"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"clerk": {
"args": [
"-y",
"@toolgrain/clerk"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"clerk": {
"args": [
"-y",
"@toolgrain/clerk"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add clerk -- npx -y @toolgrain/clerk{
"mcpServers": {
"clerk": {
"args": [
"-y",
"@toolgrain/clerk"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add clerk npx -y @toolgrain/clerkGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the clerk block.
About
Clerk is the @toolgrain/clerk package in the Toolgrain project. It verifies Clerk OAuth access tokens, so protected HTTP endpoints can check the caller's identity. Toolgrain itself lets developers define reusable tools with Zod, compose them into MCP servers, and serve them from an existing Node or Bun application. Handlers can read typed, verified identities.
The project supports stdio and HTTP transports and implements MCP directly, without the official SDK. It requires Node.js ^24.20.0 and a TypeScript project in strict mode, using Zod ^4.6.6. It is aimed at developers who want to expose application services to MCP clients with schema-validated tools and authorization.
Written from the project's README and checked against it.
What you need
- Node.js ^24.20.0
- TypeScript 5.5.4 or later with strict mode
- Zod ^4.6.6
- ESM module format
Try asking
- Check my Clerk OAuth token before running the protected MCP tools
- Set up an HTTP MCP endpoint that requires Clerk authorization
- Show me how to read the verified identity inside an MCP tool handler
Good to know
- Sessions, SSE, resumability, resources, prompts, and elicitation are not implemented
- Progress reporting and subscriptions are outside the current implementation
- Node 26 is in preview
- HTTP uses independent POST requests with JSON responses
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
What you can do with it
- Protect an HTTP MCP endpoint with Clerk OAuth
- Build MCP servers from typed TypeScript tools
- Serve MCP tools over stdio or HTTP
Alternatives to Clerk
All alternatives →Turns GitHub repositories into architecture diagrams, written explanations, Mermaid source and narrated explainer videos. Built for developers who want to understand a codebase, and for AI agents that need to read one.
Mocks, records, and chaos-tests HTTP(S) dependencies for development and testing. One port serves many protocols, including gRPC, WebSockets, and LLM chat APIs. Built for developers and testers who need stand-in services during tests.
Provides MCP server and CLI tools that let AI coding agents build, test and manage iOS and macOS projects with Xcode and simulators. It is aimed at developers working on Apple platform apps.
Creates editable draw.io diagrams in AI chat from Mermaid, PlantUML, CSV or draw.io XML. Built for people who want diagrams from text prompts that stay editable in draw.io.
Indexes your code, git history, tests and decisions on your machine so AI coding agents can query the index instead of re-reading files. Built for developers who want fewer files opened and clearer answers about change risk and code health.
Gives your AI assistant hosted codebase intelligence for repos indexed on repowise.dev. Use it to ask how code works, what a change may break, and which tests to run.
Compare with GitDiagram, mockserver or XcodeBuildMCP
Clerk: common questions
What does the Clerk package do in Toolgrain?
It verifies Clerk OAuth access tokens for Toolgrain MCP servers. The source lists it as a package for Clerk OAuth access-token verification.
Which MCP protocol versions does Toolgrain support?
The source lists MCP 2026-07-28 and initialization-based 2025-06-18. Both share the same tool API over stdio and HTTP.
Can I use Toolgrain with Bun?
Yes, the source lists Bun applications with the version range >=1.4.4 <2 as supported.
How do I install Clerk?
In Claude Code run claude mcp add clerk -- npx -y @toolgrain/clerk. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is Clerk the official server?
Clerk is published by npm:@toolgrain from its verified domain in the official MCP Registry.
Is Clerk free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is Clerk safe to use?
It scores 75 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to Clerk?
Similar MCP servers: GitDiagram, mockserver, XcodeBuildMCP, draw.io.
Does Clerk work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
