oci-secrets-mcp

oci-secrets-mcp

MCP server for Oracle Cloud Infrastructure Vault secrets, enabling secret retrieval, listing, creation, updates, deletion, and rotation with OCI authentication.

Category
访问服务器

README

OCI Secrets MCP

An MCP server for OCI Vault's documented public Secrets control-plane and data-plane APIs.

Install

git clone https://github.com/kevinwengh/oci-secrets-mcp.git
cd oci-secrets-mcp
uv sync

OCI authentication

The server signs outbound requests with the OCI Python SDK. It never accepts private keys, bearer tokens, or authorization headers from MCP tools.

Mode Required configuration
api_key (default) ~/.oci/config, optionally OCI_CONFIG_FILE and OCI_CONFIG_PROFILE
security_token OCI config profile configured with a security token
instance_principal OCI_REGION and an OCI compute instance principal
instance_principal_delegation_token OCI_REGION and OCI_DELEGATION_TOKEN_FILE
resource_principal OCI_REGION and a supported OCI resource-principal environment
resource_principal_delegation_token OCI_REGION, a resource principal, and OCI_DELEGATION_TOKEN_FILE
oke_workload_identity OCI_REGION and an OKE workload-identity environment

Select a non-default provider with OCI_SECRETS_MCP_AUTH_MODE.

For security-token and delegation-token modes, refresh the token file with the normal OCI tooling. If OCI returns 401 NotAuthenticated, the server rebuilds both SDK clients from the current credential source and retries the request once.

API-key example

An OCI user Auth Token intended for services such as Container Registry or SMTP cannot sign OCI SDK requests. Use an API signing key pair instead: upload the public key to the OCI user and keep the matching private key outside this repository.

Save the private key with user-only permissions outside the repository, for example:

/absolute/path/to/.oci/oci-secrets-mcp-api-key.pem

Do not paste the private key into this README or the MCP client configuration. Add a profile like this to your OCI configuration file, replacing every placeholder with your own value:

[OCI_SECRETS_MCP]
user=<USER_OCID>
fingerprint=<KEY_FINGERPRINT>
tenancy=<TENANCY_OCID>
region=<OCI_REGION>
key_file=/absolute/path/to/.oci/oci-secrets-mcp-api-key.pem

Configure your MCP client to select that profile. The configuration format is client-specific.

Claude Desktop

Claude Desktop uses JSON. Add the following server entry to its MCP configuration:

{
  "mcpServers": {
    "oci-secrets": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/oci-secrets-mcp",
        "run",
        "oci-secrets-mcp"
      ],
      "env": {
        "OCI_SECRETS_MCP_AUTH_MODE": "api_key",
        "OCI_CONFIG_FILE": "/absolute/path/to/.oci/config",
        "OCI_CONFIG_PROFILE": "OCI_SECRETS_MCP"
      }
    }
  }
}

Restart Claude Desktop after changing its configuration.

Codex

Codex uses TOML. Add the following to ~/.codex/config.toml, or to .codex/config.toml in a trusted project:

[mcp_servers.oci-secrets]
command = "uv"
args = [
  "--directory",
  "/absolute/path/to/oci-secrets-mcp",
  "run",
  "oci-secrets-mcp",
]

[mcp_servers.oci-secrets.env]
OCI_SECRETS_MCP_AUTH_MODE = "api_key"
OCI_CONFIG_FILE = "/absolute/path/to/.oci/config"
OCI_CONFIG_PROFILE = "OCI_SECRETS_MCP"

Restart Codex after changing its configuration, then verify that the server is registered:

codex mcp list

The environment variables above belong to the MCP client configuration. They are applied when Claude Desktop or Codex launches the server. If you run uv run oci-secrets-mcp directly in a shell, export the same variables first; otherwise the server uses its defaults, including the DEFAULT OCI profile.

The tenancy OCID can also be used as the root compartment ID. For example, call list_secrets with:

{
  "compartment_id": "<TENANCY_OR_COMPARTMENT_OCID>",
  "vault_id": "<VAULT_OCID>"
}

Run

Stdio is the default transport and is suitable for local MCP clients:

uv run oci-secrets-mcp

The optional streamable HTTP transport is restricted to loopback:

uv run oci-secrets-mcp --transport streamable-http --host 127.0.0.1 --port 8000

[!WARNING] The streamable HTTP transport does not authenticate callers or validate browser origins. Loopback binding reduces network exposure, but it does not protect against untrusted local processes or every DNS-rebinding scenario. Any caller that reaches the endpoint can use the server's configured OCI identity to retrieve secret content and can submit state-changing calls with confirm=true. Prefer stdio unless you have separately isolated and secured the HTTP endpoint.

The server does not permit a non-loopback bind, including behind a gateway. See the separate Claude Desktop and Codex configuration examples above for stdio client setup.

Safety and IAM

All state-changing tools have MCP destructive annotations and require confirm=true; this includes creation, updates, rotation, compartment moves, and deletion/rotation scheduling or cancellation. Secret-bundle retrieval returns secret content, so grant the executing OCI principal only the Vault permissions it requires and treat MCP responses as sensitive.

The confirm=true check is a guard against accidental changes, not an authentication or authorization boundary. OCI IAM and MCP client access policy remain the security boundaries.

Create and update requests use typed MCP schemas with snake_case field names and are converted to OCI SDK models before transmission. Successful results contain:

  • data: the OCI SDK response model converted to JSON.
  • opc_request_id: OCI's request identifier.
  • headers: allowlisted pagination, ETag, work-request, location, and retry metadata when present.
  • status: the HTTP response status.

Verification

uv run ruff check .
uv run pytest

License

Licensed under the MIT License.

推荐服务器

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 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

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

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

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

官方
精选
TypeScript
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 模型以安全和受控的方式获取实时的网络信息。

官方
精选