Descope Auth MCP Server Template
Descope 認証付き MCP サーバーテンプレート
Descope による完全な MCP 認証を備えた、Render 用のシンプルな FastMCP サーバーテンプレートです。
含まれているもの
Streamable HTTP トランスポートを使用した FastMCP による動作可能な MCP サーバー
FastMCP の
DescopeProviderおよびdescope-mcpSDK による完全な MCP 認可サポート"Hello, world!"を返し、ツールレベルのスコープ要件 (mcp:greet) を強制するサンプルツール (hello) が1つ簡単にデプロイできる
render.yamlブループリント
注: このテンプレートはデフォルトで Render の無料プランにデプロイされます。無料サービスは15分間操作がないと停止し、次のリクエスト時に30〜60秒のコールドスタートが発生します。この遅延中に MCP クライアントがタイムアウトする可能性があります。確実に使用するには、Render ダッシュボードで有料プランにアップグレードしてください。Starter プランではサービスが継続的に実行されます。
Related MCP server: MCP Server Template
前提条件
Descope のセットアップ
Descope コンソールにログインします。
Agentic Identity Hub → MCP Servers に移動します。
+ MCP Server をクリックして新しい MCP サーバーを作成し、名前を付けます。
MCP Client Registration で、Client ID Metadata Documents (CIMD) と Dynamic Client Registration (DCR) を有効にします。オプションで、CIMD を介して登録するクライアントの許可ドメインを制限できます (例:
https://claude.ai)。このフィールドは空のままでも構いません。MCP Server Scopes で、
mcp:greetという名前のスコープと、「ユーザーに挨拶する」のような簡単な説明を追加します。Create をクリックします。
確認ページの
Connect your MCP server to Descopeセクションを展開します。Well-Known URL をコピーします。以下のようになります。
https://api.descope.com/v1/apps/agentic/.../.well-known/openid-configurationこれが
DESCOPE_CONFIG_URLです。
注: Descope は、MCP 仕様で要求されている通り、Resource Indicators (RFC 8707) に従ったトークンを発行します。Render にデプロイする場合やローカルで実行する場合は、MCP サーバー URL セクションを更新する必要があります。
Render へのデプロイ
DESCOPE_CONFIG_URLが必要になるため、ローカルで開発する前に Descope のセットアップ ステップを完了していることを確認してください。
このリポジトリを自分の GitHub アカウントにフォークします。
Deploy to Render をクリックします(または GitHub でこのリポジトリをフォークし、Render アカウントでブループリントとしてインポートします)。
指定した構成で、環境変数を Descope のセットアップ ステップで取得した値に設定します。
キー
値
DESCOPE_CONFIG_URLDescope コンソールからの Well-Known URL
Deploy Blueprint をクリックします。
ライブになったら、Render サービス URL (例:
https://<your-project>.onrender.com) をコピーし、/mcpを追加して、Descope コンソールの MCP Server URLs に追加します。
これで、完全な認証仕様をサポートするリモートホストされた MCP サーバーが完成しました!
ローカル開発
DESCOPE_CONFIG_URLが必要になるため、ローカルで開発する前に Descope のセットアップ ステップを完了していることを確認してください。
まず、このリポジトリを自分の GitHub アカウントにフォークし、以下の手順に従って環境をセットアップします。
# Install dependencies
uv sync
# Set required environment variables
export DESCOPE_CONFIG_URL="<your URL from Descope>"
export SERVER_URL="http://localhost:8000"
# Run the server
uv run server.py --transport http --port 8000ローカルで実行すると、サーバーは http://localhost:8000/mcp で実行されます。
利用可能なツール
ツール | 説明 | 必要なスコープ |
|
|
|
次のステップ
セットアップが完了したら、MCP サーバーを本番環境に移行する場合に推奨される手順がいくつかあります。
独自のツールを追加する
server.py の hello ツールを独自のロジックに置き換えるか、拡張します。新しいツールごとに以下を行います。
Descope コンソールの MCP Server Scopes に新しいスコープを定義します (例:
mcp:your-scope)。@mcp.tool()デコレータを使用してツールを追加します。ツール本体内で
require_scopes(token, ["mcp:your-scope"])を呼び出してアクセス制御を強制します。新しいツールとその必要なスコープを上記の 利用可能なツール テーブルに追加します。
@mcp.tool()
def my_tool() -> str:
token = validate_token()
require_scopes(token, ["mcp:your-scope"])
return "your result"Render でカスタムドメインを使用する
デフォルトでは、サービスには https://<your-project>.onrender.com からアクセスできます。カスタムドメインを使用するには:
Render ダッシュボードで、サービス → Settings → Custom Domains に移動します。
ドメインを追加し、提供された DNS 指示に従います。
ドメインが確認されたら、Descope コンソールの MCP Server URLs を更新してカスタムドメインを使用するようにします (例:
https://mcp.yourdomain.com/mcp)。コードの変更は不要です。
RENDER_EXTERNAL_URLは Render によって自動的に設定され、プライマリドメインを反映します。
すべてのツールをスコープで保護する
require_scopes() チェックは、必要に応じて認証されていないツールを追加できるように、ツールごとに意図的にオプトインにしています。本番サーバーでは、すべてのツールで require_scopes() を呼び出すのが良い習慣です。また、validate_token() と require_scopes() をラップするヘルパーを作成し、各ツールハンドラーの先頭でそれを呼び出すことで、これを一元化することもできます。
MCP 認証の仕組み
MCP クライアント (Claude Desktop、Cursor など) は、MCP サーバーへの接続を試みる際に
/.well-known/oauth-authorization-serverから OAuth メタデータを検出します。クライアントは (CIMD または DCR を介して) 認可サーバーに動的に登録し、ユーザーを Descope のログイン/同意フローにリダイレクトします。
ログイン後、Descope は署名付き JWT を発行します。クライアントはこれをすべての MCP リクエストの Bearer トークンとして含めます。
DescopeProviderは、ツールが呼び出される前に Descope の JWKS エンドポイントを使用して JWT を検証します。ツール内では、
validate_token()がクレームを解析し、require_scopes()がmcp:greetが存在することを確認します。存在しない場合はクライアントにエラーを返します。
詳細はこちら
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
- FlicenseNot gradedqualityDmaintenanceA minimal FastMCP server template for Render deployment with streamable HTTP transport. Provides a starting point for building custom MCP servers with easy one-click deployment capabilities.
- FlicenseNot gradedqualityNot gradedmaintenanceA minimal FastMCP server template for quick deployment to Render with streamable HTTP transport. Provides a foundation for building custom MCP servers with easy local development and one-click deployment capabilities.
- FlicenseNot gradedqualityDmaintenanceA minimal FastMCP server template for Render deployment with streamable HTTP transport. Provides a starting point for building custom MCP servers with easy deployment options.
- FlicenseNot gradedqualityCmaintenanceA minimal, production-ready FastMCP server template with auto-discovery, YAML configuration, authentication, and a knowledgebase, enabling quick scaffolding of new MCP servers.
Related MCP Connectors
Primarily to be used as a template repository for developing MCP servers with FastMCP in Python, P…
An MCP server for Arcjet - the runtime security platform that ships with your AI code.
MCP server for verifying EUDI/Talao wallet data via OIDC4VP (pull) for AI agents.
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/render-examples/descope-render'
If you have feedback or need assistance with the MCP directory API, please join our Discord server