メインコンテンツまでスキップ

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 を使用してサインインします。

  1. 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 を自身の値に置き換えてください。

  2. 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) IDTENANT_IDApplication (client) IDAPI_CLIENT_ID として記録します。

    Manifest を開き、既存の api.requestedAccessTokenVersion プロパティを 2 に設定して保存します。その他の manifest プロパティは維持します。これにより、Squid が必要とする token version が Entra から発行されます(詳細は Microsoft token-version documentation を参照)。

    次に、Expose an APIApplication ID URI を完全一致する MCP_URL に設定します。別の client で必要な既存 identifier を持つ registration を再利用する場合は、その identifier を維持し、manifest の identifierUrisMCP_URL を追加します。

    次の値で有効な scope を追加します。

    フィールド
    Scope namemcp.access
    Who can consentAdmins only
    Admin consent display nameSquid 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 を参照)。

  3. 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 APIssquid-mcp-api を選択し、Delegated permissions → mcp.access を選択して追加します。次に Grant admin consent を選択します(詳細は Microsoft permission setup を参照)。

    Allow public client flows は無効のままにします。このチュートリアルでは、secret を使用する confidential Web client を使用します。

  4. Squid Entra integration を作成する

    Squid で Connectors → Available Connectors → Microsoft Entra ID → Add Connector を開きます。Squid には API registration の client ID を設定します。Claude には Claude registration の client ID と secret を設定します。

    フィールド
    Integration IDentra-mcp
    Tenant IDTENANT_ID
    Client IDAPI_CLIENT_ID
    MCP Scope完全な MCP_URL/mcp.access
  5. MCP server に Entra を関連付ける

    agent の Settings に移動し、次の値が設定されていることを確認します。

    設定
    Expose as MCP ServerOn
    OAuth Integrationentra-mcp
    Require Agent API KeyOff

    以降の MCP 呼び出しは Entra を通じて認証されます。Require Agent API Key は Off のままにしてください。両方を設定すると Squid はどちらの認証情報も受け付けるため、agent API key で Entra を迂回できてしまいます。Configuration optionendpoint を保護する を参照してください。

  6. 公開される 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_URL
    authorization_servershttps://login.microsoftonline.com/<TENANT_ID>/v2.0 を含む array
    scopes_supported 内の API scope完全一致する MCP_URL/mcp.access

    標準の openidprofileemailoffline_access scope も表示されるはずです。完全な API scope は、Entra で公開した scope と一致する必要があります。Squid の MCP Scope フィールドには、標準の identity scope だけを指定しないでください。

  7. Claude で connector を追加する

    個人アカウントでは、Customize → Connectors → + → Add custom connector を開きます。

    Team または Enterprise では、owner が Organization settings → Connectors → Add → Custom → Web を開きます。

    次を入力します。

    フィールド
    NameSquid Agent
    MCP server URLMCP_URL
    Advanced settings → OAuth Client IDCLAUDE_CLIENT_ID
    Advanced settings → OAuth Client SecretClaude registration の secret value

    connector を追加します。各ユーザーは Connect を選択し、自身の Entra account でサインインします(Claude connector instructions を参照)。

  8. 実際の tool call を実行する

    Claude conversation を開始し、+ → ConnectorsSquid 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 が返されます。