Skip to main content
Glama

mcp-oci

CI License: MIT npm

Ein Model Context Protocol-Server für Oracle Cloud Infrastructure (OCI). Er gibt einem MCP-fähigen Client (Claude Desktop, Claude Code, Cursor, Copilot, …) die Möglichkeit, live OCI-Ressourcen zu entdecken, deren Beziehungen zu kartieren und reproduzierbares Terraform zu generieren – wobei das Verhalten vollständig über Flags gesteuert wird.

Stellen Sie es sich wie ein Playwright-MCP für Ihre Cloud vor: Statt Infrastrukturwissen von Hand aufzubauen, kann das Modell fragen: „Zeige alle VCNs im Prod-Compartment" und „Generiere Terraform für dieses Compartment" und erhält strukturierte, geheimnisfreie Antworten.

Funktionen

  • Live-Erkennung – Compartments, Regionen und beliebige Ressourcen über die OCI-Ressourcensuche.

  • Terraform-Generierung – originalgetreues HCL für bekannte Typen (VCN, Subnetz, Instanz, Bucket, Compartment) und annotierte Skelette für den Rest; ganze Compartment-Module mit Provider-Variablen.

  • Abhängigkeitsgraph – Knoten/Kanten plus eine vorgeschlagene Bereitstellungsreihenfolge (Abhängigkeiten zuerst).

  • Geheimnisse erreichen das Modell nie – jede Nutzlast wird vor der Rückgabe redigiert.

  • Sicherheitsflags – Zugriffsmodi, Compartment-/Regions-Allowlists, Bereitstellungs-Gate, Trockenlauf und JSON-Audit-Protokollierung (siehe unten).

  • Standard-Authentifizierung – OCI-Konfigurationsdatei (~/.oci/config) oder Instance Principals. Keine Anmeldeinformationen werden vom Server gespeichert.

Related MCP server: oci-mcp-server

Sicherheitsmodell

Anliegen

Flag

Standard

Wirkung

Was kann der Server tun?

OCI_MODE

read-only

Alle mitgelieferten Tools sind schreibgeschützt. read-write/admin sind für zukünftige Bereitstellung reserviert und legen derzeit keine zusätzlichen Tools frei.

Welche Compartments sind im Fokus?

OCI_COMPARTMENT_ALLOWLIST

(alle)

Wenn gesetzt, werden Operationen auf andere Compartments verweigert.

Welche Regionen sind erreichbar?

OCI_REGION_ALLOWLIST

(konfigurierte Region)

Wenn gesetzt, dürfen nur diese Regionen angesprochen werden.

Kann es terraform apply ausführen?

OCI_ALLOW_APPLY

false

Reserviertes Gate für die Bereitstellung (noch nicht ausgeliefert).

Vorschau ohne Ausführung

OCI_DRY_RUN

false

Für zukünftige Schreib-Tools: Absicht validieren und protokollieren, ohne auszuführen.

Audit-Trail

OCI_AUDIT_LOG

true

Gibt eine JSON-Zeile pro geschützter Operation an stderr aus.

Geheimnis-Redaktion

(immer aktiv)

—

Geheimnisartige Felder werden vor der Rückgabe durch ***REDACTED*** ersetzt.

Tools

Erkennung (lesen): list_compartments, list_regions, search_resources, list_compartment_resources, get_resource

Terraform (lesen): generate_terraform, generate_compartment_terraform, build_dependency_graph

Schnellstart – zu Ihrem Agenten hinzufügen

Veröffentlicht auf npm als @dockndevai/mcp-oci. Kein Klonen oder Builden nötig – Ihr MCP-Client führt es bei Bedarf mit npx aus. Starten Sie im read-only-Modus; siehe .env.example für alle Variablen und docs/CLIENTS.md für den vollständigen Client-spezifischen Leitfaden.

Claude Code (CLI)

claude mcp add oci -e OCI_PROFILE="DEFAULT" -e OCI_MODE="read-only" -- npx -y @dockndevai/mcp-oci

Claude Desktop · Cursor · Windsurf – derselbe Block in claude_desktop_config.json, .cursor/mcp.json oder ~/.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 – in ~/.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-Modus) – in .vscode/mcp.json:

{
  "servers": {
    "oci": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@dockndevai/mcp-oci"
      ],
      "env": {
        "OCI_PROFILE": "DEFAULT",
        "OCI_MODE": "read-only"
      }
    }
  }
}

Konfiguration

Richten Sie es auf ein Standard-OCI-Konfigurationsprofil aus. Verwenden Sie aus Sicherheitsgründen einen IAM-Benutzer/eine IAM-Richtlinie mit schreibgeschützten (inspect/read)-Berechtigungen für die Compartments, die der Agent sehen soll.

Beispiel-Prompts

  • „Liste alle Compartments auf und zeige dann jede Ressource im prod-Compartment."

  • „Generiere Terraform für VCN ocid1.vcn.oc1..…."

  • „Erstelle einen Abhängigkeitsgraphen für Compartment … und nenne mir die Bereitstellungsreihenfolge."

Aus dem Quellcode ausführen (Entwicklung)

Bevorzugen Sie das oben veröffentlichte Paket. Um aus einem Klon auszuführen:

npm install
npm run build
node dist/index.js   # with the environment variables set

Entwickeln

npm run dev        # watch mode
npm test           # security policy + terraform generation + graph + redaction
npm run typecheck

Roadmap

  • terraform plan / apply-Ausführung hinter read-write/admin + OCI_ALLOW_APPLY.

  • Weitere Ressourcentyp-Mapper (Load Balancer, Datenbanken, DRGs, IAM-Richtlinien).

  • Drift-Vergleich über Umgebungen hinweg.

Veröffentlichung

Dieser Server liefert eine server.json für das offizielle MCP-Registry und einen mcpName für die npm-Besitzvalidierung. Siehe PUBLISHING.md für die Veröffentlichung auf npm und die Auflistung im MCP-Registry, Smithery, Glama, Cursor und PulseMCP.

Lizenz

MIT

Available Tools

8 tools
build_dependency_graphBuild a resource dependency graphB
Read-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 compartmentA
Read-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 resourceA
Read-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 detailsA
Read-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 compartmentB
Read-onlyIdempotent

Enumerate every resource in a compartment (via Resource Search).

Inputs: compartmentId (required).

list_compartmentsList compartmentsA
Read-onlyIdempotent

List compartments in the tenancy (recursively). Compartments outside the allowlist are filtered out.

Inputs: rootCompartmentId.

list_regionsList subscribed regionsA
Read-onlyIdempotent

List the regions this tenancy is subscribed to.

Inputs: no named parameters.

search_resourcesSearch resourcesA
Read-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

    A3.8/5.0

    Scored across 8 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    With 8 tools, the set is well-scoped for OCI infrastructure discovery and Terraform generation, covering essential operations without unnecessary bloat.

    Completeness4/5

    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

    ActivityActive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Automatically 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
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables natural-language access to Oracle Cloud Infrastructure resources, allowing users to query compute instances, OKE clusters, networking, and Object Storage via MCP tools.
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables 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.
      -
    • A
      license
      A
      quality
      D
      maintenance
      MCP 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.
      18
      MIT