モデルコンテキストプロトコル(MCP)サーバー + WorkOS AuthKit
これは、リモート クライアントがWorkOS AuthKitを使用して接続および認証できるようにするModel Context Protocol (MCP)サーバーの例です。
AuthKit は、組織中心の認証モデルなどのユーザー管理機能をサポートしており、ユーザーと組織の権限に基づいてツールへのアクセスを制御できます。
はじめる
まず、 WorkOS ダッシュボードにサインインして WorkOS アカウントを作成します。
次に、MCPサーバーのコールバックURLを、リダイレクトURIとして***「リダイレクト***」→ ***「サインインコールバック」***に追加します。ローカルでテストしている場合はhttp://localhost:8788/callback
、デプロイされている場合は、デプロイされたワーカーのドメイン( /callback
パスと同じ)になります。
次に、 WORKOS_CLIENT_ID
とWORKOS_CLIENT_SECRET
環境変数を設定する必要があります。これらは、WorkOSダッシュボードのAPIキーから取得できます。
これらは、Cloudflare ダッシュボードまたはwrangler
CLI を使用して設定できます。
注: WORKOS_CLIENT_ID
は厳密には秘密ではないため、 wrangler.jsonc
設定ファイルで設定することもできます。ただし、 WORKOS_CLIENT_SECRET
公開されていないため、別の場所で安全に設定する必要があります。
これで完了です。以下のサンプル プレイグラウンドを使用して、リモート MCP サーバーをテストできるようになりました。
MCP認証のテスト
Cloudflare Workers AI プレイグラウンドにアクセスし、ワーカーの URL を入力します。
***[接続]***をクリックすると、WorkOS AuthKit ドメインにリダイレクトされ、サインインして、WorkOS AuthKit ユーザーとして認証されたプレイグラウンドに戻ります。
デモコードでは、 generateImage
ツールはimage_generation
パーミッションによって制御されています。AuthKitのパーミッションの詳細については、こちらをご覧ください。ユーザーにimage_generation
スラッグのパーミッションを割り当てて、プレイグラウンドで追加ツールが有効になる様子を確認してください。
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
リモート クライアントが WorkOS AuthKit を使用して接続および認証できるようにし、ツールに対する権限ベースのアクセス制御を備えた組織中心の認証を提供する MCP サーバーの例。
Related MCP Servers
- -securityAlicense-qualityA lightweight MCP server allowing agents to interact with the WorkOS API for streamlined WorkOS operations through natural language commands.Last updated -5MIT License
- -securityAlicense-qualityA lightweight MCP server that enables Cursor Agents to interact with the WorkOS API, providing access to WorkOS functionality directly from within the editor.Last updated -14MIT License
- AsecurityFlicenseAqualityA server based on the MCP framework that provides remote server management capabilities through SSH, supporting features like connection pooling, file transfers, and remote command execution.Last updated -7
- -securityFlicense-qualityA remote MCP server that can be deployed on Cloudflare Workers without requiring authentication, allowing users to add and use custom tools through the Model Context Protocol.Last updated -