File length: 8106 # Quickstart - Build with AI Tools Source: https://supertokens.com/docs/quickstart/build-with-ai-tools ## Overview If you plan on using large language models (LLMs) to assist in the process of integrating SuperTokens, the documentation exposes a set of helpers that can aid you. ## Text documentation You can access all the documentation as plain text markdown files by appending `.md` to the end of any URL or by using the `Copy Markdown` button, from the top right part of each page. For example, you can find the plain text version of this page at [https://supertokens.com/docs/quickstart/build-with-ai-tools.md](https://supertokens.com/docs/quickstart/build-with-ai-tools.md). This plain text format is ideal for AI tools and agents as it: - Contains fewer formatting tokens. - Displays content that might otherwise be hidden in the HTML or JavaScript-rendered version (such as content in tabs). - Maintains a clear markdown hierarchy that LLMs can easily parse and understand. - Can be read in a paginated format using the `offset` and `length` query parameters. ### `/llms.txt` The documentation website hosts an [/llms.txt file](https://supertokens.com/docs/llms.txt) which instructs AI tools and agents on how to retrieve the plain text versions of our pages. The file follows an [emerging standard](https://llmstxt.org/) for enhancing content accessibility to LLMs. Additionally, to access the entire documentation content in a single page you can use the [/llms-full.txt file](https://supertokens.com/docs/llms-full.txt). Keep in mind that this file is really large and might get ignored by LLMs. You can use the `offset` and `length` query parameters to paginate the content. ## Model Context Protocol (MCP) Server If you want to leverage the agentic capabilities of an LLM tool you can use the **SuperTokens Model Context Protocol** (MCP) server. The server exposes a set of tools which instruct the LLM on how to access and read the documentation as well as how to administer your authentication integration. ### Installation You can use the MCP server in two ways: - over HTTP, as an endpoint exposed by your current server - as a CLI script, over STDIO #### Using HTTP ### Install the plugin ```bash npm i -s supertokens-mcp-plugin ``` ```bash yarn add supertokens-mcp-plugin ``` ```bash pnpm add supertokens-auth-react supertokens-web-js ``` ### Update the SDK initialization code Initialize and include the `SuperTokensAdminMcpServer` in your SDK configuration. You have to specify how the client will be authorized through either [claim validators](/docs/additional-verification/session-verification/claim-validation) or through custom logic defined in the `validateTokenPayload` function. ```ts const adminMcpServer = new SuperTokensAdminMcpServer({ path: "/mcp/admin", validateTokenPayload: async (accessTokenPayload) => { // Use custom logic to authenticate who can access the admin MCP server return { status: "OK" }; }, claimValidators: [UserRoleClaim.validators.includes("admin")], }); export const SuperTokensConfig = { supertokens: { connectionURI: "", apiKey: "", }, appInfo: { appName: "", apiDomain: "", websiteDomain: "", apiBasePath: "", websiteBasePath: "", }, recipeList: [ // Include your existing recipes here // The OAuth2Provider recipe is required for the MCP authorization process OAuth2Provider.init(), ], // Pass the MCP server through the plguin configuration section experimental: { plugins: [ SuperTokensMcpPlugin.init({ mcpServers: [adminMcpServer], }), ], }, }; ``` ### Add the MCP server in a client configuration Add the following to your `~/.cursor/mcp.json` file. To learn more, see the [Cursor documentation](https://docs.cursor.com/context/model-context-protocol). ```json { "mcpServers": { "server-with-authentication": { "command": "npx", "args": ["mcp-remote", "/mcp"] } } } ``` Add the following to your `.vscode/mcp.json` file. To learn more, see the [VS Code documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers). ```json { "servers": { "server-with-authentication": { "command": "npx", "args": ["mcp-remote", "/mcp"] } } } ``` Add the following to your `~/.codeium/windsurf/mcp_config.json` file. To learn more, see the [Windsurf documentation](https://docs.windsurf.com/windsurf/cascade/mcp). ```json { "mcpServers": { "server-with-authentication": { "command": "npx", "args": ["mcp-remote", "/mcp"] } } } ``` Add the following to your `claude_desktop_config.json` file. To learn more, see the [Claude Desktop documentation](https://modelcontextprotocol.io/quickstart/user). ```json { "mcpServers": { "server-with-authentication": { "command": "npx", "args": ["mcp-remote", "/mcp"] } } } ``` #### Using STDIO If you plan on using the server locally you can run it directly through `npx`. You have to provide a set of environment variables that match the SDK configuration values. Add the following to your `~/.cursor/mcp.json` file. To learn more, see the [Cursor documentation](https://docs.cursor.com/context/model-context-protocol). ```json { "mcpServers": { "supertokens": { "command": "npx", "args": ["-y", "supertokens-mcp-plugin"], "env": { "APP_NAME":"", "API_DOMAIN":"", "WEBSITE_DOMAIN":"", "API_BASE_PATH":"", "WEBSITE_BASE_PATH":"", "CONNECTION_URI":"", "API_KEY":"API_KEY" } } } } ``` Add the following to your `.vscode/mcp.json` file. To learn more, see the [VS Code documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers). ```json { "servers": { "supertokens": { "command": "npx", "args": ["-y", "supertokens-mcp-plugin"], "env": { "APP_NAME":"", "API_DOMAIN":"", "WEBSITE_DOMAIN":"", "API_BASE_PATH":"", "WEBSITE_BASE_PATH":"", "CONNECTION_URI":"", "API_KEY":"API_KEY" } } } } ``` Add the following to your `~/.codeium/windsurf/mcp_config.json` file. To learn more, see the [Windsurf documentation](https://docs.windsurf.com/windsurf/cascade/mcp). ```json { "mcpServers": { "supertokens": { "command": "npx", "args": ["-y", "supertokens-mcp-plugin"], "env": { "APP_NAME":"", "API_DOMAIN":"", "WEBSITE_DOMAIN":"", "API_BASE_PATH":"", "WEBSITE_BASE_PATH":"", "CONNECTION_URI":"", "API_KEY":"API_KEY" } } } } ``` Add the following to your `claude_desktop_config.json` file. To learn more, see the [Claude Desktop documentation](https://modelcontextprotocol.io/quickstart/user). ```json { "mcpServers": { "supertokens": { "command": "npx", "args": ["-y", "supertokens-mcp-plugin"], "env": { "APP_NAME":"", "API_DOMAIN":"", "WEBSITE_DOMAIN":"", "API_BASE_PATH":"", "WEBSITE_BASE_PATH":"", "CONNECTION_URI":"", "API_KEY":"API_KEY" } } } } ```