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

これは、リモート クライアントがWorkOS AuthKitを使用して接続および認証できるようにするModel Context Protocol (MCP)サーバーの例です。

AuthKit は、組織中心の認証モデルなどのユーザー管理機能をサポートしており、ユーザーと組織の権限に基づいてツールへのアクセスを制御できます。

はじめる

まず、 WorkOS ダッシュボードにサインインして WorkOS アカウントを作成します。

次に、MCPサーバーのコールバックURLを、リダイレクトURIとして***「リダイレクト***」→ ***「サインインコールバック」***に追加します。ローカルでテストしている場合はhttp://localhost:8788/callback 、デプロイされている場合は、デプロイされたワーカーのドメイン( /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スラッグのパーミッションを割り当てて、プレイグラウンドで追加ツールが有効になる様子を確認してください。

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

リモート クライアントが WorkOS AuthKit を使用して接続および認証できるようにし、ツールに対する権限ベースのアクセス制御を備えた組織中心の認証を提供する MCP サーバーの例。

  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