Clerk logo

Clerk

OrganizationPopular
clerk

Official JavaScript repository for Clerk authentication

Publisherclerk
Repositoryjavascript
LanguageTypeScript
Forks
452
Stars
1.7K
Available tools
6
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Clerk exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 6 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    1.7K stars and 452 forks from the linked repository.


💼 Clerk is hiring!

Would you like to work on Open Source software and help maintain this repository? Apply today!


🚀 Get started with Clerk

  1. Sign up for an account.
  2. Create an application in your Clerk Dashboard.
  3. Spin up a new codebase with one of the quickstart guides.

This repository contains the SDKs for environment/platforms that Clerk supports. For example, if you want to use Clerk with Next.js, you can install:

sh
npm install @clerk/nextjs
# or
yarn add @clerk/nextjs
# or
pnpm add @clerk/nextjs

🎓 Learning Clerk

Clerk's full documentation is available at clerk.com/docs.

  • We recommend starting with the quickstart guides. They'll help you quickly add Clerk to your application. If you're starting a new project and aren't sure what to pick, check out our most popular quickstart: Next.js.
  • Clerk offers a comprehensive suite of components designed to seamlessly integrate authentication and multi-tenancy into your application. To learn more about Clerk's components, check out the docs.
  • Clerk's organizations feature provides powerful multi-tenancy capabilities, allowing you to group users, manage roles and permissions, and control access to resources. Perfect for B2B applications, enterprise software, and any multi-tenant system. Learn more in the docs.

🚢 Release notes

Curious what we shipped recently? You can browse the GitHub Releases page or look at the individual CHANGELOG.md files inside each package (e.g. clerk-js CHANGELOG).

🤝 How to contribute

We'd love to have you as part of the Clerk community! 💜

If you'd like to contribute in any way, please read our contribution guidelines. They'll show you how to submit issues, make changes to the SDKs, or open pull requests. If you want to add or edit localizations (e.g. how a button text is translated to your language), you can check out the localizations README.

📝 License

This project is licensed under the MIT license.

See LICENSE for more information.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "clerk": {
      "command": "npx",
      "args": [
        "-y",
        "@clerk/agent-toolkit",
        "-p=local-mcp",
        "--tools=users",
        "--secret-key=sk_123"
      ]
    }
  }
}

Available Tools

  • getUserId

    Tool name: getUserId Description: Get the userId of the current authenticated user if signed in, otherwise return null. Use this tool when you need to identify the current user but don't need their profile details. This tool takes no parameters and is the quickest way to check if a user is authenticated. Example use case: When you need to verify if a user is logged in before performing user-specific operations. . Arguments: Takes no arguments

  • getUser

    Tool name: getUser Description: Retrieves detailed information about a user by their userId, including email addresses, username, profile image, created/updated timestamps, and public metadata. Use this tool when you need comprehensive user information beyond just their ID. If the userId parameter is not provided, it will use the current authenticated user's ID. Example use case: When you need to display user profile information or check user attributes. . Arguments:

    • userId: (string): The userId of the User to retrieve.
  • getUserCount

    Tool name: getUserCount Description: Retrieves the total count of users in your Clerk instance. Use this tool when you need to know the total number of users in the system. This tool takes no parameters and is an efficient way to get just the count without retrieving user details. . Arguments: Takes no arguments

  • updateUser

    Tool name: updateUser Description: Updates an existing user's attributes in your Clerk instance. Use this tool when you need to modify core user information (NOT metadata). Important notes:

    1. If the userId parameter is not provided, it will use the current authenticated user's ID
    2. Only the provided fields will be updated, other fields remain unchanged
    3. For updating metadata, use the specialized metadata update tools instead
    4. Email and phone verification status cannot be changed with this tool Example use cases:
    5. Updating a user's name, username, or other profile information
    6. Enabling or disabling a user account
    7. Setting a user's primary contact information . Arguments:
    • userId: (string): The userId of the User to update.
    • firstName: (string): New first name for the user
    • lastName: (string): New last name for the user
    • username: (string): New username for the user
    • profileImageUrl: (string): URL for the user profile image
  • updateUserPublicMetadata

    Tool name: updateUserPublicMetadata Description: Updates the public metadata associated with a user by merging existing values with the provided parameters. Use this tool when you need to store or update user preferences, settings, or other non-sensitive information. Important characteristics:

    1. A "deep" merge is performed - any nested JSON objects will be merged recursively.
    2. You can remove metadata keys at any level by setting their value to null.
    3. Public metadata is visible to the frontend and should NOT contain sensitive information. Example use case: Storing user preferences, feature flags, or application-specific data that persists across sessions. . Arguments:
    • userId: (string): The userId of the User to update.
    • metadata: (Record<string,any>): The public metadata to set or update. Use null values to remove specific keys.
  • updateUserUnsafeMetadata

    Tool name: updateUserUnsafeMetadata Description: Updates the unsafe metadata associated with a user by merging existing values with the provided parameters. Use this tool when you need to store data that should be accessible both on the frontend and backend. Important characteristics:

    1. A "deep" merge is performed - any nested JSON objects will be merged recursively.
    2. You can remove metadata keys at any level by setting their value to null.
    3. Unsafe metadata is accessible from both frontend and backend code.
    4. Unlike public metadata, unsafe metadata is NOT included in JWT tokens. Example use case: Storing user data that should be modifiable from the frontend but not included in authentication tokens. . Arguments:
    • userId: (string): The userId of the User to update.
    • metadata: (Record<string,any>): The unsafe metadata to set or update. Use null values to remove specific keys.

Use Clerk MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Clerk is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Clerk as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Clerk MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "clerk": {
      "command": "npx",
      "args": [
        "-y",
        "@clerk/agent-toolkit"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Clerk MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Clerk MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Clerk to help me with this task?
Clerk
Sure. I read it.
Here is what I found using Clerk.

Frequently asked questions

What is the Clerk MCP server used for?

Clerk is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Clerk MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Clerk with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Clerk MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Clerk connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Clerk MCP to TypingMind?

Clerk runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Clerk MCP provide in TypingMind?

Clerk exposes 6 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Clerk MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Clerk requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