.
├── .gitignore
├── .python-version
├── .venv
├── README.md
├── inspector.sh # インスペクタ起動用スクリプト
├── main.py # メインスクリプト
├── pyproject.toml
└── uv.lock
- python 3.10+
- node.js 22.7.5+
- uv
- インストールはこちら
- OCI 環境(有償無償不問、大阪リージョン必須)
こちらの手順を参考にComputeインスタンスを作成します。
こちらの手順を参考にComputeインスタンスを作成します。
コンソール右上の人型マークをクリックし、ユーザ名をクリックします。
画面をスクロールし、APIキー
をクリックします。
APIキーの追加
をクリックします。
秘密キーのダウンロード
をクリックし、追加
をクリックします。
上記で作成したComputeインスタンス上の~/.oci/config
に貼り付けます。
OCIコンソールにログインし、アナリティクスとAI
から生成AIエージェント
をクリックします。
以下のステップにそって、エージェントとエンドポイントを作成します。
ステータスがアクティブ
になったら、エンドポイントをクリックします。
エンドポイントの OCID を取得し、エディタなどにに控えておきます。
レポジトリ直下にあるmain.py
の以下のポイントを編集します。
<エンドポイントのOCID>
を上記で控えたOCIDに差し替えます。
agent = Agent(
client=client,
agent_endpoint_id="<エンドポイントのOCID>",
instructions="You perform a professional kubernetes engineer and OCI expert. ",
tools=[await k8s_mcp_client.as_toolkit(), await ocidoc_mcp_client.as_toolkit()],
)
以下のコマンドを実行します
./inspector.sh
http://localhost:6274
にアクセスします。
以下のコマンドを実行します。
uv lock --upgrade
uv run main.py
以下のように出力されたら、OCI Generative AI Agents に Tools が登録され始めます。
[07/10/25 15:41:04] INFO MCP client created with pid: 2824257
[07/10/25 15:41:06] INFO MCP client created with pid: 2824350
⠙ pydantic==2.11.7
[07/10/25 15:41:07] INFO Processing request of type ListToolsRequest server.py:619
[07/10/25 15:41:07] INFO Checking integrity of agent details...
INFO Checking synchronization of local and remote agent settings...
INFO Agent settings are not synchronized. Updating remote agent settings
[07/10/25 15:41:13] INFO Waiting for agent ocid1.genaiagent.oc1.ap-osaka-1.amaaaaaassl65iqaju575y3sjqmmik4mirq733x32j5qptqvzqsumsduuqqq to be active...
[07/10/25 15:41:18] INFO Waiting for agent ocid1.genaiagent.oc1.ap-osaka-1.amaaaaaassl65iqaju575y3sjqmmik4mirq733x32j5qptqvzqsumsduuqqq to be active...
[07/10/25 15:41:23] INFO Waiting for agent ocid1.genaiagent.oc1.ap-osaka-1.amaaaaaassl65iqaju575y3sjqmmik4mirq733x32j5qptqvzqsumsduuqqq to be active...
INFO Checking synchronization of local and remote function tools...
╭──────────────────────────────────────────────────────────────── Local and remote function tools found ─────────────────────────────────────────────────────────────────╮
│ Local function tools (20): │
│ ['configuration_view', 'events_list', 'helm_install', 'helm_list', 'helm_uninstall', 'namespaces_list', 'pods_delete', 'pods_exec', 'pods_get', 'pods_list', │
│ 'pods_list_in_namespace', 'pods_log', 'pods_run', 'pods_top', 'read_documentation', 'resources_create_or_update', 'resources_delete', 'resources_get', │
│ 'resources_list', 'search_documentation'] │
│ │
│ Remote function tools (0): │
│ [] │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
INFO Adding local tool configuration_view to remote...