Skip to main content
Glama
OCI MCP Server

OCI MCP Server

OCI MCP Server

License: Apache 2.0 Python 3.10+ MCP Author

Created and maintained by Sarthak Pansare · open-source under Apache-2.0

Drive Oracle Cloud Infrastructure from any MCP-aware LLM client.

A Model Context Protocol server that exposes the OCI control plane — compute, networking, storage, databases, Kubernetes (OKE), load balancers, KMS vaults, functions, monitoring, and cross-service search — to any LLM tool that speaks MCP: Claude Code, Claude Desktop, Cursor, Codex CLI, Continue, VS Code, Zed, Antigravity, and others.

Token-efficient by design: one-line tool descriptions, compact summaries, pagination defaults, null-stripped responses.


What you can do

> Deploy a public web server called demo using my SSH key.
> Show me every resource in compartment XYZ grouped by type.
> Create a flexible Load Balancer fronting subnets A and B.
> List my OKE clusters and their kubernetes versions.
> Summarize CpuUtilization on instance ocid1.instance... for the last hour.
> Tear down the VCN we just created and the instance attached to it.

Related MCP server: oci-mcp-server

Tool surface (50+ tools across 12 modules)

Module

Highlights

iam

whoami, health_check, list_compartments, list_users, list_availability_domains, list_regions

compute

list/get/launch/action/terminate instances, list_images, list_shapes, list_instance_vnics

networking

VCNs, subnets, internet/NAT/service gateways, route tables, security lists

storage

Object Storage buckets, list_objects, block volumes

database

DB Systems, Autonomous DB

loadbalancer

Load Balancer + Network Load Balancer (create/list/delete)

oke

OKE clusters, node pools (Container Engine for Kubernetes)

vault

KMS vaults + keys (read)

functions

Applications + functions (read)

monitoring

Alarms, metric definitions, metric summaries (MQL)

search

find_resources across every OCI resource type

composite

deploy_web_server (full stack in one shot), teardown_stack


Install

1. Prerequisites

  • Python 3.10+

  • uv (recommended) or pip

  • An OCI account (cloud.oracle.com — Always-Free tier works)

2. Configure OCI credentials

In the OCI Console: avatar → My profile → API keys → Add API key → Generate API key pair.

Save the files:

~/.oci/oci_api_key.pem      # private key
~/.oci/config               # config (paste the snippet from the console)

Example ~/.oci/config:

[DEFAULT]
user=ocid1.user.oc1..xxxx
fingerprint=aa:bb:cc:...
tenancy=ocid1.tenancy.oc1..xxxx
region=us-ashburn-1
key_file=~/.oci/oci_api_key.pem

3. Clone + install

git clone https://github.com/sarthak-pansare/oci-mcp-server
cd oci-mcp-server
uv sync

Connect to your LLM client

The server is a standard MCP server that speaks stdio by default. Most clients only need a small JSON snippet.

Claude Code (CLI)

claude mcp add oci -s user -- uv --directory /absolute/path/to/oci-mcp-server run oci-mcp-server

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "oci": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/oci-mcp-server", "run", "oci-mcp-server"]
    }
  }
}

Cursor

Settings → MCP → + Add new MCP server:

{
  "mcpServers": {
    "oci": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/oci-mcp-server", "run", "oci-mcp-server"]
    }
  }
}

Codex CLI

Edit ~/.codex/config.toml:

[mcp_servers.oci]
command = "uv"
args = ["--directory", "/absolute/path/to/oci-mcp-server", "run", "oci-mcp-server"]

Continue (VS Code / JetBrains)

In your .continue/config.yaml:

mcpServers:
  - name: oci
    command: uv
    args: ["--directory", "/absolute/path/to/oci-mcp-server", "run", "oci-mcp-server"]

VS Code (native MCP)

In .vscode/mcp.json:

{
  "servers": {
    "oci": {
      "type": "stdio",
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/oci-mcp-server", "run", "oci-mcp-server"]
    }
  }
}

Zed

In ~/.config/zed/settings.json:

{
  "context_servers": {
    "oci": {
      "command": {
        "path": "uv",
        "args": ["--directory", "/absolute/path/to/oci-mcp-server", "run", "oci-mcp-server"]
      }
    }
  }
}

Antigravity / generic MCP clients

Any client that supports stdio MCP can launch:

command: uv
args:    ["--directory", "/abs/path/to/oci-mcp-server", "run", "oci-mcp-server"]

Remote mode (HTTP/SSE)

For shared deployments or web-based clients:

uv run oci-mcp-server --transport sse --host 0.0.0.0 --port 3000
# or
uv run oci-mcp-server --transport streamable-http --host 0.0.0.0 --port 3000

Put it behind an authenticating reverse proxy. See SECURITY.md.

Docker

docker build -t oci-mcp-server .
docker run --rm -p 3000:3000 \
  -v ~/.oci:/root/.oci:ro \
  -e OCI_MCP_TRANSPORT=sse \
  oci-mcp-server

Configuration

Env var

Purpose

