Remote MCP Server with WorkOS AuthKit
模型上下文协议 (MCP) 服务器 + WorkOS AuthKit
这是一个示例模型上下文协议 (MCP)服务器,允许远程客户端使用WorkOS AuthKit进行连接和身份验证。
AuthKit 支持用户管理功能,包括以组织为中心的身份验证模型,允许您根据用户和组织权限控制工具访问。
入门
首先通过登录WorkOS 仪表板创建 WorkOS 帐户。
接下来,在***“重定向***->***登录回调”***下,将 MCP 服务器的回调 URL 添加为重定向 URI。如果您在本地测试,则为http://localhost:8788/callback ;如果已部署,则为已部署 Worker 的域名,且该域名与/callback路径相同。
接下来,您必须设置WORKOS_CLIENT_ID和WORKOS_CLIENT_SECRET环境变量。这些变量可以从 WorkOS 仪表板的API 密钥下获取。
您可以在 Cloudflare 仪表板中或使用wrangler CLI 设置这些:
$ npx wrangler secret put WORKOS_CLIENT_ID <your_workos_client_id>
$ npx wrangler secret put WORKOS_CLIENT_SECRET <your_workos_client_secret>注意: WORKOS_CLIENT_ID从技术上来说并非秘密,因此您也可以选择通过wrangler.jsonc配置文件进行设置。但WORKOS_CLIENT_SECRET并非公开,应在其他安全的地方进行设置。
就这样!现在你可以使用下面的示例游乐场测试你的远程 MCP 服务器了。
Related MCP server: Remote MCP AuthKit
测试 MCP 身份验证
访问Cloudflare Workers AI 游乐场并输入您的工作者的 URL:
# Local
http://localhost:8788/sse
# Deployed
https://<your-worker-domain>/sse单击***“连接”***后,您将被重定向到您的 WorkOS AuthKit 域,您可以在其中登录,然后以 WorkOS AuthKit 用户身份返回到游乐场。
在演示代码中, generateImage工具需要image_generation权限的支持。您可以点击此处了解更多关于 AuthKit 权限的信息。尝试为您的用户分配一个带有image_generation权限的权限,看看它如何在 Playground 中启用其他工具。
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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.
Related MCP Connectors
An MCP server for Arcjet - the runtime security platform that ships with your AI code.
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server teaching AI agents to implement TideCloak: auth, E2EE, IGA, security analysis
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sleepypandu/remote-mcp-authkit'
If you have feedback or need assistance with the MCP directory API, please join our Discord server