Oracle Database MCP Server
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 Database MCP Servershow the first 5 rows from the distributions table"
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 Utility
This project exposes Oracle-backed query and business-object utilities through three entry points:
mcp_server.py: stdio MCP server for local MCP clientsmcp_http_server.py: HTTP/SSE MCP server for remote MCP clients such as Clinehttp_server.py: REST wrapper for Postman andcurl
It is designed to reuse the same underlying tool implementations across MCP and REST transports, with configuration-driven SQL mappings and business-object metadata.
What This Project Does
The service connects to Oracle using python-oracledb and supports:
Executing registered SQL statements by key
Executing ad hoc SQL with optional bind parameters
Returning business-object data such as joint venture invoicing partner details
Exposing discovery metadata for supported business units and business objects
Serving the same capabilities over stdio MCP, streamable HTTP, SSE, and REST
Related MCP server: MCP Oracle Server
Project Structure
mcp_server.py: Core FastMCP server and tool definitionsmcp_http_server.py: MCP-over-HTTP or SSE transport entrypointhttp_server.py: REST API wrapper around the same MCP tool functionsdb_oracle.py: Oracle connection and query execution helperdb_config.json: Default Oracle connection settingsrequirements.txt: Python dependenciesconfig/registry.json: Combined registry for tools, business units, business objects, and SQL mappingsconfig/sql_registry.json: Friendly SQL key to file-path mappingconfig/business_units.json: Business unit configurationconfig/business_objects.json: Business object metadatasql/: SQL files used by the registered toolspayloads/: Sample request payloadsscripts/setup_sse_local.sh: Linux VM setup and service management scriptlogs/: Runtime log files
Main Tools
The core MCP server exposes these tools:
executeSql: Execute a SQL file registered inconfig/sql_registry.jsonoracle_query: Execute arbitrary SQL with optional bind parameters and connection overridesgetDetails: Resolve configured business objects such asjointVentureInvoicingPartnergetDistribution: Return rows from the distributions queryjointVentureInvoicingPartners: Convenience partner query endpointgetCapabilities: Return discovery metadata for supported business objects and business units
Requirements
Python 3.10 or newer recommended
Network access to the target Oracle database
Optional Linux VM for long-running HTTP or SSE deployment
Optional
systemdif you want to run the service as a managed Linux service
Install dependencies in a virtual environment:
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txtFor Windows:
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install --upgrade pip
pip install -r requirements.txtConfiguration
The default Oracle connection is read from db_config.json.
Expected shape:
{
"username": "fusion",
"password": "fusion",
"dsn": "(DESCRIPTION=...)",
"tns_admin": ""
}Notes:
Per-request
dsn,username,password, andtns_adminvalues can override the defaults.python-oracledbruns in thin mode by default, which is Linux-friendly and does not require Oracle Instant Client.If you use a TNS alias, set
tns_adminso Oracle Net can resolve it.Keep real credentials out of source control in shared environments.
Running the Servers
1. Stdio MCP server
Use this when your MCP client launches the process directly.
python3 mcp_server.py2. HTTP or SSE MCP server
Use this for remote MCP clients such as Cline.
Streamable HTTP:
python3 mcp_http_server.py --host 0.0.0.0 --port 8000Typical endpoint:
http://<server-ip>:8000/mcpSSE mode:
python3 mcp_http_server.py --host 0.0.0.0 --port 8000 --sseTypical endpoint:
http://<server-ip>:8000/sse3. REST wrapper for Postman or curl
python3 http_server.py --host 0.0.0.0 --port 5001REST Endpoints
The HTTP wrapper and MCP HTTP entrypoint expose helper REST endpoints such as:
GET /healthonhttp_server.pyGET /toolsGET /capabilitiesPOST /oracle_queryPOST /executeSqlPOST /getDetailsGETorPOST /getDistributionPOST /jointVentureInvoicingPartners
Example Requests
Discover capabilities first:
curl -s http://localhost:8000/capabilitiesExecute a registered SQL query:
curl -X POST http://localhost:8000/executeSql \
-H "Content-Type: application/json" \
-d '{
"sqlKey": "vendors_by_bu",
"params": {
"business_unit": "HEPP Petroleum USA BU1"
}
}'Run an ad hoc SQL query:
curl -X POST http://localhost:5001/oracle_query \
-H "Content-Type: application/json" \
-d '{
"sql": "select * from fusion.jv_distributions where rownum <= 1",
"params": {}
}'Query a business object:
curl -X POST http://localhost:8000/getDetails \
-H "Content-Type: application/json" \
-d '{
"BusinessObject": "jointVentureInvoicingPartner",
"BusinessUnit": "HEPP Petroleum USA BU1"
}'Linux Setup Script
For Linux VM deployment, use:
chmod +x scripts/setup_sse_local.sh
scripts/setup_sse_local.sh installThe script can:
Create a virtual environment
Install requirements
Start the MCP server in SSE or HTTP mode
Optionally start the REST wrapper
Run services with
systemdornohupShow status, stop, and uninstall services
Common commands:
scripts/setup_sse_local.sh install
scripts/setup_sse_local.sh start
scripts/setup_sse_local.sh status
scripts/setup_sse_local.sh stop
scripts/setup_sse_local.sh uninstallSQL and Metadata Configuration
The project uses configuration files to avoid hardcoding query mappings:
config/registry.json: consolidated source for tools, SQL paths, business units, and business objectsconfig/sql_registry.json: alternate SQL key registrysql/vendors_by_bu.sqlandsql/accounts_by_bu.sql: partner lookup queriessql/distributions.sql: distribution query
The getCapabilities tool is a good first call for clients that need to discover valid business units and supported business objects dynamically.
Logging
mcp_server.pywrites a log file into the system temp directory asfa_utility_mcp_server.loghttp_server.pyandmcp_http_server.pylog request activity to standard outputlogs/is used by the Linux setup script for service logs
Development Notes
mcp_server.pyuses FastMCP and falls back between import paths to support different package layouts.http_server.pyandmcp_http_server.pyimport tool functions directly frommcp_server.pyso behavior stays consistent.The project is structured so new SQL files and business objects can be added with minimal code changes.
Suggested Next Improvements
Move secrets from
db_config.jsoninto environment variables or a secrets managerAdd automated tests for each endpoint and business-object path
Add request and response schema validation
Add a sample
.env.examplefileAdd deployment notes for reverse proxy and TLS termination if this is exposed beyond a private network
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
- AlicenseAqualityDmaintenanceAn MCP server that connects to Oracle databases using sqlplus, enabling SQL queries, schema exploration, and DDL/DML execution through natural language.815MIT
- Alicense-qualityDmaintenanceA production-grade Node.js MCP server for Oracle Database with HTTP transport, enabling SQL query execution, table listing, schema retrieval, and natural language to SQL conversion via MCP tools.141MIT
- Alicense-qualityCmaintenanceMCP server for accessing Oracle databases, enabling schema exploration, query execution, and performance analysis.MIT
- Alicense-qualityDmaintenanceMCP server to connect to Oracle databases and run SQL queries (up to 150 rows) via a single 'query' tool.12MIT
Related MCP Connectors
MCP server for managing Prisma Postgres.
MCP server for AI access to Swagger by SmartBear.
MCP server for interacting with the Supabase platform
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/saranyaeeer/Oracle-Database-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server