Oracle DB MCP Server
Click on "Deploy 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 DB MCP Server show me the top 10 customers by total orders"
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 DB MCP Server
A Model Context Protocol (MCP) server for Oracle Database connectivity. This server enables AI tools like Cursor, Claude Desktop, and other MCP-compatible clients to interact with Oracle databases.
Features
Multiple Database Connections: Configure and manage multiple named Oracle database connections
Thin & Thick Mode Support: Works with Oracle's thin driver (no client required) or thick mode (with Oracle Instant Client)
Query Execution: Execute SELECT queries with result formatting
DML Operations: Execute INSERT, UPDATE, DELETE with safety checks
PL/SQL Support: Execute PL/SQL blocks, create procedures/functions
Schema Browsing: List tables, views, procedures, describe table structures
Stored Procedures: Execute stored procedures with input/output parameters
Transaction Management: Commit and rollback support
Safety Features: Read-only mode, dangerous query detection, automatic warnings
Related MCP server: Oracle MCP
Installation
Using npx (Recommended)
No installation required. Configure your MCP client to run:
npx -y oracle-db-mcpLocal Installation
npm install -g oracle-db-mcpThen run:
oracle-db-mcpConfiguration
Configuration File (connections.json)
Create a configuration file with your database connections:
{
"oracleClient": {
"mode": "thin"
},
"settings": {
"defaultMaxRows": 100,
"queryTimeout": 30
},
"connections": [
{
"name": "dev",
"host": "dev-server.company.com",
"port": 1521,
"serviceName": "DEVDB",
"username": "dev_user",
"password": "dev_password",
"mode": "readwrite"
},
{
"name": "prod",
"host": "prod-server.company.com",
"port": 1521,
"serviceName": "PRODDB",
"username": "report_user",
"passwordEnv": "PROD_DB_PASSWORD",
"mode": "readonly"
}
]
}Connection Options
Each connection supports:
Option | Description |
| Unique identifier for the connection |
| Database server hostname |
| Port number (default: 1521) |
| Oracle service name |
| Oracle SID (alternative to serviceName) |
| Full connection string (alternative to host/port/service) |
| Database username |
| Database password (direct) |
| Environment variable containing password |
|
|
| Optional privileged connect: |
Configuration File Locations
The server searches for configuration in this order:
ORACLE_MCP_CONFIGenvironment variable./config/connections.json./connections.json~/.oracle-mcp/connections.json
Environment Variables
For simple single-connection setup:
export ORACLE_CONNECTION_NAME=mydb
export ORACLE_HOST=localhost
export ORACLE_PORT=1521
export ORACLE_SERVICE=XEPDB1
export ORACLE_USER=scott
export ORACLE_PASSWORD=tiger
export ORACLE_MODE=readonly
# Opt-in to allow privileged connects (SYSDBA/SYSOPER). Default: false
export ORACLE_ALLOW_SYSDBA=false
# For privileged connection (if enabled):
export ORACLE_PRIVILEGE=SYSDBAMCP Client Configuration
Cursor
Add to your Cursor MCP settings (.cursor/mcp.json):
{
"mcpServers": {
"oracle-db": {
"command": "npx",
"args": ["-y", "oracle-db-mcp"],
"env": {
"ORACLE_MCP_CONFIG": "/path/to/connections.json"
}
}
}
}Claude Desktop
Add to your Claude Desktop config:
{
"mcpServers": {
"oracle-db": {
"command": "npx",
"args": ["-y", "oracle-db-mcp"],
"env": {
"ORACLE_MCP_CONFIG": "/path/to/connections.json"
}
}
}
}Available Tools
Connection Management
Tool | Description |
| List all configured connections with status |
| Test connectivity and get database info |
| Establish a connection |
| Close a connection |
Query Execution
Tool | Description |
| Execute SELECT queries |
| Execute INSERT/UPDATE/DELETE |
| Execute PL/SQL blocks or DDL |
| Call stored procedures |
Schema Browsing
Tool | Description |
| List tables and views |
| Get column, constraint, index info |
| List procedures, functions, packages |
| Get source code of PL/SQL objects |
| Get procedure parameters |
| Get query execution plan |
Transaction Management
Tool | Description |
| Commit current transaction |
| Rollback current transaction |
Safety Features
Read-Only Mode
Connections configured as readonly:
Block all DML operations (INSERT, UPDATE, DELETE)
Block PL/SQL execution
Allow only SELECT queries
Dangerous Query Detection
The server warns or blocks:
DROP statements
TRUNCATE statements
UPDATE/DELETE without WHERE clause
ALTER SYSTEM commands
Oracle Client Modes
Thin Mode (Default)
No Oracle client installation required. Works with:
Oracle Database 12.1 and later
Oracle Cloud databases
Thick Mode
Requires Oracle Instant Client. Enable in config:
{
"oracleClient": {
"mode": "thick",
"path": "/path/to/instantclient"
}
}Required for:
Oracle Database versions before 12.1
Advanced features (LDAP, Kerberos, etc.)
Some data types (BFILE, etc.)
Development
Building from Source
git clone https://github.com/titan213/oracle-db-mcp
cd oracle-db-mcp
npm install
npm run buildRunning in Development
npm run devTesting
npm testLicense
MIT
Author
Gihan Sundarapperuma gihan213@gmail.com
Available Tools
16 toolscommitB
Commit the current transaction on a connection.
Inputs: connection (required).
connectB
Establish a connection to a named Oracle database.
Inputs: name (required).
describe_tableA
Get detailed information about a table including columns, constraints, and indexes.
Inputs: table (required), connection (required), format, schema, +1 more.
disconnectA
Close a connection to a named Oracle database.
Inputs: name (required).
execute_dmlA
Execute a DML statement (INSERT, UPDATE, DELETE) on an Oracle database. Only works on connections with readwrite mode.
Inputs: sql (required), connection (required), commit.
execute_plsqlB
Execute a PL/SQL block or DDL statement (CREATE FUNCTION, CREATE PROCEDURE, etc.). Only works on connections with readwrite mode.
Inputs: plsql (required), connection (required), commit.
execute_procedureC
Execute a stored procedure with input and output parameters.
Inputs: procedure (required), connection (required), params, out_params.
execute_queryA
Execute a SELECT query on an Oracle database. Returns results as a formatted table. Only SELECT statements are allowed.
Inputs: sql (required), connection (required), format, max_rows.
explain_queryC
Get the execution plan for a SQL query.
Inputs: sql (required), connection (required).
get_procedure_paramsB
Get the parameters of a stored procedure or function.
Inputs: procedure (required), connection (required), schema.
get_procedure_sourceB
Get the source code of a stored procedure, function, or package.
Inputs: name (required), connection (required), type, schema.
list_connectionsA
List all configured Oracle database connections with their status (connected/disconnected) and mode (readonly/readwrite).
Inputs: no named parameters.
list_proceduresB
List stored procedures, functions, and packages in a schema.
Inputs: connection (required), type, filter, schema.
list_tablesB
List tables and views in a database schema.
Inputs: connection (required), filter, schema, include_views.
rollbackB
Rollback the current transaction on a connection.
Inputs: connection (required).
test_connectionA
Test connectivity to a named Oracle database connection. Returns database version and schema information if successful.
Inputs: name (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool has a distinct purpose: connection management, querying, DML, PL/SQL, procedures, table metadata, and transaction control. There is no overlap or ambiguity between tool functions.
All tools follow a consistent verb_noun pattern (e.g., list_tables, describe_table, execute_query). Even single-word tools like commit and rollback are standard for atomic operations and do not break consistency.
With 16 tools, the set is slightly above the ideal 3-15 range but each tool earns its place by covering core database operations without redundancy. The count is still well-scoped for the domain.
The tool surface covers connection lifecycle, queries, DML, DDL (via execute_plsql), procedures, execution plans, and transactions. Minor gaps like explicit table creation DDL are mitigated by execute_plsql, and user management is out of scope.
Maintenance
Related MCP Connectors
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Work with your database from AI tools: ask, export, approved changes, and scheduled jobs.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides flexible access to Oracle databases for AI assistants like Claude, supporting SQL queries across multiple schemas with comprehensive database introspection capabilities.611MIT
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with secure, structured access to Oracle Database through MCP, enabling SQL execution, metadata exploration, and stored procedure execution.MIT
- FlicenseNot gradedqualityDmaintenanceEnables read-only exploration of Oracle databases through natural language, providing schema inspection and safe bounded SQL query execution.-
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to connect to Oracle databases for schema exploration, PL/SQL source inspection, and read-only SQL queries, with optional write operations when explicitly enabled.-