データベース・ツールMCPサーバーの作成およびクライアントとの統合ステップ

この表は、データベース・ツールMCPサーバーを作成し、それをMCPクライアントと統合するステップを示しています。

ステップ タスク プロセス
1 dbtools-mcpという名前のコンパートメントを作成します。 コンパートメントの作成
2 dbtools-mcpという名前のIAMドメインを作成します。 アイデンティティ・ドメインの作成
3 dbtools-mcpコンパートメントにdbtoolsmcpという名前のAutonomous AIデータベースを作成します。 Autonomous AI Databaseインスタンスのプロビジョニング
4 dbtools-mcpコンパートメントにボールトおよびキーを作成します。

Vaultの作成

マスター暗号化キーを作成します

5 データベース接続の作成 データベース接続の作成
6 MCPサーバーを作成します。 データベース・ツールMCPサーバーの作成
7 IAMドメイン・ロールを構成します。 IAMドメイン・ロールの設定
8 ルート・コンパートメントにdbtools-mcpという名前のポリシーを作成します。 ポリシーの作成

「ランタイム・アイデンティティ」「リソース・プリンシパル」に設定されているMCPサーバーの場合、次のポリシー・ステートメントを使用します:

allow group 'dbtools-mcp'/'MCP_All_Users' to use database-tools-mcp-servers-invocation in compartment dbtools-mcp
allow any-user to use database-tools-connections in compartment dbtools-mcp where request.principal.id = 'ocid1.databasetoolsmcpserver.oc1.phx.xxxx'
allow any-user to use database-tools-runtime-work-requests in compartment dbtools-mcp where request.principal.id = 'ocid1.databasetoolsmcpserver.oc1.phx.xxxx'
allow any-user to read secret-bundles in compartment dbtools-mcp where request.principal.id = 'ocid1.databasetoolsmcpserver.oc1.phx.xxxx'
allow any-user to use buckets in compartment dbtools-mcp where request.principal.id = 'ocid1.databasetoolsmcpserver.oc1.phx.xxxx'
allow any-user to manage objects in compartment dbtools-mcp where request.principal.id = 'ocid1.databasetoolsmcpserver.oc1.phx.xxxx'
allow any-user to manage generative-ai-nl2sql in compartment dbtools-mcp where request.principal.id = 'ocid1.databasetoolsmcpserver.oc1.phx.xxxx'

「ランタイム・アイデンティティ」「認証済プリンシパル」に設定されているMCPサーバーの場合、次のポリシー・ステートメントを使用します:

allow group 'dbtools-mcp'/'MCP_All_Users' to use database-tools-mcp-servers-invocation in compartment dbtools-mcp
allow group 'dbtools-mcp'/'MCP_All_Users' to use database-connections in compartment dbtools-mcp
allow group 'dbtools-mcp'/'MCP_All_Users' to use database-tools-connections in compartment dbtools-mcp
allow group 'dbtools-mcp'/'MCP_All_Users' to use database-tools-runtime-work-requests in compartment dbtools-mcp
allow group 'dbtools-mcp'/'MCP_All_Users' to read secret-bundles in compartment dbtools-mcp
allow group 'dbtools-mcp'/'MCP_All_Users' to use buckets in compartment dbtools-mcp
allow group 'dbtools-mcp'/'MCP_All_Users' to manage objects in compartment dbtools-mcp
allow group 'dbtools-mcp'/'MCP_All_Users' to manage generative-ai-nl2sql in compartment dbtools-mcp

詳細は、MCPサーバーのポリシーを参照してください。

  トークン・ベース認証の場合は、IAM認証を有効にし、データベース・ユーザーを作成するポリシーを作成します。
  1. MCPユーザーがIAM認証を使用できるようにするポリシーを作成します。

    allow group 'dbtools-mcp'/'MCP_All_Users' to use database-connections in compartment dbtools-mcp
  2. SQLワークシートを使用してデータベース・ユーザー(グローバル・スキーマ)を作成します。

    -- Global schema with exclusive mapping 
    CREATE USER scott IDENTIFIED GLOBALLY AS 'IAM_PRINCIPAL_NAME=dbtools-mcp/scott@example.com';
    
    -- Global schema with shared mapping 
    CREATE USER mcp_users IDENTIFIED GLOBALLY AS 'IAM_GROUP_NAME=dbtools-mcp/MCP_Users';
9 MCPツールセットを作成します。 MCPツールセットの作成
10 MCPクライアントを登録します。 MCPクライアントの登録
11 個人アクセス・トークンまたはトークンベース認証を使用してMCPサーバーに接続します。

個人アクセス・トークンを使用したMCPサーバーへの接続

トークンベース認証を使用したMCPサーバーへの接続