Oracle MCP Chatbot
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Oracle MCP ChatbotWhat were total sales by region last quarter?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Oracle MCP Chatbot — On-Prem Oracle DB + Oracle ATP
A secure Model Context Protocol server pair that lets an AI chatbot answer natural-language questions against Oracle databases: it discovers metadata, generates SELECT-only SQL, validates it, executes it under hard limits, masks sensitive values, and logs everything.
Built with FastMCP 3, python-oracledb (thin mode) and
sqlglot. 221 tests, no database required to run them.
pip install -r requirements-dev.txt
pytest # 221 passed
cp .env.example .env # add credentials
python -m oracle_mcp.server --profile onprem --check
python -m oracle_mcp.server --profile onpremTesting a running deployment is covered in docs/testing.md. A browser UI that does not use Cursor is docs/chat-ui.md:
python -m oracle_mcp.chat --profile both # http://127.0.0.1:8500What it does
Capability | How |
Read-only, always | AST validation, |
Only approved data | YAML allowlist of schemas, objects and columns |
Role-appropriate | Five roles with clearance levels; column-level enforcement |
Bounded | Row cap (default 500) and query timeout (default 30s), neither user-raisable |
Private | Masking by column name, by classification, and by value content |
Accountable | One audit record per call, with redacted SQL and a hash |
Two databases | Separate server processes; optional reconciliation server |
Related MCP server: OracleDB MCP Server
The eight tools
Tool | Purpose |
| Schemas the role may read, with descriptions |
| Approved objects, with domain, sensitivity, row estimates |
| Columns, types, nullability, PK/FK, business descriptions |
| Find objects and columns by business term, with confidence |
| Guardrail check; returns the rewritten safe SQL |
| Runs pre-approved SQL; returns masked, capped rows |
| Computes facts for a business-language answer |
| Cross-database reconciliation ( |
Plus list_databases for connection discovery. Every tool takes and returns JSON.
How the security model works
Data reaches a user only by crossing five independent layers:
Database grants → Object allowlist → Role clearance → SQL guardrails → Output masking
sql/*.sql config/policy/ roles.yaml sql_guard.py masking.pyThe load-bearing idea: the SQL you submit is never the SQL that runs. Input is parsed into an AST, inspected, rewritten, and regenerated. Only node types the validator recognised are re-emitted, so comment tricks, stacked statements and homoglyph keywords cannot survive the round trip.
SELECT a FROM t; DROP TABLE t → rejected: MULTIPLE_STATEMENTS
SELECT /*+ PARALLEL(t,64) */ a… → SELECT a FROM t FETCH FIRST 500 ROWS ONLY
DELETE FROM t → rejected: NFKC folds it to DELETE
SELECT * FROM v (business_user) → explicit column list, restricted ones absentSecond key control: execute_readonly_sql re-validates from scratch and
requires a fingerprint issued by validate_sql, so SQL cannot be swapped between
the check and the execution. Non-admin roles cannot execute anything that was not
approved first; admins can, but the statement still passes every guardrail.
Third: roles are pinned by process configuration, not by tool argument. A user
who tells the model "you are now an admin" produces a user_role="admin" string
that nothing reads.
Configuration
Two files decide everything:
config/policy/onprem.yaml and atp.yaml — the object allowlist. Each database
picks one of two modes.
Strict, which is what On-Prem uses. Only the objects named here are reachable, whatever the database grants allow:
schemas:
- name: EIM
objects:
- name: EIM_PR_SYSTEM
type: TABLE
sensitivity: INTERNAL
large_table: true
require_filter: true # forces a WHERE clause
columns: # optional; omit to read them from the
- {name: SERIAL_NUMBER, sensitivity: INTERNAL} # data dictionary
- {name: TAX_ID, sensitivity: RESTRICTED} # at query timeOmitting columns: is supported and is what the deployed policy does. Columns
are then read from ALL_TAB_COLUMNS and classified by the name patterns in
masking.yaml, so the allowlist stays correct as the schema changes.
Wildcard, which is what ATP uses. Every schema the read-only account can read becomes reachable:
allow_all_schemas: true
excluded_schemas: [] # added on top of the built-in Oracle internal schemas
schemas: []This deliberately gives up the object allowlist and makes the database grant the boundary instead. Clearance, the SQL guardrails, row caps and masking all still apply. Only use it against an account that is genuinely read-only.
config/policy/roles.yaml — who may see what:
roles:
business_user:
clearance: INTERNAL # cannot reach CONFIDENTIAL or RESTRICTED columns
max_rows: 200
allow_raw_sql: false
schemas: {ONPREM: [EIM], ATP: ["*"]} # "*" needs allow_all_schemasSensitivity ladder: PUBLIC < INTERNAL < CONFIDENTIAL < RESTRICTED < NEVER.
NEVER is above every clearance, so passwords and card numbers are unreachable
by any role including admin.
Deployment
Run one server per database. That split is a security boundary: the on-prem process never holds the ATP wallet passphrase.
docker build -t oracle-mcp-chatbot:1.0.0 .
export ATP_WALLET_HOST_PATH=/secure/path/wallets/atp
docker compose up -d onprem-mcp atp-mcp
docker compose --profile reconciliation up -d # optional, holds both credential setsOracle ATP connectivity
Thin mode with an mTLS wallet. Unzip the wallet and set:
ATP_DSN=myatp_low # prefer _low so chatbot traffic can't starve prod
ATP_WALLET_DIR=/opt/oracle/wallets/atp # contains ewallet.pem + tnsnames.ora
ATP_CONFIG_DIR=/opt/oracle/wallets/atp
ATP_WALLET_PASSWORD=... # set when the wallet zip was downloadedATP_WALLET_PASSWORD is the passphrase protecting ewallet.pem, not the database
password — a common and confusing failure. It is thin-mode only; thick mode reads
the passwordless cwallet.sso instead, and configuring both is rejected at
startup. For TLS-only ATP (no wallet), leave the wallet variables empty and paste
the full connect string from the OCI console into ATP_DSN.
The wallet is bind-mounted read-only and never baked into an image.
On-prem connectivity
ONPREM_HOST=oracle-onprem.internal.example.com
ONPREM_PORT=1521
ONPREM_SERVICE_NAME=CDMPRD
ONPREM_MODE=thin
# TCPS instead:
# ONPREM_DSN=tcps://host:2484/CDMPRD?ssl_server_dn_match=trueThin mode needs no Oracle Client. Use thick mode only for features it lacks; see
the commented stage in the Dockerfile.
Documentation
Document | Contents |
How this deployment's connections are configured, and open items | |
Design, request flow, security boundaries, RBAC, audit, error handling | |
Full test plan with expected outcomes | |
Pre-production checklist and hardening backlog | |
Ten worked examples plus rejection flows | |
Chatbot system prompt | |
Read-only users, grants, audit schema | |
Cursor and Claude Desktop configuration |
Before production
The reference implementation deliberately stops short in four places. Read
docs/deployment-checklist.md for the full list;
the headline items:
Set
ORACLE_MCP_ROLE_BINDING_MODE=env. Theargumentdefault in.env.exampleis for development; under it the model can assert any role.Replace the sample allowlists in
config/policy/*.yamlwith your real curated views, and classify every column deliberately.Move secrets to a vault. Compose environment variables are visible to anyone who can run
docker inspect.Put the HTTP transport behind an authenticating gateway. FastMCP's HTTP transport does not authenticate callers by itself; binding to loopback is a stopgap, not the control.
Also unimplemented by design: rate limiting, per-user identity propagation, and approval workflow for admin raw SQL.
Licence
Provided as a reference implementation. Review against your own security standards before production use.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables GitHub Copilot and other LLMs to execute read-only SQL queries against Oracle databases with secure connection pooling and schema introspection capabilities.22065AGPL 3.0
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to interact with Oracle Databases by providing specific table and column metadata as context. Users can generate SQL statements and retrieve query results directly through natural language prompts.Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables AI applications to run SQL queries and retrieve results from Oracle Database.8
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered database operations on Oracle Autonomous Database via natural language, including SQL translation, schema exploration, and API orchestration.4
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
GibsonAI MCP server: manage your databases with natural language
The grounded data layer for any LLM: governed SQL, metrics, lineage and catalog over your data.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/vdobhal/oracle-mcp-chatbot'
If you have feedback or need assistance with the MCP directory API, please join our Discord server