
oraclemcp
io.github.MuhDur由 GitHub 账号 MuhDur 发布v0.11.0更新于 Oct 24, 2026
Engine-free, governed Oracle Database MCP server with a fail-closed SQL guard (unofficial).
概览
本地运行的 MCP 服务器,让 AI 助手以受管控、最小权限的方式访问 Oracle 数据库,默认只读并采用失败即拒绝的 SQL 防护。
- 可以做什么
- 查看和切换连接配置,查询连接状态与当前有效访问级别,并在配置上限内临时提升会话级别,提升和非只读语句需先预览再确认。执行带绑定参数和行数上限的只读查询、受管控的向量检索、跨 SCN 或跨库差异比较,以及不执行仅分类的 SQL 预览。浏览架构与对象:列出架构、检查对象、描述表、视图、索引和触发器、获取 DDL 与源码、抽样行、读取 CLOB、搜索源码和编译错误。运行诊断:执行计划、高负载 SQL、计划时间线、数据库健康检查,以及对照 Oracle 目录核验的列级血缘。
- 适用场景
- 当助手需要浏览、查询或诊断 Oracle 数据库(18c、21c 或 23ai),并希望由服务器本身强制只读默认、对写入、DDL 和管理操作设闸时使用。适合需要可审计、最小权限数据库访问而非自由 SQL 的团队。
- 运行要求
- 以本地进程通过 stdio 运行(也支持 Streamable HTTP)。需要网络可达的 Oracle 数据库,以及包含连接配置的 profiles.toml;凭据通过 env:、file: 或 keyring: 引用(例如 credential_ref 为 env:ORACLE_APP_PASSWORD)。支持用户名密码、IAM/OCI 令牌、TLS/TCPS 加 PEM 以及 Oracle 钱包。无需 Oracle Instant Client 或 C 工具链;README 说明仅从源码构建时需要 nightly Rust 工具链。
安装
在 SourceWeft 中
- 打开 控制台中的 oraclemcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
[oraclemcp: governed, least-privilege Oracle Database MCP server in pure Rust]
[CI] [crates.io] [license] [forbid(unsafe_code)] [~3,300 tests] [nightly-2026-05-11]
Governed, least-privilege Oracle Database access for AI agents — in pure Rust.
oraclemcp is a Model Context Protocol server that gives an AI agent governed, least-privilege access to an Oracle database. Every raw statement the agent submits is classified before it can reach Oracle: read tools admit only statements proven read-only, and non-read SQL runs only through an explicit, profile-gated path that rolls DML back by default and requires a preview-derived grant before commit. Session elevation is explicit, temporary, and capped by profile max_level. The engine-free SQL guard remains independent of PL/SQL intelligence; the default binary embeds the offline engine. All crates use #![forbid(unsafe_code)].
An independent open-source project — not affiliated with Oracle. See how it compares to Oracle's own MCP servers.
Drivers
The maintained primary driver is oraclemcp-driver-cx, oraclemcp's pure-Rust thin Oracle driver. The pinned official Oracle oracledb beta also ships as a bounded connect-time fallback for compatible password connections. No Oracle Instant Client, ODPI-C, or C toolchain is required.
Only a failed basic-password connect ever falls back; IAM, wallet, and TCPS/PEM always stay on driver-cx, and a fallback never migrates a live session.
The official alternate emits TIMESTAMP WITH TIME ZONE values as UTC (Z).
Driver-cx retains numeric offsets for supported values. The official adapter
refuses TSTZ binds because it cannot preserve their supplied offset.
OCI Autonomous Database connectivity has an open post-ACCEPT authentication/TTC failure report (#54); this branch does not establish that a driver fix has resolved it. Token sources and wallet support do not prove ADB connectivity. Autonomous OCI token minting is also not implemented.
At a glance
Quick start
One line installs or updates on macOS and Linux (works pasted in a terminal or in a non-interactive agent run):
It verifies a SHA-256 digest (plus cosign signature/provenance when cosign is present) and installs oraclemcp and the short om alias into $HOME/.local. Also available: Windows (install.ps1), Docker (ghcr.io/muhdur/oraclemcp:latest), and cargo binstall oraclemcp. Air-gapped offline install, verification postures, and service install are documented via bash install.sh --help and docs/. No npm/npx channel is offered.
Onboard and connect a client:
Wire it into an MCP client (e.g. Claude Desktop) over stdio:
Several local MCP clients can use this same stdio configuration concurrently,
including write-capable profiles. When service state is needed, clients
automatically attach to one local broker that owns the audit writer and
database pools. Each client retains its own session level, confirmation tokens,
transaction and cancellation. The broker exits after 60 seconds without clients.
HTTP also gives each client an isolated stateful session by default.
HTTP and stdio clients share that same broker and state root. Each local client
must resolve its own configured database credentials. Credentials that differ
from the broker's receive ORACLEMCP_BROKER_CREDENTIAL_MISMATCH before opening a session.
Or run authenticated HTTP with a shown-once bearer, and open the local dashboard through a secret-free one-time pairing URL:
doctor output is safe to paste into agent sessions — it omits connect strings, usernames, credential references, passwords, wallet paths, IAM tokens, and server DNs while keeping structured failure classes and ORA codes.
Why oraclemcp
- Fail-closed by construction. A
SELECTan agent dreams up can never silently become aDELETE. Read tools admit only proven read-onlySELECT/WITHand dictionary introspection. Non-read execution is isolated inoracle_execute, bounded by the profile ceiling, rollback-by-default for DML, and explicit-confirm-before-commit. Forbidden constructs (multi-statement batches, string-concat dynamic SQL, an unproven function call inside a SELECT) are rejected before touching Oracle, with a typed envelope and a suggested safe alternative. - Agent-first UX. Every tool ships a real JSON Schema, title, and explicit MCP annotations (
readOnlyHint,destructiveHint,idempotentHint,openWorldHint). Errors are structuredErrorEnvelopes with machine-stable classes, fuzzy suggestions, and next-step hints — never bare strings. A zero-argoracle_capabilitiestool lets an agent discover the surface. - Pure Rust, no
unsafe. Every crate is#![forbid(unsafe_code)]; the fail-closed classifier is a realsqlparserAST classifier and carries a differential cargo-fuzz target. - Two transports. stdio (default) and Streamable HTTP (
--listen) with fail-closed auth defaults, optional OAuth bearer enforcement, and native rustls TLS/mTLS.
How it compares
Oracle ships an official MCP built into SQLcl; ours is independent. On the axis that decides whether you can safely point an AI agent at a database — the guard between the agent and your data — here is the honest, evidence-backed contrast:
SQLcl-MCP rows reflect Oracle's own documentation (configure a minimum-privilege user, prefer a non-prod replica, audit via DBTOOLS$MCP_LOG); the oraclemcp rows are enforced in this repository. Oracle is the official, supported option, and its managed Autonomous MCP takes a different curated-report approach with per-user identity — strong for locked-down read-only BI.
Safety model
When a guarded request is refused, use the generated refusal catalogue for its typed safe next action; it never recommends bypassing the guard.
The core invariant is a fail-closed SQL guard — not "read-only forever." Operating levels form a ladder, READ_ONLY < READ_WRITE < DDL < ADMIN, surfaced through oracle_execute, oracle_compile_object, oracle_create_or_replace, oracle_patch_source, and oracle_set_session_level. Read-only is the default and the cap for unconfigured or protected profiles; a profile's max_level may permit escalation up to ADMIN. Every escalation is guarded:
- a preview → confirmation-token step-up before any non-read statement runs,
- a temporary, TTL-bounded elevation window,
- the classifier still gating every statement at the current level,
- DML rolling back by default,
protectedprofiles pinned atREAD_ONLYwith an immutable ceiling, and OAuth scopes that can only lower the effective level, - a signed, append-only, HMAC-SHA256 hash-chained audit record for every privileged action.
An unparseable or unclassifiable statement fails closed. Statements can emit a verdict certificate bound to the classified bytes and the audit record; the routine-purity law it relies on is specified in proofs/purity-core/PurityCore.lean and pinned to the Rust classifier by a conformance test.
Governed dimensions
A database session is treated as a governed surface with several independent controls, each with an executable proof script:
What an agent sees depends on the active level and effective ceiling. At READ_ONLY, tools/list includes oracle_execute and execute_approved when the effective profile/OAuth ceiling permits READ_WRITE; their visibility grants no write authority. Other higher-level tools remain hidden until the session is elevated within the ceiling. A call to a not-yet-visible tool is refused with the same typed ErrorEnvelope as any other below-level statement.
Tools
The tables below are generated from the server's tool registry — the same descriptors tools/list serves — by scripts/docs_generate.sh (rendered from oraclemcp robot-docs tools --markdown). Do not hand-edit them; edit the registry and run bash scripts/docs_generate.sh --write.
Every advertised tool descriptor includes a human title plus explicit MCP annotations; these hints are advisory for clients, while the fail-closed classifier and operating-level gate remain the enforcement boundary. oracle_query and oracle_explain_plan also advertise outputSchema, and query results keep Oracle NUMBER cells as strings by default (opt into numbers_as_float=true explicitly). Beyond tools/*, initialize advertises resources, prompts, and completions (protocol 2025-11-25): resources/list exposes oracle://capabilities and oracle://tools, and read templates for oracle://schema/{owner} and oracle://object/{owner}/{type}/{name} route through the same safe dispatch path.
Compatibility aliases
For migrations from shorter Oracle MCP tool surfaces, the server advertises compatibility aliases that route to the guarded oracle_* tools and share their classifier, validation, and operating-level behavior. execute_approved, deploy_ddl, and read_patch_preview are wrappers rather than plain renames.
Deprecated argument aliases remain accepted until their removal version. Send only one spelling of each argument; canonical-plus-alias and two-alias requests are refused, even when values are equal. A lone alias emits _meta.deprecations.
Configuration
Connection profiles live in profiles.toml. No secrets are written to disk — credentials are references resolved at runtime through env:, file:, or keyring:. A minimal read-only profile:
The full field reference — HTTP TLS/mTLS/OAuth listeners, the signed audit chain, result-masking policy, fleet/monitor profiles, TCPS/wallet and IAM/DRCP/proxy auth, and per-call timeout/SDU budgets — is in docs/configuration.md.
Documentation
- Installation manual — verified installers, air-gapped installs, updates, uninstall, services, dashboard pairing, and release channels.
- Configuration reference — every profile, auth, transport, audit, and masking field.
- Operating & deployment — containerized deployment, least-privilege account, network posture, service management (systemd/launchd/Windows), air-gapped install, and the operator runbook.
- TNS discovery onboarding · Toolchain · Upgrade runbooks and field-hardening notes.
- Architecture decisions:
docs/adr/· Formal proofs:proofs/purity-core/.
Build from source
This branch is pinned to nightly-2026-05-11 and has no stable MSRV (the pin arrives transitively through asupersync, and Windows needs windows_by_handle; see docs/toolchain.md). Prefer the verified release archive above; build from source only when you intend to:
Live database access uses the maintained primary oraclemcp-driver-cx driver and requires no Oracle Instant Client, ODPI-C, or C toolchain. Set TNS_ADMIN for net-service-name connections when needed.
The release workflow builds every archive and the single ghcr.io/muhdur/oraclemcp image with the offline PL/SQL-intelligence engine included. The default source build includes it too; custom --no-default-features builds omit it. There is no separate engine image.
License
Licensed under Apache-2.0 OR MIT. The Docker image and crates do not redistribute Oracle Instant Client.
来源:README.md,提交 6867ca0
工具
0版本历史
2- v0.11.0最新Sep 18, 2026
- v0.10.0Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分