mcp-oci
mcp-oci
Oracle Cloud Infrastructure (OCI) 向けの Model Context Protocol サーバーです。MCP 対応クライアント(Claude Desktop、Claude Code、Cursor、Copilot など)に、OCI リソースのライブ検出、リソース間の関連性のマッピング、再現可能な Terraform の生成を提供します。動作はすべてフラグで制御されます。
これは、クラウド向けの Playwright-MCP のようなものです。インフラストラクチャの知識を手作業で再構築する代わりに、モデルは 「prod コンパートメント内のすべての VCN を表示して」 や 「このコンパートメントの Terraform を生成して」 と尋ねるだけで、構造化されたシークレットを含まない回答を得られます。
機能
ライブ検出 — コンパートメント、リージョン、および OCI Resource Search による任意のリソース。
Terraform 生成 — 既知のタイプ(VCN、サブネット、インスタンス、バケット、コンパートメント)に対する忠実な HCL と、その他に対する注釈付きスケルトン。コンパートメント全体のモジュールとプロバイダー変数も含みます。
依存関係グラフ — ノード/エッジに加え、推奨されるプロビジョニング順序(依存関係を先に)。
シークレットがモデルに届くことはありません — すべてのペイロードは返却前に編集されます。
セキュリティフラグ — アクセスモード、コンパートメント/リージョンの許可リスト、プロビジョニングゲート、ドライラン、JSON 監査ログ(下記参照)。
標準認証 — OCI 設定ファイル(
~/.oci/config)またはインスタンスプリンシパル。サーバーが資格情報を保存することはありません。
Related MCP server: oci-mcp-server
セキュリティモデル
懸念事項 | フラグ | デフォルト | 効果 |
サーバーができること |
|
| 同梱のツールはすべて読み取り専用です。 |
対象となるコンパートメント |
| (すべて) | 設定すると、他のコンパートメントに対する操作は拒否されます。 |
到達可能なリージョン |
| (設定されたリージョン) | 設定すると、これらのリージョンのみがターゲットになります。 |
|
|
| プロビジョニング用の予約ゲート(まだ出荷されていません)。 |
実行せずにプレビュー |
|
| 将来の書き込みツール用: 実行せずに意図を検証してログに記録します。 |
監査証跡 |
|
| ガードされた操作ごとに JSON 行を stderr に出力します。 |
シークレットの編集 | (常時オン) | — | シークレット形式のフィールドは、結果が返される前に |
ツール
検出(読み取り): list_compartments、list_regions、search_resources、list_compartment_resources、get_resource
Terraform(読み取り): generate_terraform、generate_compartment_terraform、build_dependency_graph
クイックスタート — エージェントに追加
npm に @dockndevai/mcp-oci として公開されています。クローンやビルドは不要です。MCP クライアントが npx でオンデマンドに実行します。read-only モードで開始してください。すべての変数は .env.example を、クライアント別の完全なガイドは docs/CLIENTS.md を参照してください。
Claude Code(CLI)
claude mcp add oci -e OCI_PROFILE="DEFAULT" -e OCI_MODE="read-only" -- npx -y @dockndevai/mcp-ociClaude Desktop · Cursor · Windsurf — 同じブロックを claude_desktop_config.json、.cursor/mcp.json、または ~/.codeium/windsurf/mcp_config.json に:
{
"mcpServers": {
"oci": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-oci"
],
"env": {
"OCI_PROFILE": "DEFAULT",
"OCI_MODE": "read-only"
}
}
}
}OpenAI Codex CLI — ~/.codex/config.toml 内:
[mcp_servers.oci]
command = "npx"
args = ["-y", "@dockndevai/mcp-oci"]
env = { OCI_PROFILE = "DEFAULT", OCI_MODE = "read-only" }VS Code(GitHub Copilot、Agent モード) — .vscode/mcp.json 内:
{
"servers": {
"oci": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-oci"
],
"env": {
"OCI_PROFILE": "DEFAULT",
"OCI_MODE": "read-only"
}
}
}
}設定
標準の OCI 設定プロファイルを指定します。安全性のため、エージェントに表示させたいコンパートメントに対して読み取り専用(inspect/read)権限を持つ IAM ユーザー/ポリシーを使用してください。
プロンプト例
「すべてのコンパートメントを一覧表示し、
prodコンパートメント内のすべてのリソースを表示して。」「VCN
ocid1.vcn.oc1..…の Terraform を生成して。」「コンパートメント
…の依存関係グラフを構築して、プロビジョニング順序を教えて。」
ソースから実行(開発)
上記の公開パッケージを推奨します。クローンから実行する場合:
npm install
npm run build
node dist/index.js # with the environment variables set開発
npm run dev # watch mode
npm test # security policy + terraform generation + graph + redaction
npm run typecheckロードマップ
read-write/admin+OCI_ALLOW_APPLYの背後でのterraform plan/applyの実行。より多くのリソースタイプマッパー(ロードバランサー、データベース、DRG、IAM ポリシー)。
クロス環境のドリフト比較。
公開
このサーバーは、公式 MCP レジストリ用の server.json と、npm 所有権検証用の mcpName を同梱しています。npm への公開と MCP レジストリ、Smithery、Glama、Cursor、PulseMCP への掲載については、PUBLISHING.md を参照してください。
ライセンス
MIT
Available Tools
8 toolsbuild_dependency_graphBuild a resource dependency graphBRead-onlyIdempotent
Discover a compartment's resources and return a node/edge dependency graph plus a suggested provisioning order (dependencies first).
Inputs: compartmentId (required).
generate_compartment_terraformGenerate Terraform for a whole compartmentARead-onlyIdempotent
Discover every resource in a compartment and emit a Terraform module (provider variables + one block per resource) to reproduce it. Unrecognised types become annotated skeletons.
Inputs: compartmentId (required).
generate_terraformGenerate Terraform for a resourceARead-onlyIdempotent
Generate a Terraform (HCL) resource block for a single OCI resource by type and OCID. Fetches the resource's attributes and maps them to the matching oci_* resource.
Inputs: ocid (required), resourceType (required), compartmentId.
get_resourceGet resource detailsARead-onlyIdempotent
Fetch detailed attributes for a resource by type and OCID. Known types (Vcn, Subnet, Instance) return full attributes; others return the identifier. Secrets are redacted.
Inputs: ocid (required), resourceType (required), compartmentId.
list_compartment_resourcesList all resources in a compartmentBRead-onlyIdempotent
Enumerate every resource in a compartment (via Resource Search).
Inputs: compartmentId (required).
list_compartmentsList compartmentsARead-onlyIdempotent
List compartments in the tenancy (recursively). Compartments outside the allowlist are filtered out.
Inputs: rootCompartmentId.
list_regionsList subscribed regionsARead-onlyIdempotent
List the regions this tenancy is subscribed to.
Inputs: no named parameters.
search_resourcesSearch resourcesARead-onlyIdempotent
Search tenancy resources using OCI Resource Search. Provide either a structured query (e.g. "query instance resources where displayName =~ 'prod'") or free text.
Inputs: query (required), freeText.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools have distinct purposes, but search_resources and list_compartment_resources both enumerate resources, and generate_compartment_terraform and build_dependency_graph both discover compartment resources, which could cause slight confusion despite clear descriptions.
All tool names follow a consistent snake_case verb_noun pattern (list_*, get_*, search_*, generate_*, build_*), making the set highly predictable and easy to navigate.
With 8 tools, the set is well-scoped for OCI infrastructure discovery and Terraform generation, covering essential operations without unnecessary bloat.
The surface covers discovery, detailed inspection, Terraform generation, and dependency graphing, but lacks direct resource management operations (create/update/delete) and a tool to list all resource types, which could limit some workflows.
Maintenance
Related MCP Connectors
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
CloudOracle - 14-tool multi-cloud compliance MCP: AWS, Azure, GCP posture, IAM, configs.
IaC, CI and dependency security review for coding agents: local scan CLI plus hosted OAuth MCP.
Scans remote MCP servers for protocol, security, and TLS issues; exposes scan tools via MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAutomatically discovers and tests MCP services for security vulnerabilities including command injection, SQL injection, SSRF, path traversal, and sensitive data exposure with detailed reports and remediation guidance.1-
- AlicenseNot gradedqualityDmaintenanceEnables natural-language access to Oracle Cloud Infrastructure resources, allowing users to query compute instances, OKE clusters, networking, and Object Storage via MCP tools.MIT
- FlicenseNot gradedqualityBmaintenanceEnables interaction with Oracle Cloud Infrastructure through the MCP protocol. Supports dynamic profile selection and provides 85 tools for managing compute, databases, networking, IAM, storage, load balancers, OKE, monitoring, and cost management.-
- AlicenseAqualityDmaintenanceMCP server for Oracle Cloud Infrastructure (OCI) that exposes Compute, Networking, and Object Storage operations to MCP clients, with support for multiple authentication modes, read-only enforcement, and per-call region overrides.18MIT