ThunderID MCP Server
Connect your AI coding assistant to the ThunderID Model Context Protocol (MCP) server to manage applications and authentication flows, inspect themes, and generate React integration code.
Overview
The MCP server is available through the /mcp endpoint of your ThunderID instance (default: https://localhost:8090/mcp). MCP clients discover the available tools automatically through the protocol.
Protocol Version Support
ThunderID supports MCP protocol versions 2024-11-05 through 2026-07-28, including the stateless core introduced in 2026-07-28. Existing MCP clients continue to work without changes; ThunderID negotiates the protocol version per request. See the MCP specification for what changes between versions.
Authentication
The endpoint follows the MCP Authorization Specification. The MCP server publishes protected resource metadata at /.well-known/oauth-protected-resource, advertising ThunderID as the OAuth authorization server. If a trusted issuer is configured, the metadata advertises that issuer instead. Spec-compliant MCP clients discover this automatically and run an OAuth authorization code + PKCE flow: you sign in through the browser, and the client obtains and refreshes tokens on its own. There is no manual token handling.
Access requires the system scope, and permissions come from the signed-in user, so sign in with an administrator account.
Prerequisites
- ThunderID server running (default:
https://localhost:8090) - Access to the ThunderID Console with an administrator account
- Your selected agent client installed: Claude Code or Codex CLI
Setup
Select your agent client below to connect it to a local ThunderID instance. After connecting, ask the agent to list your applications or integrate authentication into your project.
- Claude Code
- Codex
- Claude Desktop
- GitHub Copilot
For this local setup, Claude Code uses Dynamic Client Registration to register its own OAuth client. You do not need to create an application in the Console.
Enable Dynamic Client Registration
Claude Code also supports a pre-registered OAuth client through --client-id. To enable Dynamic Client Registration for this walkthrough, add the following to deployment.yaml in your ThunderID distribution:
oauth:
dcr:
insecure: true
This setting is for local development only. It lets any client register with ThunderID without authentication. Do not enable it in production.
Restart ThunderID after saving the file.
Trust the Certificate for Claude Code
Claude Code runs on Node.js. Point it at the ThunderID self-signed certificate so TLS connections to https://localhost:8090 are trusted, without adding anything to your system trust store:
export NODE_EXTRA_CA_CERTS=<THUNDERID_HOME>/config/certs/server.cert
<THUNDERID_HOME> is the directory of your ThunderID distribution. The certificate generated during setup includes subject alternative names for localhost and 127.0.0.1, so modern TLS clients accept it once it is trusted. Run the export in the same terminal session you launch claude from.
Add the MCP Server to Claude Code
claude mcp add --transport http thunderid-mcp https://localhost:8090/mcp
Verify it was added:
claude mcp list
You should see thunderid-mcp in the list.
Authenticate with ThunderID
- Start Claude Code from the same terminal where you exported
NODE_EXTRA_CA_CERTS:claude - Run
/mcpinside the Claude Code prompt. - Select
thunderid-mcpand choose the authenticate option. - A browser tab opens with the ThunderID sign-in page. Sign in with your administrator account.
- Review and approve the requested permissions on the consent screen.
Claude Code obtains and refreshes tokens automatically from here on. It discovers the required system scope from the server's metadata, so there is nothing else to configure.
Verify Claude Code Access
Ask Claude Code to use a tool, for example:
"List the applications registered in ThunderID"
Claude Code calls the matching tool and returns the list of registered applications. To remove the server later, run claude mcp remove "thunderid-mcp" -s local.
Codex CLI connects to the MCP server over OAuth using Dynamic Client Registration. It registers its own OAuth client, so you do not need to create an application in the Console for this local setup.
Enable Dynamic Client Registration for Codex
Add the following to deployment.yaml in your ThunderID distribution:
oauth:
dcr:
insecure: true
Use this setting only for local development. It permits client registration without authentication. Do not enable it in production.
Restart ThunderID after saving the file.
Trust the Certificate for Codex
For a local instance with a self-signed certificate, point Codex at the certificate:
export CODEX_CA_CERTIFICATE=<THUNDERID_HOME>/config/certs/server.cert
Replace <THUNDERID_HOME> with the absolute path to your ThunderID distribution. Run the remaining Codex commands from this terminal so they use the same certificate.
Add the MCP Server to Codex
codex mcp add thunderid-mcp --url https://localhost:8090/mcp
If Codex starts OAuth sign-in during this command, complete it with your administrator account. If it does not, run the command in the next step.
Authenticate Codex with ThunderID
If the previous step completed sign-in, continue to Verify Codex Access. Otherwise, run:
codex mcp login thunderid-mcp --scopes system
Open the authorization URL printed by Codex in your browser. Sign in with your administrator account. If a consent screen appears, review the permissions before approving them.
Codex prints Successfully logged in to MCP server 'thunderid-mcp'. after sign-in. It stores the OAuth credentials and refreshes access tokens for subsequent connections.
Verify Codex Access
Check the server configuration:
codex mcp list
Start a new Codex session from the same terminal:
codex
Run /mcp to inspect the connected server and its tools. Ask Codex:
"Use the thunderid-mcp server to list the applications registered in ThunderID."
Codex calls thunderid_list_applications and returns your registered applications. You can then ask it to integrate authentication into your project using the example prompts below.
To delete the local server configuration later, run codex mcp remove thunderid-mcp.
A step-by-step guide for connecting Claude Desktop to the ThunderID MCP server is on the way. Any MCP client that supports the MCP Authorization Specification with OAuth can connect today with an application registered for that client and its redirect URI.
A step-by-step guide for connecting GitHub Copilot to the ThunderID MCP server is on the way. Any MCP client that supports the MCP Authorization Specification with OAuth can connect today with an application registered for that client and its redirect URI.
What You Can Do
After connecting, ask your agent to use the ThunderID MCP server for tasks such as creating an application, inspecting an authentication flow, or generating SDK integration code. The agent discovers the available tools automatically.
| Toolset | Description |
|---|---|
applications | Create, configure, and manage OAuth applications with pre-built templates for SPA, Mobile, Server, and M2M |
flows | Design and modify authentication and registration flows |
themes | Browse and inspect login page themes, colors, and typography |
organization_units | List organization units |
user_types | List user types and self-registration settings |
react_sdk | Get tailored integration code for the ThunderID React SDK |
Example prompts:
- "Create a new single-page application for my React project"
- "Show me the current authentication flow"
- "Add a second factor step to the default login flow"
- "What colors and typography does the default theme use?"
- "Integrate authentication with ThunderID for this application"
Use Cases
Scaffold a React App with Login
Ask the assistant to create a new React application with authentication wired up end-to-end:
"Create a new React application with authentication using ThunderID"
The assistant scaffolds a React project using Vite, installs the ThunderID React SDK, and wires up the auth provider with the correct clientId and server URL from the application registered in ThunderID. By the end you have a running app with a working sign-in button backed by ThunderID.
To add authentication to an existing React application instead:
"Integrate authentication with ThunderID for this application"
The assistant installs the SDK, configures the auth provider, and adds sign-in and sign-out components without scaffolding a new project.
Add Signup to a React App
After integrating login, add a registration page:
"Integrate a signup page in the application and enable signup"
The assistant enables self-registration on your ThunderID application and generates a signup page wired to the registration flow. New users can register directly from your application and appear in the ThunderID Console under User Management.
Test and Debug with MCP Inspector
Use MCP Inspector to list tools, call them manually, and inspect responses when testing the ThunderID MCP server or diagnosing a connection problem. To use these tools through an AI agent, follow Setup.
Install Node.js and npm before running MCP Inspector.
Register an MCP Client
In the ThunderID Console, register an application for MCP Inspector.
- In the Console, navigate to Applications. Click Add application.
- Select MCP client.
- Enter a name (for example,
MCP Inspector). - If prompted, select an organization unit.
- On the Client type step, select On behalf of a user. This configures the Authorization Code flow with PKCE as a public client.
- Under Redirect URIs, add
http://localhost:6274/oauth/callback. The wizard shows this exact URI as a copyable hint for MCP Inspector. - Click Finish.
- From the completion screen, copy the Client ID. You need it when connecting from MCP Inspector. No client secret is required because this is a public client.
Allow the MCP Inspector Origin
MCP Inspector runs in the browser at http://localhost:6274 and calls ThunderID cross-origin, so its origin must be allowed in the CORS configuration.
Create or update config/resources/server_configs/cors.yaml in your ThunderID distribution, or use PUT /server-config/cors after startup:
name: cors
value:
allowedOrigins:
- "http://localhost:6274"
If the file already exists, append the origin to the existing allowedOrigins list instead of replacing it. Restart ThunderID after editing the file so the change takes effect.
Trust the ThunderID Certificate
MCP Inspector's proxy runs on Node.js. Point Node.js at the ThunderID self-signed certificate so TLS connections to https://localhost:8090 are trusted, without adding anything to your system trust store:
export NODE_EXTRA_CA_CERTS=<THUNDERID_HOME>/config/certs/server.cert
<THUNDERID_HOME> is the directory of your ThunderID distribution. The certificate generated during setup includes subject alternative names for localhost and 127.0.0.1, so modern TLS clients accept it once it is trusted. Run the export in the same terminal session you launch MCP Inspector from.
Launch MCP Inspector
npx @modelcontextprotocol/inspector
The Inspector UI opens at http://localhost:6274.
Connect to the MCP Server
- Set Transport type to Streamable HTTP.
- Set URL to
https://localhost:8090/mcp. - Expand the Authentication section and select OAuth.
- Enter the Client ID you copied earlier. Leave Client secret empty.
- Set Scope to
system. - Click Connect.
- A browser tab opens with the ThunderID sign-in page. Sign in with your administrator account.
- If a consent screen appears, review the requested permissions. Approve them to continue.
- You are redirected back to MCP Inspector, now connected. Tokens are obtained and refreshed automatically from here on.
Verify the Connection
- In MCP Inspector, open the Tools tab and click List Tools.
- Select a tool such as
thunderid_list_applications. Run it. - The response lists the applications registered in ThunderID, including the MCP Inspector application you just created.
If the connection fails, see the Troubleshooting section below.
Troubleshooting
Browser shows a CORS error or the connection hangs
The Inspector origin is missing from the CORS configuration.
- Re-check the
cors.yamlstep under Allow the MCP Inspector Origin. - Restart ThunderID after saving the change.
Certificate or TLS errors
Set the certificate variable for the client you are using:
- Codex:
export CODEX_CA_CERTIFICATE=<THUNDERID_HOME>/config/certs/server.cert - Claude Code or MCP Inspector:
export NODE_EXTRA_CA_CERTS=<THUNDERID_HOME>/config/certs/server.cert
Replace <THUNDERID_HOME> with your distribution path. Confirm the certificate file exists, then restart your client from the same terminal.
Codex or Claude Code cannot register an OAuth client
Client registration is disabled or requires authentication.
- For the local setup above, set
oauth.dcr.insecure: trueindeployment.yaml. - Restart ThunderID.
- Confirm the certificate variable is set for your client.
OAuth client registration fails with "An application with the same name already exists"
A new Dynamic Client Registration request can conflict with an application created during an earlier sign-in. ThunderID rejects duplicate application names.
- In the ThunderID Console, navigate to Applications.
- Identify the application from your previous client registration, such as Codex or Claude Code (thunderid-mcp). Delete it only if you no longer need that registration.
- Retry sign-in with
codex mcp login thunderid-mcp --scopes system, or authenticate Claude Code from/mcp.
Redirect URI error during sign-in
For MCP Inspector, the redirect URI on the application must match http://localhost:6274/oauth/callback. Other clients use their own redirect URIs. The Codex setup above registers its redirect URI automatically.
- Edit the application in the Console.
- Correct the redirect URI under Redirect URIs and save.
403 or insufficient scope after connecting
The signed-in user lacks administrator permissions, or the scope was not set to system.
- Sign in with an administrator account.
- For Codex, run
codex mcp login thunderid-mcp --scopes systemto sign in again with the required scope. For MCP Inspector, set Scope tosystem.
MCP server not responding
Verify ThunderID is running and the endpoint is reachable:
curl -k https://localhost:8090/mcp
A 401 Unauthorized response with a WWW-Authenticate header confirms the endpoint is up and secured. Any other error indicates the server is not running or the URL is incorrect.
Related Guides
- API Reference - Application and Flow Management REST APIs
- React SDK - ThunderID React SDK documentation
- Securing MCP - governing MCP clients and protecting MCP servers with ThunderID
- Codex MCP configuration - Codex client configuration and OAuth commands
- MCP Authorization Specification - MCP auth protocol details