Mcp Server For Oracle Cloud Infrastructure (oci)

by jopsis

3 261 downloads Not rated yet
GitHub

About

# MCP Server for Oracle Cloud Infrastructure (OCI) This project implements a Model Context Protocol (MCP) server for Oracle Cloud Infrastructure, allowing LLMs like Claude to interact directly with OCI resources. ![presentation](/images/front.jpeg) ## Features - **Dynamic Profile Selection**: Switch between OCI…

Explore

- Dynamic Profile Selection: Switch between OCI profiles/tenancies without restarting the server
- Connection to Oracle Cloud using standard OCI CLI configuration
- 85 comprehensive tools to list and manage OCI resources across 11+ service categories
- Instance lifecycle management (start, stop)
- Database Systems and DB Nodes management
- Container Engine for Kubernetes (OKE) cluster and node pool management
- Integration with the MCP protocol to facilitate access from Claude Desktop

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Mcp Server For Oracle Cloud Infrastructure (oci)
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- Python 3.10 or higher
- OCI CLI configured (oci setup config)
- Appropriate permissions in Oracle Cloud

Add this configuration to your file:
/Users/<usuario>/Library/Application Support/Claude/claude_desktop_config.json

With dynamic profile selection (recommended):

"mcpServers": {
  "mcp-server-oci": {
    "command": "python",
    "args": [
      "-m",
      "mcp_server_oci.mcp_server"
    ],
    "env": {
      "PYTHONPATH": "/<PATH_TO_MCP>/mcp-server-oci",
      "FASTMCP_LOG_LEVEL": "INFO"
    }
  }
}

With fixed profile:

"mcpServers": {
  "mcp-server-oci": {
    "command": "python",
    "args": [
      "-m",
      "mcp_server_oci.mcp_server",
      "--profile", "DEFAULT"
    ],
    "env": {
      "PYTHONPATH": "/<PATH_TO_MCP>/mcp-server-oci",
      "FASTMCP_LOG_LEVEL": "INFO"
    }
  }
}

With uv and dynamic profiles:

"mcpServers": {
  "mcp-server-oci": {
    "command": "uv",
    "args": [
      "--directory",
      "/<PATH_TO_MCP>/mcp-server-oci",
      "run",
      "python",
      "-m",
      "mcp_server_oci.mcp_server"
    ],
    "env": {
      "FASTMCP_LOG_LEVEL": "INFO"
    }
  }
}

- get_cost_usage_summary - Get cost and usage summary for a tenancy with daily or monthly granularity
- get_cost_by_service - Get cost breakdown by service for a specified time period
- get_cost_by_compartment - Get cost breakdown by compartment for a specified time period

- Created centralized config.py with all configuration constants
- Eliminated magic numbers throughout the codebase
- Improved maintainability and discoverability of configuration values

- 7 new OKE tools: Clusters, Node Pools, and Work Requests
- Clusters: List/get clusters with Kubernetes version, endpoints, network config, and available upgrades
- Kubeconfig: Get kubeconfig file content for kubectl access to clusters
- Node Pools: List/get node pools with detailed node information, placement config, and eviction settings
- Work Requests: Track async operations (create, update, delete) for OKE resources
- Essential for managing Kubernetes infrastructure on OCI
- Total MCP tools increased from 78 to 85
- Added comprehensive OKE usage examples in README

- 8 new monitoring tools: Alarms, Metrics, and Logs
- Alarms: List/get alarms with severity, query history, and state transitions
- Metrics: List metrics, query time-series data with MQL for performance analysis
- Logs: Search logs, list log groups and logs for troubleshooting
- Essential for real-time monitoring, troubleshooting, and incident response
- Total MCP tools increased from 70 to 78
- Added comprehensive monitoring & observability usage examples in README

- 5 new cost management tools: Usage/Cost Analysis and Budgets
- Usage Analysis: Get cost summaries with daily/monthly granularity
- Cost Breakdown: Analyze costs by service or compartment for any time period
- Budget Management: List/get budgets with actual spend, forecasted spend, and alert rules
- Essential for cost optimization, budget tracking, and financial governance
- Total MCP tools increased from 65 to 70
- Added comprehensive cost management usage examples in README

- 4 new security tools: KMS Vaults and Encryption Keys
- KMS Vaults: List/get vaults with crypto and management endpoints
- Encryption Keys: List/get keys with algorithm, protection mode, and key shape
- Complete KMS coverage: Vault management and key discovery
- Dynamic KMS Management client creation using vault endpoints
- Total MCP tools increased from 61 to 65
- Added comprehensive security & encryption usage examples in README

