oauthWorkOSProvider() options, defaults, and errors.
Configure WorkOS
In the WorkOS Dashboard:- Create or open a project.
- Go to Connect > Configuration.
- Enable Dynamic Client Registration.
- Enable Client ID Metadata Document if your MCP clients support it.
- Add your MCP server URL as a Resource Indicator.
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
Configure the MCP server
Scope data by organization
WorkOS can include organization context in the token. Use it to filter tenant-specific data.Verify the setup
Run the server and connect with an OAuth-capable MCP client.- 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.