OCI MCP Server

OCI MCP Server

Enables interaction with Oracle Cloud Infrastructure services through a unified interface. Supports comprehensive OCI resource management including compute instances, storage, networking, databases, and monitoring through natural language commands in VS Code.

Category
访问服务器

README

Oracle Cloud Infrastructure (OCI) MCP Server

A Model Context Protocol (MCP) server that provides access to Oracle Cloud Infrastructure services through a unified interface, optimized for VS Code integration.

Features

🚀 Unified OCI Management Tool

oci-manage - Comprehensive OCI resource management

  • Compute: Instances, volumes, shapes, images
  • Storage: Object storage buckets and objects
  • Network: VCNs, subnets, security lists, gateways
  • Database: DB systems, autonomous databases, backups
  • Monitoring: Alarms, metrics, logs
  • Identity: Users, groups, policies

Quick Start

1. Installation

git clone https://github.com/GoCoder7/oci-mcp-server.git
cd oci-mcp-server
npm install

2. Build

npm run build

3. Configure OCI Authentication

Copy the example environment file and configure your OCI credentials:

cp .env.example .env

Edit .env with your OCI credentials:

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)

4. VS Code Integration

Add to your VS Code settings.json:

{
  "mcp.servers": {
    "oci-mcp-server": {
      "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"
      }
    }
  }
}

Usage Examples

List Compute Instances

{
  "service": "compute",
  "action": "list",
  "resourceType": "instances",
  "compartmentId": "ocid1.compartment.oc1..aaaaaaaa..."
}

Get Specific Instance Details

{
  "service": "compute", 
  "action": "get",
  "resourceType": "instance",
  "resourceId": "ocid1.instance.oc1.iad.aaaaaaaa..."
}

Create Object Storage Bucket

{
  "service": "storage",
  "action": "create", 
  "resourceType": "bucket",
  "parameters": {
    "name": "my-new-bucket",
    "compartmentId": "ocid1.compartment.oc1..aaaaaaaa..."
  }
}

List VCNs

{
  "service": "network",
  "action": "list",
  "resourceType": "vcns",
  "compartmentId": "ocid1.compartment.oc1..aaaaaaaa..."
}

Monitor Database Performance

{
  "service": "monitoring",
  "action": "list", 
  "resourceType": "metrics",
  "parameters": {
    "namespace": "oci_autonomous_database"
  }
}

OCI Authentication Setup

1. Create API Key Pair

  1. Log into OCI Console
  2. Go to Profile → User Settings → API Keys
  3. Click "Add API Key"
  4. Generate or upload a key pair
  5. Save the private key file securely

2. Required Information

  • Tenancy OCID: Found in Profile → Tenancy
  • User OCID: Found in Profile → User Settings
  • Key Fingerprint: Generated when creating API key
  • Private Key Path: Location of your .pem file
  • Region: Your preferred OCI region
  • Compartment OCID: Optional default compartment

3. Set File Permissions

chmod 600 /path/to/your/oci_api_key.pem

Available Services & Actions

Services

  • compute - Compute instances and volumes
  • storage - Object storage buckets and objects
  • network - VCNs, subnets, security
  • database - Database systems and autonomous DBs
  • monitoring - Alarms, metrics, logging
  • identity - Users, groups, policies

Actions

  • list - List resources of specified type
  • get - Get details of specific resource
  • create - Create new resource
  • update - Update existing resource (where supported)
  • delete - Delete resource (where supported)
  • start - Start resource (instances, databases)
  • stop - Stop resource (instances, databases)

Resource Types

Compute: instances, volumes, images, shapes
Storage: buckets, objects
Network: vcns, subnets, security-lists, gateways
Database: db-systems, autonomous-databases, backups
Monitoring: alarms, metrics, logs
Identity: users, groups, policies

Development

Project Structure

src/
├── simple-index.ts         # Main MCP server (simplified)
├── index.ts               # Full MCP server (advanced)
├── types/
│   └── oci.ts             # Type definitions
├── utils/
│   └── oci-client.ts      # OCI client management  
└── tools/
    ├── compute.ts         # Compute management
    ├── storage-network.ts # Storage & network
    ├── database-analytics.ts # Database & analytics
    └── monitoring-security.ts # Monitoring & security

Available Scripts

  • npm run build - Build the project
  • npm run dev - Run in development mode
  • npm run watch - Run with auto-reload
  • npm start - Run compiled version

Current Implementation

The server currently provides:

  • ✅ MCP protocol integration
  • ✅ OCI credential validation
  • ✅ VS Code tool interface
  • ✅ Basic service structure
  • 🚧 Full OCI SDK integration (in progress)

Troubleshooting

Common Issues

Authentication Errors

  • Verify OCI credentials are correct
  • Check private key file permissions (600)
  • Ensure user has proper IAM policies

Connection Issues

  • Verify region is correct
  • Check network connectivity to OCI
  • Validate compartment access

VS Code Integration

  • Ensure MCP extension is installed
  • Check server configuration in settings.json
  • Verify file paths are absolute

Error Messages

"OCI credentials not configured"

  • Set required environment variables
  • Check .env file or VS Code settings

"Cannot use import statement outside a module"

  • Ensure package.json has "type": "module"
  • Verify build completed successfully

Contributing

  1. Fork the repository
  2. Create feature branch
  3. Make changes
  4. Add tests if applicable
  5. Submit pull request

Security

  • Never commit .env files or private keys
  • Use IAM policies to limit permissions
  • Regularly rotate API keys
  • Monitor OCI usage and costs

License

MIT License - see LICENSE file for details

Support

For issues:

  1. Check troubleshooting section
  2. Review OCI documentation
  3. Open GitHub issue
  4. Consult OCI community forums

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选