OCI MCP Server
Configuration
View docs{
"mcpServers": {
"gocoder7-oci-mcp-server": {
"command": "node",
"args": [
"/path/to/oci-mcp-server/dist/simple-index.js"
],
"env": {
"OCI_REGION": "us-ashburn-1",
"OCI_USER_ID": "YOUR_USER_OCID",
"OCI_TENANCY_ID": "YOUR_TENANCY_OCID",
"OCI_KEY_FINGERPRINT": "YOUR_KEY_FINGERPRINT",
"OCI_PRIVATE_KEY_PATH": "/path/to/your/oci_api_key.pem"
}
}
}
}This MCP server provides a unified interface to Oracle Cloud Infrastructure services, optimized for VS Code integration. You can manage compute, storage, network, databases, monitoring, and identity resources through a single, consistent API exposed by the MCP server, then use a compatible MCP client to interact with OCI from your editor or tooling.
You will run the MCP server locally or in your environment and connect to it from your MCP client (such as VS Code). The server exposes OCI operations through a consistent set of services and actions. Use the client to list resources, fetch details, create or delete items, and monitor OCI metrics. Start by configuring authentication, then start the server and point your client to the local process.
Prerequisites: you need Node.js and npm installed on your system.
git clone https://github.com/GoCoder7/oci-mcp-server.git
cd oci-mcp-server
npm install
npm run buildPrepare authentication by copying the example environment setup and editing credentials, then ensure the profile has access to the required OCI resources.
cp .env.example .envFill the following in your environment configuration with your OCI details.
OCI_TENANCY_ID=ocid1.tenancy.oc1..aaaaaaaa...
OCI_USER_ID=ocid1.user.oc1..aaaaaaaa...
OCI_KEY_FINGERPRINT=aa:bb:cc:dd:ee:ff:gg:hh:ii:jj:kk:ll:mm:nn:oo:pp
OCI_PRIVATE_KEY_PATH=/path/to/your/oci_api_key.pem
OCI_REGION=us-ashburn-1
OCI_COMPARTMENT_ID=ocid1.compartment.oc1..aaaaaaaa... (optional)Add a server entry to your editor settings to run the MCP server locally. The entry uses node to execute the server script and sets OCI credentials via environment variables.
{
"mcp.servers": {
"oci_mcp": {
"command": "node",
"args": ["/path/to/oci-mcp-server/dist/simple-index.js"],
"env": {
"OCI_TENANCY_ID": "your-tenancy-id",
"OCI_USER_ID": "your-user-id",
"OCI_KEY_FINGERPRINT": "your-key-fingerprint",
"OCI_PRIVATE_KEY_PATH": "/path/to/your/oci_api_key.pem",
"OCI_REGION": "us-ashburn-1"
}
}
}
}With the MCP server running, use your MCP client to perform operations across OCI resources. Common workflows include listing compute instances, retrieving details for a specific resource, creating object storage buckets, listing virtual networks, and monitoring performance metrics. Each operation adheres to the available services and actions exposed by the server.
Set up an OCI API key pair and grant the necessary permissions to your user. This enables the MCP server to authenticate requests against OCI.
1. Create API key in OCI Console under Profile ā User Settings ā API Keys.
2. Save the private key file securely.
3. Record Tenancy OCID, User OCID, Key Fingerprint, and Region.You can access the following OCI services through the MCP server: compute, storage, network, database, monitoring, and identity. Supported actions include list, get, create, update, delete, start, and stop where applicable.
Common issues include authentication errors due to incorrect credentials or key permissions, connectivity problems related to region or network access, and ensuring the MCP client is configured to point at the running server.
If authentication fails, verify that all OCI credentials are correct and that the private key has the right permissions (600). Check that the user has the necessary IAM policies in place.
Never commit or share private keys or .env files. Use IAM policies to limit permissions and rotate keys regularly. Monitor OCI usage and costs to avoid unexpected charges.
Project includes a TypeScript-based MCP server structure with modular files for OCI client handling and service logic. Start commands and build steps are provided to enable development and testing of MCP integrations.
Unified OCI resource management interface exposing compute, storage, network, database, monitoring, and identity operations through the MCP server.