Default

OCI_CONFIG_FILE

Override OCI config path

~/.oci/config

OCI_PROFILE

Config profile name

DEFAULT

OCI_REGION

Override region from config

(from file)

OCI_MCP_TRANSPORT

stdio | sse | streamable-http

stdio

OCI_MCP_HOST

Host for HTTP/SSE transports

127.0.0.1

OCI_MCP_PORT

Port for HTTP/SSE transports

3000

OCI_MCP_ENABLE

Comma-separated module list, or all

all

Reduce token surface further

If you only need a subset of OCI services, register fewer tools — every tool's description is sent to the LLM on every turn:

uv run oci-mcp-server --enable iam,compute,networking,composite

Token-efficiency strategy

Designed to minimize the cost of using OCI tools with an LLM:

  1. One-line docstrings. Every tool's description fits on a single line. Across all 50+ tools the schema fits in roughly 2 000 tokens.

  2. Compact summaries by default. list_* calls return {id, name, state, ...} — not the full SDK object. Use verbose=True or get_* for full detail.

  3. Pagination + limits. Every list call defaults to limit=50 (max 200) and accepts a page token.

  4. Null-stripping. None / empty fields are removed from every response.

  5. Module gating. --enable lets users register only the services they need.


Smoke test

After installing and restarting your client:

1. Run mcp__oci__whoami         → confirms credentials work
2. Run mcp__oci__list_regions   → confirms network path
3. Run mcp__oci__find_resources query: "query all resources"

For a full end-to-end deployment:

Deploy a web server called demo with this SSH key: ssh-ed25519 AAAAC3...

Roadmap

  • v0.2: Logging, DNS, Events, Notifications, Streaming, Vault crypto, full Tagging UX

  • v0.3: Instance-principal / resource-principal auth, work-request polling helpers

  • v0.4: Terraform-style diffs, cost estimation tool, multi-region fan-out


Contributing

See CONTRIBUTING.md. PRs welcome.

Author

Sarthak Pansare — @sarthak-pansare

If this project saves you time, a ⭐ on the GitHub repo is appreciated.

License

Apache-2.0 — see LICENSE. Copyright © 2026 Sarthak Pansare.

Acknowledgements

Available Tools

55 tools
add_default_routeC

Append a route (cidr -> gateway/IGW/NAT/Service GW) to a route table.

Inputs: route_table_id (required), gateway_id (required), cidr.

create_bucketC

Create a bucket. public_access_type: NoPublicAccess|ObjectRead|ObjectReadWithoutList.

Inputs: compartment_id (required), name (required), namespace, public_access_type.

create_clusterC

Create an OKE cluster (basic; node pool added separately).

Inputs: compartment_id (required), name (required), vcn_id (required), kubernetes_version (required), +2 more.

create_internet_gatewayD

Create an internet gateway.

Inputs: compartment_id (required), vcn_id (required), display_name (required), is_enabled.

create_load_balancerC

Create a flexible Load Balancer. subnet_ids: one regional or two ADs.

Inputs: compartment_id (required), display_name (required), subnet_ids (required), shape, +3 more.

create_nat_gatewayC

Create a NAT gateway (egress for private subnets).

Inputs: compartment_id (required), vcn_id (required), display_name (required).

create_security_listC

Create a security list. ingress_tcp_ports defaults to [22, 80, 443].

Inputs: compartment_id (required), vcn_id (required), display_name (required), ingress_tcp_ports, +1 more.

create_service_gatewayB

Create a service gateway. service_id from list_services.

Inputs: compartment_id (required), vcn_id (required), display_name (required), service_id (required).

create_subnetC

Create a subnet. Omit availability_domain for a regional subnet.

Inputs: compartment_id (required), vcn_id (required), display_name (required), cidr_block (required), +5 more.

create_vcnD

Create a VCN.

Inputs: compartment_id (required), display_name (required), cidr_block, dns_label.

delete_bucketC

Delete an empty bucket.

Inputs: name (required), namespace.

delete_clusterC

Delete an OKE cluster.

Inputs: cluster_id (required).

delete_load_balancerC

Delete a Load Balancer.

Inputs: load_balancer_id (required).

delete_vcnB

Delete a VCN (must be empty).

Inputs: vcn_id (required).

deploy_web_serverA

One-shot: VCN+IGW+route+seclist+subnet+nginx instance. Returns public_ip + URL.

Inputs: compartment_id (required), name (required), ssh_public_key (required), shape, +6 more.

find_resourcesA

Search ALL OCI resources. Examples: 'query all resources where displayName =~ "web*"' 'query instance resources' 'query vcn,subnet resources where lifecycleState = "AVAILABLE"'

Inputs: query (required), limit.

get_clusterC

Get OKE cluster.

Inputs: cluster_id (required).

get_instanceA

Get one instance. verbose=true returns full SDK object.

Inputs: instance_id (required), verbose.

get_namespaceB

Tenancy's Object Storage namespace string.

Inputs: no named parameters.

get_vaultC

Get a vault.

