Oracle Schema Explorer 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 Schema Explorer MCP Server Connect to scott/tiger@localhost:1521/ORCL and list the tables in my schema"
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 Schema Explorer MCP Server
A universal, strictly read-only Model Context Protocol (MCP) server for inspecting and exploring Oracle database schemas, tables, columns, and foreign-key relationships across any Oracle Database version (Oracle 10g, 11g, 12c, 18c, 19c, 21c, and 23ai).
Compatible with any AI agent or IDE: Claude Desktop, Cursor, Google Antigravity, VS Code (Cline / Roo Code), Windsurf, and custom LLM agent frameworks.
Key Features
Universal Oracle Compatibility:
Thin Mode for Oracle Database 12.1 through 23ai (pure Python, zero C-libraries/Instant Client required).
Automatic Fallback to local SQL*Plus execution for legacy Oracle instances (Oracle 10g, 11g) or environments with older Oracle Client libraries (e.g. 12.1), completely eliminating ODPI-C version mismatch errors (
DPY-3010,DPI-1050).Standard dictionary views (
ALL_TABLES,ALL_TAB_COLUMNS,ALL_CONSTRAINTS,ALL_CONS_COLUMNS) and universalROWNUMquery wrapping.
Strictly Read-Only Guarantee:
Enforces safety at the protocol layer, allowing only
SELECTandWITHstatements.Automatically rejects data mutation (
INSERT,UPDATE,DELETE,MERGE) and schema modifications (DROP,ALTER,TRUNCATE,CREATE).
Deep Relationship Discovery:
Explores incoming and outgoing foreign keys.
Generates full schema Entity-Relationship diagrams formatted in Mermaid.js.
Zero Hardcoded Credentials:
Works with a blank default configuration. Connection strings can be passed dynamically in chat or configured via environment variables.
Related MCP server: Database MCP Server
Directory Structure
oracle-mcp-server/
├── server.py # Core FastMCP / MCPServer implementation
├── run.bat # Universal Windows batch launcher
├── run.ps1 # Universal PowerShell launcher
├── requirements.txt # Python package dependencies
├── pyproject.toml # Python package specifications
├── mcp-config-examples.json # Configuration snippets for all clients
├── LICENSE # MIT License
└── README.md # DocumentationInstallation & Prerequisites
Python 3.10+: Ensure Python is installed.
Install dependencies:
pip install -r requirements.txt(Or using
uv:uv pip install -r requirements.txt)
Configuration
The server ships 100% credential-free. You can supply connection strings in two ways:
Method 1: Dynamic Session Connection (Recommended)
Keep ORACLE_CONNECTION_STRING empty. In any AI chat session, simply instruct your agent:
"Connect to Oracle DB:
username/password@hostname:1521/service_name"
The server's set_connection tool validates and activates the session on the fly.
Method 2: Pre-configured Environment Variable
Set the ORACLE_CONNECTION_STRING environment variable in your MCP client's configuration file.
Supported Connection Formats:
EzConnect:
username/password@host:port/service_nameURL Syntax:
oracle://username:password@host:port/service_nameTNS Descriptor:
user/password@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=...)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=...)))
Client Integration Examples
Claude Desktop
Add to %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"oracle-schema-explorer": {
"command": "C:\\path\\to\\oracle-mcp-server\\run.bat",
"env": {
"ORACLE_CONNECTION_STRING": ""
}
}
}
}Cursor
Go to Settings -> Features -> MCP Servers.
Click Add New MCP Server:
Name:
oracle-schema-explorerType:
commandCommand:
C:\path\to\oracle-mcp-server\run.bat
VS Code (Cline / Roo Code / Windsurf)
Add to your client's MCP configuration settings:
{
"mcpServers": {
"oracle-schema-explorer": {
"command": "cmd.exe",
"args": ["/c", "C:\\path\\to\\oracle-mcp-server\\run.bat"]
}
}
}Google Antigravity
Add to ~/.gemini/config/mcp_config.json:
{
"mcpServers": {
"oracle-schema-explorer": {
"command": "cmd.exe",
"args": ["/c", "C:/path/to/oracle-mcp-server/run.bat"],
"env": {
"ORACLE_CONNECTION_STRING": ""
}
}
}
}Available MCP Tools
Tool | Parameters | Description |
|
| Connects or switches database dynamically. Tests connection and returns database banner. |
| None | Returns connection status, current schema/user, database name, and version banner. |
| None | Lists all accessible schemas and their table counts (filters out internal Oracle system accounts). |
|
| Lists all tables and views in the schema with approximate row counts. |
|
| Returns detailed column definitions: data types, precision, scale, nullability, primary key indicators, and comments. |
|
| Inspects table topology: lists parent tables referenced (outgoing FKs) and child tables that reference this table (incoming FKs). |
|
| Generates full Entity-Relationship graph for the schema with a renderable Mermaid ER diagram. |
|
| Executes read-only queries ( |
Security & Safety
Read-Only Enforcement: Query sanitization inspects all queries before execution, blocking all DDL and DML operations.
Resource Protection: Result sets are constrained with automatic pagination (
ROWNUM <= max_rows, capped at 500) to protect database memory and client context windows.System Schema Filtering: Internal accounts (
SYS,SYSTEM,DBSNMP,MDSYS,CTXSYS, etc.) are hidden by default to keep context clean and focused on application data.
License
This project is licensed under the MIT License.
Available Tools
8 toolsdescribe_tableA
Retrieves full column metadata for a table: data types, lengths, nullability, PK status.
Args: table_name: Name of the table. schema: Optional schema/owner name.
Inputs: table_name (required), schema. Returns: result
execute_readonly_queryA
Executes a strictly READ-ONLY query (SELECT/WITH) with automatic ROWNUM capping.
Args: sql_query: A SELECT or WITH query to execute. max_rows: Maximum number of rows to return (1-500, default 50).
Inputs: sql_query (required), max_rows. Returns: result
get_connection_infoA
Checks current database connection status, Oracle version, and session details.
Inputs: no named parameters. Returns: result
get_schema_relationshipsB
Generates the complete Entity-Relationship diagram for tables in a schema.
Inputs: schema. Returns: result
get_table_connectionsC
Explores how a table is connected to other tables (Outgoing and Incoming Foreign Keys).
Args: table_name: Table name. schema: Optional schema/owner name.
Inputs: table_name (required), schema. Returns: result
list_schemasA
Lists accessible schemas in the Oracle database with table counts.
Inputs: no named parameters. Returns: result
list_tablesB
Lists tables and views in a specified schema with row counts.
Args: schema: Name of schema/owner (defaults to current user).
Inputs: schema. Returns: result
set_connectionB
Sets or switches the active Oracle database connection string dynamically.
Args: connection_string: Oracle connection string (e.g. 'user/password@host:1521/service_name').
Inputs: connection_string (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct resource and action: connection management, schema listing, table listing, column metadata, table-level foreign keys, schema-wide ER relationships, and read-only queries. The closest pair, get_table_connections and get_schema_relationships, is clearly differentiated by table-level vs schema-wide scope.
All tool names follow a consistent snake_case verb_noun pattern: set_connection, get_connection_info, list_schemas, list_tables, describe_table, get_table_connections, get_schema_relationships, execute_readonly_query. Verb choices are varied but conventional and predictable.
Eight tools is well-scoped for a schema exploration server, with no redundant or filler operations. Each tool covers a meaningful step in the exploration workflow.
The surface covers connection setup/status, schema and table discovery, column metadata, foreign-key relationships, ER diagrams, and ad-hoc read-only querying, which supports core exploration workflows. Minor gaps include object search/filtering and index or non-PK constraint inspection, though these can be partially worked around via execute_readonly_query.
Related MCP Connectors
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Astra DB tools for agents: schema, find, vector search, guarded writes, and interactive views.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI tools to interact with Oracle databases through query execution, schema browsing, stored procedure calls, and transaction management. Supports multiple database connections with safety features like read-only mode and dangerous query detection.16MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with relational databases such as MySQL, PostgreSQL, SQLite, SQL Server, and Oracle. Provides tools for querying, data inspection, and schema analysis with optional read-only mode.13 npm1MIT
- FlicenseNot gradedqualityDmaintenanceEnables read-only exploration of Oracle databases through natural language, providing schema inspection and safe bounded SQL query execution.-
- FlicenseNot gradedqualityCmaintenanceEnables 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.-