OCI Cloud MCP Server
Overview
This server is a thin wrapper over the official OCI Python SDK (no OCI CLI subprocess calls). Think in SDK terms: client class -> method -> kwargs.
Discovery is SDK-first, with thin keyword/resource-action fallback search when you genuinely cannot infer the client or method.
It exposes generic tools that let you:
- List OCI SDK clients available in the current environment
- Search for the right OCI client operation by short keyword/resource-action search
- Inspect the exact contract of an SDK method before calling it
- Invoke any OCI SDK client operation by fully-qualified client class and method name
- Discover available operations for a given OCI client
Recommended low-token workflow:
- If you already know the SDK client class and method, call
describe_oci_operationorinvoke_oci_apidirectly. - If the service family is already obvious, call
list_client_operationson that client class first. - Otherwise, call
find_oci_apionly as a thin escape-hatch fallback with a short SDK-oriented resource/action query like"list regions"or"create vcn"rather than a full sentence. Keeplimitsmall (3-5) on the first discovery call. - Call
describe_oci_operationfor the chosenclient_fqn+operationwhen you need parameter details. - Call
invoke_oci_api. Its defaultresult_mode="auto"keeps list, summarize, and paginated results compact. Useresult_mode="full"only when you need the full payload, and preferfieldswhen you only need a few exact top-level values. - Call
list_oci_clientsonly for capability discovery/debugging, or when search is ambiguous.
Architecture
flowchart TD
A["LLM / Agent"] -->|Known client + method| B["describe_oci_operation / invoke_oci_api"]
A -->|Known client family| C["list_client_operations"]
A -->|Only if unclear| D["find_oci_api"]
C --> B
D --> B
B --> E["OCI Cloud MCP Server"]
E --> F["OCI Python SDK clients"]
F --> G["OCI service APIs"]
E --> H["Compact response shaping\nresult_mode, max_results, fields"]
Running the server
STDIO transport mode
uvx oracle.oci-cloud-mcp-server
HTTP streaming transport mode
ORACLE_MCP_HOST=<bind_host> \
ORACLE_MCP_PORT=<port> \
ORACLE_MCP_BASE_URL=<public_base_url> \
OCI_REGION=<region> \
IDCS_DOMAIN=<idcs_domain> \
IDCS_CLIENT_ID=<client_id> \
IDCS_CLIENT_SECRET=<client_secret> \
IDCS_AUDIENCE=<audience> \
uvx oracle.oci-cloud-mcp-server
Register ${ORACLE_MCP_BASE_URL}/auth/callback in the OCI IAM confidential application. If IDCS_REQUIRED_SCOPES is unset, the default is openid profile email oci_mcp.cloud.invoke. stdio uses the configured OCI CLI profile; HTTP uses the authenticated OCI IAM user.
Tools
| Tool Name | Description |
|---|---|
| list_oci_clients | List OCI SDK clients discoverable in the current environment; best for capability discovery/debugging. |
| find_oci_api | Thin fallback keyword/resource-action search across OCI SDK client methods and return compact matches with client_fqn + operation. |
| describe_oci_operation | Describe a specific OCI SDK method, including required params, optional params, pagination behavior, aliases, and request model hints. |
| invoke_oci_api | Invoke an OCI Python SDK client method via client_fqn + operation. Example: client_fqn="oci.core.ComputeClient", operation="list_instances", params={"compartment_id": "ocid1.compartment.oc1..."} |
| list_client_operations | List public callable operations for a given OCI client class (by fully-qualified name), with optional filtering and compact mode. |
list_oci_clients
Returns a stable list of OCI SDK client classes available in the installed oci Python SDK.
Prefer find_oci_api for task-oriented requests; use this tool when you need to inspect capabilities or debug SDK availability.
Example usage:
{}
Response (shape):
{
"count": 2,
"clients": [
{ "client_fqn": "oci.core.ComputeClient", "module": "oci.core", "class": "ComputeClient" },
{ "client_fqn": "oci.identity.IdentityClient", "module": "oci.identity", "class": "IdentityClient" }
]
}
find_oci_api
- query: Short SDK-oriented resource/action query such as
list regions,launch instance,instance list, orvcn create - client_fqn: Optional client filter when you already know the client
- limit: Maximum matches to return; default is
5and you should usually keep it in the3-5range on the first discovery call - include_params: Include compact method signatures in the response
This is a thin fallback keyword search over OCI SDK client/method metadata, not free-form natural language understanding.
Reduce requests to short search terms rather than full user sentences, and prefer list_client_operations whenever you can already narrow the problem.
Treat this as an escape hatch, not the normal first step.
Example usage:
{
"query": "list instances",
"limit": 5
}
describe_oci_operation
- client_fqn: Fully-qualified client class, e.g.
oci.core.VirtualNetworkClient - operation: Operation name, e.g.
create_vcn - max_model_fields: Maximum number of request-model fields to return per model hint
This is the fastest way to learn:
- which params are required
- whether pagination applies
- whether
vcn_detailsaliases tocreate_vcn_details - which top-level fields exist on a request model such as
CreateVcnDetails
invoke_oci_api
- client_fqn: Fully-qualified client class name, e.g.
oci.core.ComputeClient - operation: Client method/operation, e.g.
list_instances,get_instance,launch_instance, etc. - params: JSON object of keyword arguments as expected by the SDK method (snake_case). These are the same kwargs you would pass in the OCI Python SDK. The server automatically paginates supported collection responses when the SDK operation declares continuation arguments;
list_andsummarize_names alone do not enable pagination. - fields: Optional top-level response fields to project from an object response or each list item after serialization, e.g.
["id", "display_name", "lifecycle_state"] - max_results: Optional total result cap for paginated operations, or top-level list trim for non-paginated responses.
- result_mode:
auto(default),full, orsummary.autokeeps list, summarize, and paginated results compact while leaving other operations full by default.
Collection handling preserves existing list, items, Logging Search results, DNS, and Object Storage output shapes. Unset SDK record arrays are treated as empty pages, not scalar responses; continuation and page metadata are still processed, including Object Storage pages containing only prefixes. Other SDK envelopes with a single declared record array (including Identity Domains resources) retain their native object shape with aggregated records. Original per-page non-record fields are retained in result_meta.page_metadata, including search summaries and SCIM paging metadata. Aggregated SCIM envelopes retain the first start_index and service total_results, with items_per_page reflecting the number of returned resources.
Identity Domains follows page tokens when available, or, when the SDK method accepts start_index, SCIM continuation derived from the response's resource count and total_results. Explicit start_index/count parameters select SCIM mode. Search operations such as search_users carry offsets inside their request model; without a page token, the fetched page is preserved and has_more_results reports remaining resources. Continue those searches manually by updating the request model offset. Object Storage continues via start, not page. result_meta.has_more_results is available in full and summary modes; when a cap stops at a page boundary, continuation is reported as page, start, or start_index in result_meta. If the cap cuts a page, no lossless continuation is advertised. Preserve the original query parameters when continuing.
Every successful result includes boolean result_meta.has_more_results and result_meta.truncated, independent of result mode or payload shape. They indicate underlying result incompleteness, including discarded records within a fetched page; reaching max_results exactly on a final page does not imply truncation. Summary data.sample_truncated describes only the local structural sample and is independent of result completeness. An incomplete result without a supported continuation does not promise lossless resumption; rerun with a larger cap or narrower query instead. Native continuation fields and result_meta.page_metadata describe backend pages, not an intra-page resume cursor.
Scalar and ambiguous multi-array aggregates are returned as native payloads rather than flattened or iterated. If such a response has an SDK next-page token, it is returned as a single page with pagination_used=false, has_more_results=true, and result_meta.next_page; callers can invoke the same operation with params.page to continue. No service-specific merge of aggregate metrics is inferred.
This is a thin wrapper over the corresponding OCI Python SDK method call.
Equivalent Python:
oci.core.ComputeClient.list_instances(compartment_id="ocid1.compartment...")
Equivalent MCP payload:
client_fqn="oci.core.ComputeClient", operation="list_instances", params={"compartment_id": "ocid1.compartment..."}
Example usage:
{
"client_fqn": "oci.core.ComputeClient",
"operation": "list_instances",
"params": {
"compartment_id": "ocid1.compartment.oc1..exampleuniqueID"
},
"fields": ["id", "display_name", "lifecycle_state"],
"max_results": 10
}
Response (shape):
{
"client": "oci.core.ComputeClient",
"operation": "list_instances",
"params": { "...": "..." },
"opc_request_id": "abcd-efgh-....",
"data": { /* full payload or compact summary */ },
"result_meta": {
"result_mode": "summary",
"pagination_used": true,
"max_results": 10
}
}
Notes:
- When
max_resultsis set and pagination applies, the server uses the OCI SDK's bounded paginator instead of fetching the full result set first. - When
result_mode="auto", list, summarize, and paginated operations default to compact summary output while other operations stay full by default. - When
result_mode="summary", the server returns a compact shape that keeps counts, representative samples, and key names while avoiding large payloads. - When
fieldsis set, the server applies a top-level field projection after serialization. This changes only the returned payload shape, not the SDK call itself; unmatched field selections includeavailable_fieldsmetadata, and fully unmatched selections surface as errors instead of silently returning empty objects. - The server now normalizes common type mistakes when SDK metadata is clear, such as
"3"to3,"true"totrue, and simple request-model field coercions based on OCIswagger_types. - On likely parameter-shape invocation errors, the server includes repair hints such as similar operation names, method signatures, expected params, accepted kwargs, and aliases when it can infer them.
- Exposed tools only accept OCI SDK client classes under the
oci.namespace whose class name ends inClient.
list_client_operations
- client_fqn: Fully-qualified client class name, e.g.
oci.identity.IdentityClient - query: Optional filter to avoid returning the full operation list
- limit: Optional maximum number of operations to return
- include_params: Set to
falsefor a smaller response Returns a list of operations with a short summary extracted from docstrings when available.
Example compact usage:
{
"client_fqn": "oci.core.ComputeClient",
"query": "instance",
"limit": 10,
"include_params": false
}
Passing complex model parameters
Many OCI SDK operations expect complex model instances (e.g., CreateVcnDetails) rather than raw dictionaries. This server now automatically constructs SDK model objects from JSON parameters using heuristics:
-
If a parameter name ends with "_details", "_config", "_configuration", or "_source_details", the value will be coerced into the appropriate model class from the client's models module.
- Example: For VirtualNetworkClient.create_vcn, either of these will work: { "client_fqn": "oci.core.VirtualNetworkClient", "operation": "create_vcn", "params": { "create_vcn_details": { "cidr_block": "10.0.0.0/16", "compartment_id": "ocid1.compartment.oc1..exampleuniqueID", "display_name": "my-vcn" } } } { "client_fqn": "oci.core.VirtualNetworkClient", "operation": "create_vcn", "params": { "vcn_details": { "cidr_block": "10.0.0.0/16", "compartment_id": "ocid1.compartment.oc1..exampleuniqueID", "display_name": "my-vcn" } } } In both cases, the server will construct an instance of oci.core.models.CreateVcnDetails.
-
For "create_" and "update_" operations, if the parameter is named like "vcn_details" (missing the verb), the server will also try CreateVcnDetails/UpdateVcnDetails automatically.
-
Nested dictionaries and lists inside such parameters are recursively coerced. For lists that do not obviously map to a model type, you can provide explicit hints.
Explicit model hints (optional):
- __model: Simple class name in the client's models module (e.g., "CreateVcnDetails")
- __model_fqn: Fully-qualified class name (e.g., "oci.core.models.CreateVcnDetails")
Example with explicit hint: { "client_fqn": "oci.core.VirtualNetworkClient", "operation": "create_vcn", "params": { "create_vcn_details": { "__model": "CreateVcnDetails", "cidr_block": "10.0.0.0/16", "compartment_id": "ocid1.compartment.oc1..exampleuniqueID", "display_name": "my-vcn" } } }
Note:
- Parameter names must match the SDK's expected kwargs. For example, the SDK expects "create_vcn_details" for create_vcn. The heuristic also accepts "vcn_details" and will resolve it to the correct model class, but the keyword name still needs to be correct for other methods without such ambiguity.
Authentication and configuration
For stdio, the server uses oracle-mcp-common to resolve outbound OCI SDK
authentication. Set OCI_MCP_AUTH_TYPE to one of:
auto(default): use a security token only when the selected profile directly declaressecurity_token_file; otherwise use that profile's API keyapi_keyorsecurity_token: explicitly select an OCI CLI-compatible profile modeidentity_domain_upst: exchange a file-backed Identity Domains JWT for an OCI UPSTinstance_principal,resource_principal,resource_principal_v212,instance_principal_delegation,resource_principal_delegation, oroke_workload_identity
Profile-backed modes load the default ~/.oci/config, or the file and profile
selected by OCI_CONFIG_FILE and OCI_CONFIG_PROFILE. OCI_REGION overrides
the target SDK client region without changing the selected identity. A directly
selected session-token profile that is unreadable or invalid fails with an
actionable error; it does not silently fall back to API-key authentication.
Principal, delegation, OKE, and Identity Domains modes use the canonical
OCI_MCP_* variables documented by oracle-mcp-common. Every mode receives the
server's derived additional user-agent suffix for MCP telemetry.
| Authentication mode | Required configuration beyond OCI_MCP_AUTH_TYPE |
|---|---|
instance_principal, resource_principal |
None; the OCI SDK discovers the runtime principal |
instance_principal_delegation, resource_principal_delegation |
OCI_MCP_DELEGATION_TOKEN_FILE |
oke_workload_identity |
None by default; OCI_MCP_OKE_SERVICE_ACCOUNT_TOKEN_PATH optionally overrides the mounted token |
identity_domain_upst |
OCI_MCP_IDENTITY_DOMAIN_URL, OCI_MCP_UPST_JWT_FILE, OCI_MCP_IDENTITY_DOMAIN_CLIENT_ID, OCI_MCP_IDENTITY_DOMAIN_CLIENT_SECRET_FILE, and OCI_REGION |
resource_principal_v212 |
OCI_REGION, OCI_MCP_RP_TENANCY_ID, OCI_MCP_RP_RESOURCE_ID, OCI_MCP_RP_PRIVATE_KEY_PATH, OCI_MCP_RP_RCI, and OCI_MCP_RP_T0 |
resource_principal_v212 enables the Database-service RPv2.1.2
resource-principal exchange. The RPT and RPST endpoints default to the
region's OCI realm; override them only when required with
OCI_MCP_RP_RPT_ENDPOINT and OCI_MCP_RP_RPST_ENDPOINT. Treat
OCI_MCP_RP_RCI as sensitive HMAC-key material and do not log or commit it.
HTTP transport authentication remains separate from stdio. At startup, the
server uses oracle-mcp-common to configure the OCI IAM/IDCS provider from
IDCS_*, ORACLE_MCP_BASE_URL, and the required scopes. For each authenticated
HTTP request, it passes the FastMCP access token to the shared HTTP policy to
create a caller-specific token-exchange signer using OCI_REGION. Signers and
OCI SDK clients are not reused across HTTP callers.
Ensure your configured principal has the necessary permissions (least privilege recommended).
Security and privacy
All actions are performed with the permissions of the selected OCI principal or authenticated HTTP user. Follow best practices:
- Use least-privilege IAM policies
- Manage credentials securely
- Avoid logging sensitive data
- Be mindful of network egress and data residency
Third-Party APIs
Developers choosing to distribute a binary implementation of this project are responsible for obtaining and providing all required licenses and copyright notices for the third-party code used in order to ensure compliance with their respective open source licenses.
Disclaimer
Users are responsible for their local environment and credential safety. Different language model selections may yield different results and performance.
License
Copyright (c) 2026 Oracle and/or its affiliates.
Released under the Universal Permissive License v1.0 as shown at
https://oss.oracle.com/licenses/upl/.
Metadata
Release files for oracle.oci-cloud-mcp-server 2.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| oracle_oci_cloud_mcp_server-2.3.0.tar.gz | 58.5 kB | Without provenance | Details for oracle_oci_cloud_mcp_server-2.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| oracle_oci_cloud_mcp_server-2.3.0-py3-none-any.whl | Python 3 | none | any | Details for oracle_oci_cloud_mcp_server-2.3.0-py3-none-any.whl |
Total release size: 84.2 kB
Release files / oracle_oci_cloud_mcp_server-2.3.0.tar.gz
| Download URL | oracle_oci_cloud_mcp_server-2.3.0.tar.gz |
|---|---|
| Size | 58.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c39a2e68ae8d4a76d47110507667d8937cf23c77d2802e8fe8f366906eb9b608
|
|
BLAKE2b-256 checksum How to use checksums |
56cb6e7b05cb1380b96c8d96005b618d9745e3655316b2e88c59d0091d3a2f41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Oracle Linux Server","version":"9.8","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / oracle_oci_cloud_mcp_server-2.3.0-py3-none-any.whl
| Download URL | oracle_oci_cloud_mcp_server-2.3.0-py3-none-any.whl |
|---|---|
| Size | 25.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d118388ad2e1d43a6f9c01a9947cd11e500f59956ed851c5816041cf99552f1a
|
|
BLAKE2b-256 checksum How to use checksums |
8bebdf6736aff8af1ef25dd1bcba08e04f21b8f71c9af66706a6f0ce2a8cac55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Oracle Linux Server","version":"9.8","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for oracle.oci-cloud-mcp-server 2.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.