Inputs: vault_id (required).

health_checkB

Ping OCI: list regions, return count.

Inputs: no named parameters.

instance_actionC

Power action. action: START|STOP|SOFTSTOP|RESET|SOFTRESET.

Inputs: instance_id (required), action (required).

launch_instanceB

Launch a compute instance. Use shape_ocpus/memory for flex shapes.

Inputs: compartment_id (required), display_name (required), shape (required), subnet_id (required), +7 more.

list_alarmsC

List monitoring alarms.

Inputs: compartment_id, limit.

list_applicationsC

List Functions applications.

Inputs: compartment_id, limit.

list_autonomous_databasesC

List Autonomous Databases (ADW/ATP).

Inputs: compartment_id, limit, page.

list_availability_domainsA

List availability domains (default compartment: tenancy).

Inputs: compartment_id.

list_bucketsD

List buckets.

Inputs: compartment_id, namespace, limit, page.

list_clustersC

List OKE clusters.

Inputs: compartment_id, limit.

list_compartmentsC

List compartments under a parent (default: tenancy).

Inputs: parent, limit, page, subtree.

list_db_systemsC

List Oracle Base Database systems.

Inputs: compartment_id, limit, page.

list_functionsC

List functions in an application.

Inputs: application_id (required), limit.

list_imagesC

List platform images, newest first.

Inputs: compartment_id, operating_system, operating_system_version, shape, +2 more.

list_instancesC

List compute instances.

Inputs: compartment_id, limit, page.

list_instance_vnicsC

List VNIC attachments (incl. public IP) for an instance.

Inputs: compartment_id (required), instance_id (required).

list_keysB

List keys in a vault. Get management_endpoint from get_vault.

Inputs: compartment_id (required), management_endpoint (required), limit.

list_load_balancersC

List public/private Load Balancers.

Inputs: compartment_id, limit, page.

list_metricsC

List metric definitions in a compartment. namespace e.g. oci_computeagent.

Inputs: compartment_id (required), namespace, name, limit.

list_network_load_balancersC

List Network Load Balancers (L4).

Inputs: compartment_id, limit, page.

list_node_poolsC

List OKE node pools.

Inputs: compartment_id (required), cluster_id, limit.

list_objectsC

List objects in a bucket.

Inputs: bucket (required), namespace, prefix, limit.

list_regionsA

List all OCI regions.

Inputs: no named parameters.

list_resource_typesA

List all resource types searchable via Resource Search.

Inputs: no named parameters.

list_service_gatewaysC

List service gateways (private access to OCI services).

Inputs: compartment_id (required), vcn_id.

list_servicesA

List OCI services available via service gateway.

Inputs: no named parameters.

list_shapesC

List compute shapes available in a compartment.

Inputs: compartment_id, availability_domain, limit.

list_subnetsC

List subnets, optionally filtered by VCN.

Inputs: compartment_id (required), vcn_id, limit, page.

list_usersC

List IAM users.

Inputs: limit, page.

list_vaultsC

List KMS vaults.

Inputs: compartment_id, limit.

list_vcnsC

List VCNs.

Inputs: compartment_id, limit, page.

list_volumesC

List block volumes.

Inputs: compartment_id, limit, page.

summarize_metricsB

Run a MQL summary. Times: ISO8601. Query: e.g. 'CpuUtilization[1m].mean()'.

Inputs: compartment_id (required), namespace (required), query (required), start_time (required), +2 more.

teardown_stackA

Terminate an instance and tear down its VCN (subnets, gateways, security lists).

    Order: instance(s) -> subnets -> clear route tables -> IGW/NAT/Service gateways
    -> non-default security lists -> non-default route tables -> VCN.
    

Inputs: compartment_id (required), instance_id, vcn_id.

terminate_instanceC

Terminate an instance.

Inputs: instance_id (required), preserve_boot_volume.

whoamiA

Tenancy/user/region from loaded OCI config — canonical 'connected?' check.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.8/5.0

    Scored across 55 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes, but composite tools like 'deploy_web_server' and 'teardown_stack' overlap with individual creation/deletion tools, causing potential confusion for an agent.

    Naming Consistency4/5

    Tools predominantly follow a verb_noun pattern (e.g., create_bucket, list_instances), but 'instance_action' and 'whoami' deviate slightly, and 'health_check' does not follow the pattern. Overall fairly consistent.

    Tool Count4/5

    55 tools is high but justified by the broad scope of OCI service coverage. The set feels slightly large but each tool serves a distinct resource or operation, so it is reasonable.

    Completeness3/5

    The tool surface covers many OCI resources but lacks update and delete operations for several resources (e.g., security lists, route tables). Some lifecycle operations are missing, which may cause agent failures.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • 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
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for interacting with QUADS infrastructure systems via API, enabling resource management and automation through LLM applications.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      An MCP server that lets AI models interact with Oracle Fusion Cloud HCM across its entire REST surface. It uses generic, schema-aware tools to dynamically discover licensed modules and resources without per-endpoint code.
      6
      Apache 2.0