Remote MCP Server with WorkOS AuthKit

by sleepypandu

Integrations

  • 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.

模型上下文协议 (MCP) 服务器 + WorkOS AuthKit

这是一个示例模型上下文协议 (MCP)服务器,允许远程客户端使用WorkOS AuthKit进行连接和身份验证。

AuthKit 支持用户管理功能,包括以组织为中心的身份验证模型,允许您根据用户和组织权限控制工具访问。

入门

首先通过登录WorkOS 仪表板创建 WorkOS 帐户。

接下来,在***“重定向***->***登录回调”***下,将 MCP 服务器的回调 URL 添加为重定向 URI。如果您在本地测试,则为http://localhost:8788/callback ;如果已部署,则为已部署 Worker 的域名,且该域名与/callback路径相同。

接下来,您必须设置WORKOS_CLIENT_IDWORKOS_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 服务器了。

测试 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 中启用其他工具。

-
security - not tested
F
license - not found
-
quality - not tested

一个示例 MCP 服务器,允许远程客户端使用 WorkOS AuthKit 进行连接和身份验证,为工具提供以组织为中心的身份验证和基于权限的访问控制。

  1. 入门
    1. 测试 MCP 身份验证

      Related MCP Servers

      • -
        security
        F
        license
        -
        quality
        A personal MCP server for securely storing and accessing API keys across projects using the macOS Keychain, letting AI assistants and applications retrieve credentials through natural language.
        Last updated -
        10
        TypeScript
        • Apple
      • -
        security
        -
        license
        -
        quality
        A MCP server that requires user authentication via Auth0, allowing it to call protected APIs on behalf of authenticated users.
        Last updated -
        TypeScript
      • -
        security
        A
        license
        -
        quality
        The Auth0 MCP Server integrates with LLMs and AI agents, allowing you to perform various Auth0 management operations using natural language. For instance, you could simply ask Claude to "Create a new Auth0 app and get the domain and client ID"
        Last updated -
        79
        46
        TypeScript
        MIT License
        • Apple
        • Linux
      • -
        security
        A
        license
        -
        quality
        The m2m-mcp-server-ssh-client provides a unified MCP server interface, securely connecting via SSH to the m2m-mcp-server-ssh-server back-end which aggregates MCP servers. This setup offers secure, single-point access to diverse remote tools using robust SSH key-based authentication.
        Last updated -
        3
        Python
        MIT License
        • Linux
        • Apple

      View all related MCP servers

      ID: 8gumnf3rwb