Skip to main content
Glama
khandrew1

mcp-use-aps-example

by khandrew1

mcp-use + APS 認可の例

このスタンドアロンの例では、Agent Passport System の aps-mcp-1 プロファイルを、既存の mcp-use TypeScript ミドルウェアシームの背後に配置します。ゲートウェイは vault_echo ツールをプロキシし、next() がアップストリームサーバーに到達する前に、署名付きの一回限りの認可エンベロープを検証します。

実行

npm install
npm test
npm run dev

表示された URL を開くと、組み込みの mcp-use Inspector を使用できます。

  1. メッセージを指定して issue_aps_demo_grant を呼び出します。

  2. その構造化された結果を vault_echo にコピーします。

  3. vault_echo を実行します。APS ミドルウェアは、ディスパッチ前に署名、ターゲット、引数ハッシュ、有効期限、スコープ、リプレイ状態を検証します。

  4. 同じリクエストをもう一度実行すると、アップストリームが呼び出される前にリプレイが拒否されるのを確認できます。

Related MCP server: auth0-3lo-mcp-server

Inspector 互換性

APS MCP プロファイルは通常、そのエンベロープを次の場所に格納します:

tools/call.params._meta["org.agent-passport/authorization"]

現在の Inspector フォームでは、呼び出しごとの任意の _meta を公開できません。インタラクティブなデモンストレーション専用として、このリポジトリは同一のエンベロープを apsAuthorization ツール引数として受け取り、ミドルウェア内で名前空間付きの _meta エントリに移動し、転送前にそれを削除します。本番の MCP クライアントは _meta を直接送信する必要があります。

この localhost デモでは、トランスポート認証はすでに確立されているものとして扱います。本番コードでは OAuth を構成し、検証済みのトランスポートコンテキスト(ctx.auth)からその事実を導出する必要があります。

APS は独立したサードパーティのプロジェクトであり、MCP や mcp-use の一部ではありません。

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Demonstrates the AgentCore Gateway 3-Legged OAuth flow with Auth0, exposing whoami and echo tools for end-to-end authorization code testing.
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables agents to self-provision tenancies via a single tool call and then publish, list, inspect, call, and remove their own echo, HTTP, and Python tools at runtime, with per-tenant namespaces, stateless streamable-HTTP transport, and admin metering.
    Apache 2.0
  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides a policy-controlled MCP gateway that lets agents invoke tools with explicit policies, bounded execution, scoped visibility, and decision receipts.
    MIT