This feature is currently in beta. Functionality may change before general availability. If you run into any issues, please reach out to our support team.
Clerk provides a remote Model Context Protocol (MCP) server that allows AI agents like Claude, Cursor, and Github Copilot to access Clerk SDK snippets and implementation patterns. This provides AI agents with up-to-date code examples when developing with Clerk.
The Clerk MCP server provides:
SDK snippets: Ready-to-use code patterns for common Clerk features.
Implementation guides: Best practices for authentication flows, Organizations, and more.
Framework-specific examples: Patterns optimized for Next.js, React, and other supported frameworks.
The fastest way to connect is with the Clerk CLI. Run the following command to detect supported AI clients installed on your machine and register Clerk's MCP server:
terminal
clerkmcpinstall
The server is added to each selected client's user-global configuration, so it's available in every project. Reload or restart the client after installing to activate the connection.
Useful variations and related commands:
terminal
# Register in specific clients, or every detected client, without promptingclerkmcpinstall--clientclaude--clientcursorclerkmcpinstall--all# Show every Clerk MCP entry the CLI has registeredclerkmcplist# Remove the entryclerkmcpuninstall# Verify the server is reachableclerkdoctor
If you prefer to configure a client manually, or use a client the CLI doesn't support, select the appropriate tab below to see the specific setup instructions.
If this is the first time you are using an MCP in Codex, you may need to enable the rmcp feature. To do so, add the following into your ~/.codex/config.toml file:
[beta]rmcp =true
Open the ~/.codex/config.toml config file in your preferred editor.
Navigate to Cursor Settings. To find this, open the Command Palette (Cmd/Ctrl + Shift + P) and search for Cursor Settings, or select the gear icon in the top right corner of the app.
In the sidenav, select Tools & MCP.
Select the New MCP Server option, which will open up a new tab with the MCP configuration JSON file.
This usually indicates a network or transport issue. Try disconnecting and reconnecting the MCP server, and ensure your client supports Streamable HTTP transport.