loading…
Search for a command to run...
loading…
A Model Context Protocol server for managing Oracle Cloud Infrastructure services, enabling LLMs to interact with compute instances, storage, identity, and data
A Model Context Protocol server for managing Oracle Cloud Infrastructure services, enabling LLMs to interact with compute instances, storage, identity, and databases through natural language.
A comprehensive, robust, and highly extensible Model Context Protocol (MCP) server for managing Oracle Cloud Infrastructure (OCI) services. This server enables LLMs and MCP-compatible clients to securely interact with your Oracle Cloud account to manage compute instances, storage, identity, and databases.
~/.oci/config).@oracle/oci-sdk.Before running this MCP server, ensure you have the following set up:
~/.oci/config (Linux/Mac) or C:\Users\<YourUser>\.oci\config (Windows).oci setup config command if you have the OCI CLI installed.Clone/Navigate to the repository:
cd f:\MCP_Server\Oracle_cloud_MCP_server
Install dependencies:
npm install
Build the TypeScript code:
npm run build
Run the server (for testing):
npm start
Note: MCP servers communicate over stdio, so running it directly in your terminal will make it wait for JSON-RPC inputs.
Running with Docker requires mounting your local ~/.oci directory into the container so the server can authenticate using your credentials.
Build the Docker Image:
docker build -t oracle-cloud-mcp .
Run the Docker Container:
Replace ~/.oci with the path to your OCI configuration folder.
docker run -i -v ~/.oci:/root/.oci oracle-cloud-mcp
To use this server, you must configure your MCP client (such as Claude Desktop, Cline, etc.) to spawn this process.
Edit your claude_desktop_config.json:
{
"mcpServers": {
"oracle-cloud": {
"command": "node",
"args": [
"f:/MCP_Server/Oracle_cloud_MCP_server/dist/index.js"
]
}
}
}
{
"mcpServers": {
"oracle-cloud": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"~/.oci:/root/.oci",
"oracle-cloud-mcp"
]
}
}
}
Note: The -i flag is required for interactive standard input (stdio) communication.
Once connected, the LLM will have access to the following tools:
oci_list_compartments: List all compartments in the tenancy. If no compartmentId is provided, it defaults to the root tenancy.oci_list_users: List all users within the specified compartment or the root tenancy.oci_list_instances: List all compute instances inside a specific compartmentId.oci_get_instance: Get detailed metadata about a specific compute instance using its instanceId.oci_instance_action: Execute lifecycle actions on an instance (e.g., START, STOP, SOFTRESET, RESET, SOFTSTOP).oci_list_vcns: List all Virtual Cloud Networks (VCNs) in a given compartmentId.oci_get_namespace: Fetch the Object Storage namespace associated with your tenancy.oci_list_buckets: List all storage buckets within a specified namespace and compartment.oci_list_objects: List all objects (files) inside a specific bucket.oci_list_autonomous_databases: List all Autonomous Databases (ADW/ATP) within a specified compartment.Oracle_cloud_MCP_server/
├── src/
│ ├── index.ts # Main MCP server entry point and tool definitions
│ ├── auth/
│ │ └── auth.ts # OCI Authentication module
│ └── tool/ # Modular tool implementations
│ ├── compute/index.ts # Compute and VCN APIs
│ ├── database/index.ts # Autonomous Database APIs
│ ├── identity/index.ts # Compartment and User APIs
│ └── objectstorage/index.ts # Bucket and Object APIs
├── dist/ # Compiled JavaScript output (generated)
├── Dockerfile # Docker container definition
├── .dockerignore # Excluded files for Docker build
├── .gitignore # Excluded files for Git tracking
├── package.json # Node.js dependencies and scripts
└── tsconfig.json # TypeScript compiler configuration
Because Oracle Cloud has hundreds of services, this server is designed to be easily extensible. To add a new service (e.g., oci-dns):
npm install oci-dns
src/tool/dns/index.ts.getAuthProvider from ../../auth/auth.js and instantiate the DNS client.src/index.ts, import your new module, add a tool definition in the ListToolsRequestSchema handler, and map the tool execution in the CallToolRequestSchema switch statement.Failed to initialize OCI Config File Provider, ensure that the OCI CLI is installed and configured. If running via Docker, verify that you correctly mounted the ~/.oci folder using -v.~/.oci/config file has the correct IAM policies to read compartments, instances, etc.compartmentId. The root compartment OCID is usually the same as your Tenancy OCID, which is defined in your ~/.oci/config file.Built with Model Context Protocol and the Oracle Cloud Infrastructure Node.js SDK.
Выполни в терминале:
claude mcp add oracle-cloud-infrastructure-oci-mcp-server -- npx