Skip to main content
Glama
Oracle MCP Gateway

Oracle MCP Gateway

by RockyCott

Oracle MCP Gateway

One MCP endpoint for multiple Oracle databases and multiple users.

Connect an AI assistant to an allowlisted set of Oracle databases. Each user works under their own database credentials. Administrators can review access and audit events in a web portal. SQL reads run inside read-only transactions, and changes use a separate approval workflow.

Feature

What it gives you

Multiple targets

Explicit connection IDs for each operation, with per-target schemas, limits and policies

User isolation

Credentials, sessions and connection pools scoped to the authenticated user

Three sign-in modes

Keycloak OAuth, Oracle-backed browser sign-in, or a personal loopback bearer

Database exploration

Schema and object discovery, bounded queries, plan inspection and structural comparisons

Controlled changes

Prepare, review, approve and execute a change at most once

Browser portal

Link accounts, review sessions, manage permissions and inspect the audit log

flowchart LR
  Client["MCP client"] --> Gateway["Oracle MCP Gateway"]
  Browser["Browser portal"] --> Gateway
  Identity["Keycloak or Oracle sign-in"] --> Gateway
  Gateway --> State[("PostgreSQL audit and state")]
  Gateway --> Development[("Oracle development")]
  Gateway --> Production[("Oracle production")]

Try it with synthetic data

You need Python 3.12, uv and Docker with Compose. The lab runs on loopback and uses disposable Oracle Free targets.

uv sync --all-groups --frozen
uv run python scripts/bootstrap_local.py
docker compose -f infra/keycloak/compose.yaml up -d --wait

E2E_ENCRYPTION_KEYS=unused docker compose --env-file infra/keycloak/.env \
  -f infra/testing/compose.yaml up -d --wait oracle-develop oracle-production

docker compose -f compose.yaml -f compose.keycloak.yaml -f compose.synthetic.yaml \
  up -d --build --wait
scripts/smoke-test.sh http://localhost:8010

Open the portal as local-developer. The generated Keycloak password is LOCAL_USER_PASSWORD in the private file infra/keycloak/.env. In My Oracle accounts, link the synthetic development account ADA with password Synthetic_ada_1.

uv run python scripts/mcp_client.py login
uv run python scripts/mcp_client.py connections
uv run python scripts/mcp_client.py query --connection oracle-develop \
  --sql 'SELECT 1 AS HEALTH_CHECK FROM DUAL'

The MCP endpoint is http://localhost:8010/mcp. See the authentication and deployment guide for direct Oracle OAuth, a personal instance, or an external Keycloak realm.

Related MCP server: Oracle ADB AI Agent MCP Server

How access works

Mode

Client presents

Database credentials

keycloak

A Keycloak OAuth access token

Each user links their Oracle account in the portal

oracle

An access token issued after browser sign-in to a registered Oracle target

The verified Oracle login supplies a session-bound credential for that target

local

A separate loopback bearer configured by the operator

An environment-supplied account for one read-only target

Targets are configured by the operator. Clients pass a connection ID, and Oracle privileges determine what the underlying account can do. The operations guide explains SQL validation, approvals and production safeguards.

Quality checks

uv run ruff check .
uv run ruff format --check .
uv run mypy src
uv run pytest
uv run python scripts/run_integration_tests.py

The test guide describes the optional Oracle Free acceptance suite. See CONTRIBUTING for contribution guidelines and SECURITY for reporting vulnerabilities. MIT License

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables GitHub Copilot and other LLMs to execute read-only SQL queries against Oracle databases with secure connection pooling and schema introspection capabilities.
      2
      107 npm
      5
      AGPL 3.0
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI chatbots to securely answer natural-language questions against Oracle databases by discovering metadata, generating and validating read-only SQL, executing with limits, masking sensitive data, and logging all activity.
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables AI clients to securely interact with Oracle databases using natural-language prompts, translating requests into structured queries and returning results for AI-powered data access.
      -