Microsoft Entra ID を使用して Squid agent を MCP として公開し、Claude に接続する
Microsoft Entra ID で保護された MCP server として Squid agent を公開し、ユーザーが Entra account を使用して Claude から呼び出せるようにします
必要なもの
- 編集可能な既存の Squid agent がある Squid Console の account
- app registration の作成、manifest の編集、テナント全体の admin consent の付与が可能な Microsoft Entra ID tenant(例: Application Administrator または Cloud Application Administrator ロール)
- custom connector をサポートする Claude プラン。Team または Enterprise プランでは、organization owner が connector を追加する必要があります
- MCP server の OAuth metadata を確認するための
curlまたは他の HTTP client
このチュートリアルでは、1 つの Squid agent、1 つの Squid Entra integration、2 つの Entra app registrationを使用します。1 つは保護された API を表し、もう 1 つは Claude を識別します。
管理者がセットアップを一度実行します。その後、ユーザーは Claude で接続し、Entra を使用してサインインします。
-
Squid agent と本番 URL を準備する
Squid Agent Studio で agent を作成または選択し、Test ボタンを使用して動作を確認します(Create an AI agent を参照)。
agent の Settings タブに移動して MCP server を作成します。下にスクロールして Expose as MCP Server を有効にします。このオプションを有効にした後、MCP URL をコピーします(詳細は agent を MCP server として公開する を参照)。例:
https://agents.example.com/mcp/support-agentこのチュートリアルでは、
MCP_URLは末尾のスラッシュを除いたこの URL を意味します。この URL は HTTPS 経由で Claude から到達可能である必要があります。すべてのプレースホルダーおよび例の URL を自身の値に置き換えてください。 -
Entra API registration を作成する
Microsoft Entra admin center で、Entra ID → App registrations → New registration を開きます。
squid-mcp-apiという名前の application を作成し、Accounts in this organizational directory only を選択して、redirect URI は空白のままにします。Directory (tenant) ID を
TENANT_ID、Application (client) ID をAPI_CLIENT_IDとして記録します。Manifest を開き、既存の
api.requestedAccessTokenVersionプロパティを2に設定して保存します。その他の manifest プロパティは維持します。これにより、Squid が必要とする token version が Entra から発行されます(詳細は Microsoft token-version documentation を参照)。次に、Expose an API で Application ID URI を完全一致する
MCP_URLに設定します。別の client で必要な既存 identifier を持つ registration を再利用する場合は、その identifier を維持し、manifest のidentifierUrisにMCP_URLを追加します。次の値で有効な scope を追加します。
フィールド 値 Scope name mcp.accessWho can consent Admins only Admin consent display name Squid agent へのアクセス Admin consent description この application がサインイン済みユーザーに代わって Squid agent を呼び出すことを許可する 例の URL に対する完全な scope は次のとおりです。
https://agents.example.com/mcp/support-agent/mcp.accessこの完全な URL ベースの scope を Entra と Squid で一貫して使用します(Microsoft scope setup を参照)。
-
Claude 用の Entra OAuth client registration を作成する
同じ tenant 内に、
squid-mcp-claudeという名前の別の single-tenant app registration を作成します。redirect platform として Web を選択し、Redirect URI として次を入力します。
https://claude.ai/api/mcp/auth_callbackこの callback は Anthropic に属しています(Claude callback documentation を参照)。この app registration の client ID を
CLAUDE_CLIENT_IDとして記録します。Certificates & secrets → Client secrets → New client secret で secret を作成し、その Value と有効期限を安全に記録します。connector を作成する際、Claude には表示された value が必要です。
API permissions → Add a permission → My APIs で
squid-mcp-apiを選択し、Delegated permissions → mcp.access を選択して追加します。次に Grant admin consent を選択します(詳細は Microsoft permission setup を参照)。Allow public client flows は無効のままにします。このチュートリアルでは、secret を使用する confidential Web client を使用します。
-
Squid Entra integration を作成する
Squid で Connectors → Available Connectors → Microsoft Entra ID → Add Connector を開きます。Squid には API registration の client ID を設定します。Claude には Claude registration の client ID と secret を設定します。
フィールド 値 Integration ID entra-mcpTenant ID TENANT_IDClient ID API_CLIENT_IDMCP Scope 完全な MCP_URL/mcp.access -
MCP server に Entra を関連付ける
agent の Settings に移動し、次の値が設定されていることを確認します。
設定 値 Expose as MCP Server On OAuth Integration entra-mcpRequire Agent API Key Off 以降の MCP 呼び出しは Entra を通じて認証されます。Require Agent API Key は Off のままにしてください。両方を設定すると Squid はどちらの認証情報も受け付けるため、agent API key で Entra を迂回できてしまいます。Configuration option と endpoint を保護する を参照してください。
-
公開される OAuth 設定を確認する
これは MCP client が authorization server を検出するために使用する OAuth 2.0 Protected Resource Metadata document です(OAuth authentication を参照)。次を実行します。
curl -fsS \
'<MCP_URL>/.well-known/oauth-protected-resource'次の値を確認します。
Metadata field 期待値 resource完全一致する MCP_URLauthorization_servershttps://login.microsoftonline.com/<TENANT_ID>/v2.0を含む arrayscopes_supported内の API scope完全一致する MCP_URL/mcp.access標準の
openid、profile、email、offline_accessscope も表示されるはずです。完全な API scope は、Entra で公開した scope と一致する必要があります。Squid の MCP Scope フィールドには、標準の identity scope だけを指定しないでください。 -
Claude で connector を追加する
個人アカウントでは、Customize → Connectors → + → Add custom connector を開きます。
Team または Enterprise では、owner が Organization settings → Connectors → Add → Custom → Web を開きます。
次を入力します。
フィールド 値 Name Squid Agent MCP server URL MCP_URLAdvanced settings → OAuth Client ID CLAUDE_CLIENT_IDAdvanced settings → OAuth Client Secret Claude registration の secret value connector を追加します。各ユーザーは Connect を選択し、自身の Entra account でサインインします(Claude connector instructions を参照)。
-
実際の tool call を実行する
Claude conversation を開始し、+ → Connectors で Squid Agent を有効にします。
agent がサポートするタスクについて、connector を使用するよう Claude に依頼します。求められた場合は tool call を承認し、Claude が実際に tool を呼び出して agent の結果を返すことを確認します。
対応する実行が Squid の agent activity または traces に表示されることを確認します。
Entra client secret は、token acquisition 中に Claude を Entra に対して認証します。Squid は bearer token を受け取り、その signature、設定済み tenant issuer、API audience、および存在する場合は expiration/not-before claims を確認します。token が欠落している、または無効である場合は 401 Unauthorized が返されます。