- 4 new load balancer tools: Classic Load Balancers and Network Load Balancers
- Classic Load Balancers: List/get LBs with backend sets, listeners, and certificates
- Network Load Balancers: List/get NLBs with backend configuration and IP preservation
- Complete load balancing coverage: Layer 7 (classic) and Layer 4 (network) load balancers
- Total MCP tools increased from 50 to 54
- Added comprehensive load balancer usage examples in README

- 8 new IAM tools: Users, Groups, Policies, Dynamic Groups
- Security auditing: Review user capabilities, MFA status, and group memberships
- Policy management: List and inspect all IAM policy statements
- Dynamic groups: View instance principal matching rules
- Essential for compliance, security audits, and access troubleshooting
- Total MCP tools increased from 42 to 50
- Added comprehensive IAM usage examples in README

- 4 new database tools: Regular Databases and Autonomous Databases
- Regular Databases: List/get databases with connection strings and PDB names
- Autonomous Databases: List/get ADB with workload type, wallet info, and auto-scaling
- Complete database ecosystem coverage: DB Systems, DB Nodes, Databases, and ADB
- Total MCP tools increased from 38 to 42
- Added comprehensive database usage examples in README

- 9 new storage tools: Object Storage, Block Storage, File Storage
- Object Storage: Get namespace, list/get buckets with public access info
- Block Storage: List/get volumes and boot volumes with performance tiers
- File Storage: List/get file systems with metered bytes
- Total MCP tools increased from 29 to 38
- Added comprehensive storage usage examples in README

- 10 new networking tools: VCNs, Subnets, VNICs, Security Lists, NSGs
- Network topology discovery: Complete visibility of network infrastructure
- Security auditing: Review security rules and network access controls
- Connectivity troubleshooting: VNIC and routing information
- Total MCP tools increased from 19 to 29
- Added comprehensive networking usage examples in README

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp server for oracle cloud infrastructure (oci)": {
            "mcp-server-oci": {
                "command": "python",
                "args": [
                    "-m",
                    "mcp_server_oci.mcp_server",
                    "--profile",
                    "DEFAULT"
                ],
                "env": {
                    "PYTHONPATH": "/<PATH_TO_MCP>/mcp-server-oci",
                    "FASTMCP_LOG_LEVEL": "INFO"
                }
            }
        }
    }
}

McpServers

{
    "mcp-server-oci": {
        "command": "python",
        "args": [
            "-m",
            "mcp_server_oci.mcp_server",
            "--profile",
            "DEFAULT"
        ],
        "env": {
            "PYTHONPATH": "/<PATH_TO_MCP>/mcp-server-oci",
            "FASTMCP_LOG_LEVEL": "INFO"
        }
    }
}

This project implements a Model Context Protocol (MCP) server for Oracle Cloud Infrastructure, allowing LLMs like Claude to interact directly with OCI resources.

presentation

Features

- Dynamic Profile Selection: Switch between OCI profiles/tenancies without restarting the server
- Connection to Oracle Cloud using standard OCI CLI configuration
- 85 comprehensive tools to list and manage OCI resources across 11+ service categories
- Instance lifecycle management (start, stop)
- Database Systems and DB Nodes management
- Container Engine for Kubernetes (OKE) cluster and node pool management
- Integration with the MCP protocol to facilitate access from Claude Desktop

Prerequisites

- Python 3.10 or higher
- OCI CLI configured (oci setup config)
- Appropriate permissions in Oracle Cloud

Installation

Clone this repo

pip install git+https://github.com/modelcontextprotocol/python-sdk.git
pip install oci fastapi uvicorn click pydantic loguru
pip install -e .

Usage

Starting the Server

Option 1: Dynamic Profile Selection (Recommended)

Start without a profile and select it at runtime:

python -m mcp_server_oci.mcp_server

Then use the MCP tools to manage profiles:
- list_oci_profiles - See available profiles from ~/.oci/config
- set_oci_profile - Activate a specific profile
- get_current_oci_profile - Check which profile is active

Option 2: With Default Profile

Start with a specific profile pre-loaded:

python -m mcp_server_oci.mcp_server --profile DEFAULT

With uv:

uv --directory /path/to/mcp-server-oci run python -m mcp_server_oci.mcp_server --profile DEFAULT

Switching Between Tenancies

You can switch between different OCI tenancies without restarting:

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.