oci-mcp
Summary: Use an MCP-capable AI agent to inspect Oracle Cloud Infrastructure resources read-only, with credentials kept local via ~/.oci/config.
oci_whoami: report active tenancy, user, region, auth method, and server permission/allowlist status.oci_list: list one OCI resource type compactly, across a compartment or the whole tenancy, with optional lifecycle-state filtering and verbose output.oci_get: fetch full details for one resource by OCID, or by name for buckets.oci_search: find indexed resources across the tenancy using structured queries or free text; OKE clusters must be reached withoci_listinstead.Inspect resources across compute, block storage, networking, OKE, database, object storage, and identity.
Configure profile, region, mutation allowlist, write tools, and delete tools via environment variables.
Run locally over stdio and add to MCP clients such as Claude Code, Cursor, VS Code, and Zed.
Currently read-only; create/modify/delete capabilities are planned or disabled unless configured, and the allowlist fails closed.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@oci-mcp list all compute instances in the lab compartment"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
oci-mcp
Operate Oracle Cloud Infrastructure from an AI agent.
An MCP server that exposes OCI — compute, block
storage, networking, OKE, database, object storage and identity — as tools an agent
can call, so you can ask for things instead of assembling oci CLI invocations and
copying OCIDs between them.
"which of my instances are running?"
"what's in the test-deploy-kubeflow compartment?"
"show me the config for my OKE cluster"It runs locally over stdio and reads credentials straight from ~/.oci/config, so
they never leave your machine.
Demo
Ask in plain language; the agent picks the tool. No compartment was given here, so it swept the whole tenancy and tagged every row with where it came from:

oci_whoami reports the active tenancy and the server's own permissions — writes
are impossible until you name an allowlisted compartment:

OKE clusters are invisible to OCI Resource Search, so oci_list is the way to reach
them. The tool says so in its own output:

Output above is real, captured from a live tenancy. All identifiers — OCIDs, e-mail, tenancy name, public IPs, and the OCID fragments embedded in OKE node names — were replaced with placeholders before rendering.
Status: read-only today. Create and modify tools are planned — see open issues.
Related MCP server: mcp-server-oci
Requirements
Python 3.12 — pinned in
.python-version;uvfetches it. TheociSDK does not support 3.14.A working
~/.oci/config. Verify withoci iam region-list.
Install
git clone https://github.com/jaiakash/oracle-cloud-mcp.git
cd oracle-cloud-mcp
uv syncRun
uv run oci-mcpThis speaks MCP over stdio, so on its own it just waits on stdin — that is correct, not a hang. Normally your client launches it.
Add to your MCP client
Claude Code:
claude mcp add oci -- uv --directory "$PWD" run oci-mcpCursor, VS Code, Zed and others take the same command as JSON:
{
"mcpServers": {
"oci": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/oracle-cloud-mcp", "run", "oci-mcp"]
}
}
}A stdio server inherits nothing from your shell, so any setting from Configure has to be passed by the client:
claude mcp add oci --env OCI_MCP_COMPARTMENTS=lab -- uv --directory "$PWD" run oci-mcpConfirm it connected by asking the agent to call oci_whoami.
Tools
Tool | What it does |
| Active tenancy, user, region and auth method, plus which compartments this server may modify. Cheap orientation call. |
| List one resource type. Omit |
| Full detail for one resource by OCID — or by name, for buckets. |
| Find anything across the tenancy in one call, by structured query or free text. |
Reads collapse into three dispatch tools because their schemas are uniform: "show me
type in compartment". Results are projected down to the fields that identify and
locate a resource — an OCI Instance has 36 fields, most of them null — with
verbose=true to get the full object.
Resource types
Pass any of these as resource_type:
Service | Values |
compute |
|
block storage |
|
network |
|
OKE |
|
database |
|
object storage |
|
identity |
|
Two quirks worth knowing:
OKE clusters are not indexed by OCI Resource Search, so
oci_searchwill never return one. Useoci_list("cluster").Buckets are addressed by name, not OCID:
oci_get("bucket", "my-bucket").
Configure
Everything is an environment variable, and every default is safe. See
.env.example.
Variable | Default | Purpose |
|
| Profile in |
| profile's region | Region override |
| (empty) | Compartments where mutation is permitted. Empty means none. |
|
| Register write tools |
|
| Register delete tools |
The allowlist fails closed: an unconfigured server cannot mutate anything, anywhere. Name a disposable compartment to enable writes — never the root. A disabled capability's tools are absent from the catalog entirely rather than present and refusing, so an agent cannot be talked into calling one.
oci_whoami reports the active allowlist and flags, and explains why a mutation
would be refused.
Contributing
Contributions are welcome — see CONTRIBUTING.md. Adding a new
resource type is usually a single entry in registry.py and the test suite covers it
automatically, which makes it a good first change.
License
Available Tools
4 toolsoci_getGet one OCI resourceARead-onlyIdempotent
Fetch full details for a single resource.
Use this after oci_list or oci_search has given you an OCID and you need the complete record — configuration, nested settings, tags.
Inputs: target (required), resource_type (required), verbose. Returns: object
oci_listList OCI resourcesARead-onlyIdempotent
List resources of one type, compactly.
Covers compute, block storage, networking, OKE, database, object storage and identity. Results are projected to the identifying fields; pass verbose=True for the full objects.
Omitting compartment scans the whole tenancy and tags each row with the
compartment it came from.
Inputs: resource_type (required), limit, verbose, compartment, +1 more. Returns: object
oci_searchSearch OCI resourcesARead-onlyIdempotent
Find resources of any type across the whole tenancy in one call.
The fastest way to locate something when you do not know its compartment. Prefer this over sweeping oci_list across many types.
Examples: query="query all resources where lifecycleState = 'RUNNING'" query="query instance, volume resources where displayName =~ 'test'" free_text="kubeflow"
Note: Resource Search does not index every service. OKE clusters never appear; use oci_list('cluster') for those.
Inputs: limit, query, free_text. Returns: object
oci_whoamiWho am I on OCIARead-onlyIdempotent
Report the active OCI identity and this server's own permissions.
Returns the tenancy, user, region and auth method in use, plus which compartments may be mutated and which capability flags are enabled.
Call this first in a session to learn what is reachable before acting.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
oci_whoami, oci_list, oci_get, and oci_search have largely distinct purposes. The main overlap is between list (one resource type) and search (cross-type query), but descriptions clearly guide when to use each.
All four tools follow a consistent oci_<verb> snake_case pattern (oci_whoami, oci_list, oci_get, oci_search). The convention is predictable and readable.
Four tools is lean but appropriate for a focused read/discovery server, with each tool covering a distinct aspect: identity, enumeration, detail retrieval, and cross-type search. It is slightly thin for the broad OCI domain but not problematic.
The toolset is entirely read-only: no create, update, delete, or action tools exist, despite oci_whoami advertising mutation permissions. Agents tasked with modifying OCI resources will hit dead ends, constituting a significant gap for an OCI management server.
Maintenance
Related MCP Connectors
Read-only MCP access to a documented IT fleet: state, changes, posture. 15 tools.
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.
Cloud cost, inventory and governance on AWS/Azure/GCP. Read-only by default, optional scoped writes
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for Oracle Container Engine for Kubernetes (OKE) that enables inspection, querying, and troubleshooting of OKE clusters through safe, composable tools.Universal Permissive v1.0
- 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 provides tools to manage Compute, Object Storage, Block Storage, Networking, Autonomous Database, and IAM via the official OCI SDK.2361 npmMIT
- 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