Skip to main content
Use the WorkOS provider when WorkOS AuthKit is your identity layer. MCP clients authenticate with WorkOS, and your MCP server verifies WorkOS-issued tokens. This guide covers the WorkOS setup path. Use the auth providers API reference for exact oauthWorkOSProvider() options, defaults, and errors.

Configure WorkOS

In the WorkOS Dashboard:
  1. Create or open a project.
  2. Go to Connect > Configuration.
  3. Enable Dynamic Client Registration.
  4. Enable Client ID Metadata Document if your MCP clients support it.
  5. Add your MCP server URL as a Resource Indicator.
The default mcp-use authorization challenge points clients to protected-resource metadata whose resource value is the server base URL. Add a path-specific resource indicator such as http://localhost:3000/mcp only when your clients request that scoped resource value.

Set environment variables

Use the full AuthKit domain as the subdomain value.

Configure the MCP server

You can pass the AuthKit domain directly instead of using an environment variable:
If your tools call the WorkOS Management API, store that API key separately. It is not part of the OAuth provider config.

Scope data by organization

WorkOS can include organization context in the token. Use it to filter tenant-specific data.
Use User Context for shared access-control patterns.

Verify the setup

Run the server and connect with an OAuth-capable MCP client.
Confirm these cases:
  • The client discovers WorkOS OAuth metadata.
  • The client signs in through WorkOS.
  • WorkOS issues an access token whose audience matches the MCP resource indicator.
  • Authenticated tool calls include ctx.auth.user.userId.
  • Organization-scoped tools reject calls without organization context.

Next steps

Runnable WorkOS example

Compare your setup with a working mcp-use WorkOS server.

WorkOS AuthKit MCP guide

Review WorkOS AuthKit MCP setup.

User Context

Use WorkOS identity and organization data inside tools.

WorkOS provider API reference

Look up exact provider options and defaults.