Remote MCP Server with WorkOS AuthKit
Enables testing the MCP server with the Cloudflare Workers AI playground, providing a UI for connecting to and interacting with the MCP server.
Allows deploying and hosting the MCP server as a Cloudflare Worker, with instructions for setting environment variables using wrangler CLI and testing the server locally or deployed.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Remote MCP Server with WorkOS AuthKitgenerate an image of a futuristic city skyline"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Model Context Protocol (MCP) Server + WorkOS AuthKit
This is an example Model Context Protocol (MCP) server that allows remote clients to connect and authenticate using WorkOS AuthKit.
AuthKit supports user management features including an organization-centric authentication model allowing you to control tool access based on user and organization permissions.
Getting Started
First to create a WorkOS account by signing into the WorkOS Dashboard.
Next, add the MCP server's callback URL as a Redirect URI under Redirects
-> Sign in callback. If you are testing locally, this will be
http://localhost:8788/callback, or if deployed, the domain of your deployed
worker with the same /callback path.
Next, you must set the WORKOS_CLIENT_ID and WORKOS_CLIENT_SECRET environment
variables. These can be obtained from the WorkOS Dashboard under API Keys.
You can set these in the Cloudflare dashboard or using the wrangler
CLI:
$ npx wrangler secret put WORKOS_CLIENT_ID <your_workos_client_id>
$ npx wrangler secret put WORKOS_CLIENT_SECRET <your_workos_client_secret>Note: The WORKOS_CLIENT_ID isn't technically a secret and so you may also choose
to set it via your wrangler.jsonc configuration file. But WORKOS_CLIENT_SECRET is not
public and should be securely set elsewhere.
And that's it! You can now test out your remote MCP server using the example playground below.
Related MCP server: Remote MCP AuthKit
Testing MCP Authentication
Visit the Cloudflare Workers AI playground and enter the URL of your worker:
# Local
http://localhost:8788/sse
# Deployed
https://<your-worker-domain>/sseAfter clicking Connect, you'll be redirected to your WorkOS AuthKit domain, where you can sign-in, and be returned to the playground authenticated as a WorkOS AuthKit user.
In the demo code, the generateImage tool is gated behind the image_generation permission. You can read more about Permissions in AuthKit here. Try assigning a permission with the image_generation slug to your user to see how it enables additional tools in the playground.
This server cannot be deployed
Maintenance
Related MCP Connectors
- StytchOAuthdev.stytch.mcp
The Stytch MCP server is a reference implementation that demonstrates remote MCP server authentication and authorization using Stytch Connected Apps. It provides OAuth 2.1-compliant authorization (including PKCE), Dynamic Client Registration, and validates Stytch-issued access tokens to enable AI agents to securely interact with external services through permissioned access, supporting scopes like openid, email, profile, and manage:project_data.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
- ArcjetOAuthcom.arcjet
An MCP server for Arcjet - the runtime security platform that ships with your AI code.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceA lightweight MCP server allowing agents to interact with the WorkOS API for streamlined WorkOS operations through natural language commands.5-
- FlicenseNot gradedqualityCmaintenanceEnables remote MCP server connections with WorkOS AuthKit authentication and user management. Supports organization-centric authentication and permission-based tool access control.-
- FlicenseNot gradedqualityCmaintenanceEnables remote MCP client connections with WorkOS AuthKit authentication and organization-based permission controls. Demonstrates permission-gated tool access, such as image generation tools restricted by user permissions.-
- FlicenseNot gradedqualityDmaintenanceA reference MCP server for Cloudflare Workers that provides remote connection support with integrated GitHub OAuth authentication. It enables developers to build and deploy authenticated remote tools with user-specific access controls and persistent state management.-