Mcp Oci

io.github.dockndevai由 GitHub 账号 dockndevai 发布v0.1.4更新于 Oct 24, 2026

Oracle Cloud discovery + Terraform generation for AI agents — read-only, secret-safe.

概览

AI 生成的概览

面向 Oracle Cloud Infrastructure 的 MCP 服务器,让助手发现线上 OCI 资源、梳理依赖关系并生成 Terraform,返回内容经过脱敏。

可以做什么
列出区间(compartment)与区域,搜索资源,列出某个区间内的全部资源,并获取单个资源的详细信息。为 VCN、子网、实例、存储桶、区间等已知类型生成 Terraform HCL,也可生成带 provider 变量的整区间模块。构建包含节点与边的依赖图,并给出建议的创建顺序。所有返回给模型的数据在输出前都会做脱敏处理。
适用场景
适合让助手探查已有的 OCI 租户、回答某个区间里有哪些资源的问题,或在不手工重建基础设施知识的情况下产出起步用的 Terraform 与创建顺序。
运行要求
通过 npx(Node.js)以 stdio 进程在本地运行。需要位于 ~/.oci/config 的标准 OCI 配置文件或实例主体(instance principals),并用 OCI_PROFILE 选择配置档。需要访问 OCI API 的网络。可选变量 OCI_MODE、OCI_COMPARTMENT_ALLOWLIST、OCI_REGION_ALLOWLIST、OCI_ALLOW_APPLY、OCI_DRY_RUN 和 OCI_AUDIT_LOG 用于调整行为。
安装前请注意
服务器会通过所配置的配置档读取你的 OCI 租户,因此应把 IAM 用户或策略限制为仅对助手可见的区间拥有只读权限。OCI_MODE 默认为只读,写入模式目前不暴露额外工具,但白名单与 apply 开关仍建议有意设置。审计日志写入 stderr。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Oci,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-oci

[CI] [License: MIT] [npm]

A Model Context Protocol server for Oracle Cloud Infrastructure (OCI). It gives an MCP-capable client (Claude Desktop, Claude Code, Cursor, Copilot, …) the ability to discover live OCI resources, map how they relate, and generate reproducible Terraform — with behaviour controlled entirely by flags.

Think of it as a Playwright-MCP for your cloud: instead of rebuilding infrastructure knowledge by hand, the model can ask "show all VCNs in the prod compartment" and "generate Terraform for this compartment" and get structured, secret-free answers.

Features

  • Live discovery — compartments, regions, and any resource via OCI Resource Search.
  • Terraform generation — faithful HCL for known types (VCN, subnet, instance, bucket, compartment) and annotated skeletons for the rest; whole-compartment modules with provider variables.
  • Dependency graph — nodes/edges plus a suggested provisioning order (dependencies first).
  • Secrets never reach the model — every payload is redacted before return.
  • Security flags — access modes, compartment/region allowlists, provisioning gate, dry-run, and JSON audit logging (see below).
  • Standard auth — OCI config file (~/.oci/config) or instance principals. No credentials stored by the server.

Security model

ConcernFlagDefaultEffect
What can the server do?OCI_MODEread-onlyAll shipped tools are read-only. read-write/admin are reserved for future provisioning and currently expose no extra tools.
Which compartments are in scope?OCI_COMPARTMENT_ALLOWLIST(all)When set, operations on other compartments are refused.
Which regions are reachable?OCI_REGION_ALLOWLIST(configured region)When set, only these regions may be targeted.
Can it run terraform apply?OCI_ALLOW_APPLYfalseReserved gate for provisioning (not yet shipped).
Preview without executingOCI_DRY_RUNfalseFor future write tools: validate + log intent without executing.
Audit trailOCI_AUDIT_LOGtrueEmits a JSON line to stderr per guarded operation.
Secret redaction(always on)—Secret-shaped fields are replaced with ***REDACTED*** before any result is returned.

Tools

Discovery (read): list_compartments, list_regions, search_resources, list_compartment_resources, get_resource

Terraform (read): generate_terraform, generate_compartment_terraform, build_dependency_graph

Quickstart — add to your agent

Published on npm as @dockndevai/mcp-oci. No clone or build needed — your MCP client runs it on demand with npx. Start in read-only mode; see .env.example for every variable and docs/CLIENTS.md for the full per-client guide.

Claude Code (CLI)

bash
claude mcp add oci -e OCI_PROFILE="DEFAULT" -e OCI_MODE="read-only" -- npx -y @dockndevai/mcp-oci

Claude Desktop · Cursor · Windsurf — same block in claude_desktop_config.json, .cursor/mcp.json, or ~/.codeium/windsurf/mcp_config.json:

json
{  "mcpServers": {    "oci": {      "command": "npx",      "args": [        "-y",        "@dockndevai/mcp-oci"      ],      "env": {        "OCI_PROFILE": "DEFAULT",        "OCI_MODE": "read-only"      }    }  }}

OpenAI Codex CLI — in ~/.codex/config.toml:

toml
[mcp_servers.oci]command = "npx"args = ["-y", "@dockndevai/mcp-oci"]env = { OCI_PROFILE = "DEFAULT", OCI_MODE = "read-only" }

VS Code (GitHub Copilot, Agent mode) — in .vscode/mcp.json:

json
{  "servers": {    "oci": {      "type": "stdio",      "command": "npx",      "args": [        "-y",        "@dockndevai/mcp-oci"      ],      "env": {        "OCI_PROFILE": "DEFAULT",        "OCI_MODE": "read-only"      }    }  }}

Configure

Point it at a standard OCI config profile. For safety, use an IAM user/policy with read-only (inspect/read) permissions on the compartments you want the agent to see.

Example prompts

  • "List all compartments, then show every resource in the prod compartment."
  • "Generate Terraform for VCN ocid1.vcn.oc1..…."
  • "Build a dependency graph for compartment … and tell me the provisioning order."

Run from source (development)

Prefer the published package above. To run from a clone:

bash
npm installnpm run buildnode dist/index.js   # with the environment variables set

Develop

bash
npm run dev        # watch modenpm test           # security policy + terraform generation + graph + redactionnpm run typecheck

Roadmap

  • terraform plan / apply execution behind read-write/admin + OCI_ALLOW_APPLY.
  • More resource-type mappers (load balancers, databases, DRGs, IAM policies).
  • Cross-environment drift comparison.

Publishing

This server ships a server.json for the official MCP registry and an mcpName for npm ownership validation. See PUBLISHING.md for publishing to npm and listing on the MCP registry, Smithery, Glama, Cursor, and PulseMCP.

License

MIT

来源:README.md,提交 324c9e5

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.4最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分