Using Clerk with AI
Clerk provides support for building AI-powered applications with secure authentication. Whether you're using AI-powered development tools to build applications with Clerk, or building a server that allows AI agents to access user data, these guides cover everything you need to get started.
Use Clerk's MCP server
Clerk provides its own MCP server that helps AI coding assistants provide accurate SDK snippets and implementation patterns. This is useful when building authentication features with Clerk in AI tools. Learn how to connect to Clerk's MCP server.
Build your own MCP implementation
An MCP implementation involves two parties: a "client" and a "server". In web development, the terms "client" and "server" often refer to the frontend (browser) and backend (web server). However, in the context of MCP, these terms have different meanings:
- The "client" is the LLM application that wants to access another service on a user's behalf. For example, Claude would be the "client" if it wants to get access to Gmail.
- The "server" is the system that hosts the protected resources the client wants to access. In this example, this would be Gmail. This is sometimes referred to as the "resource server" or "MCP server".
Clerk supports MCP through dynamic client registration (for registering MCP servers programmatically), consent screens (for secure user authorization), and SDK support, making it an ideal authorization server for MCP implementations.
To learn how to implement both sides of the flow using Clerk, refer to the following guides:
AI prompts
Clerk's AI prompt library provides curated prompts to help you work more efficiently with AI-powered development tools like Cursor, Claude Code, Codex, GitHub Copilot, and more. These prompts guide AI assistants in helping you implement Clerk's features correctly.
To learn more, see the AI prompts guide.
Feedback
Last updated on
Edit on GitHub