Oracle ADB MCP Server
Connects to Oracle Autonomous Database via OCI Bastion tunneling to enable AI-powered database exploration. Supports schema introspection, automatic ERD generation, and read-only SQL query execution through natural language interfaces.
README
Oracle ADB MCP Server — Setup Guide
How the tunnel works
This server connects to Oracle ADB through your existing ossh tunnel.
Two modes are supported — pick whichever suits your workflow:
| Mode | What you do | What the server does |
|---|---|---|
| manual (default) | Run your ossh command in a terminal before calling connect |
Checks localhost:1522 is reachable, then connects |
| auto | Nothing — just call connect |
Spawns the ossh command itself, then connects, kills it on disconnect |
Your ossh command (for reference):
ssh -o 'ProxyCommand=ossh proxy -V -U%r --overlay-bastion --region us-ashburn-1
--compartment <ocid.compartment> -- ssh stb-internal.bastion<region>.oci.oracleiaas.com
-p 22 -A -s proxy:ocid.bastion.oc1.iad.<key> 192.168.111.2
-L 1522:ocidwdata.adb.<region>.oraclecloud.com:1522
-t watch -n 90 date'
Prerequisites
- Python 3.11+ ✅ (you have 3.14)
osshin your system PATH ✅- Wallet zip at
C:\scripts\oci_01.zip✅
Step 1 — Install dependencies
Open PowerShell and run:
cd C:\scripts
python -m venv mcp-oracle-env
mcp-oracle-env\Scripts\activate
pip install -r oracle-mcp\requirements.txt
Step 2 — Edit config.py
Open C:\scripts\oracle-mcp\config.py and fill in:
# "manual" or "auto" — see table above
TUNNEL_MODE = "manual"
# Only needed if TUNNEL_MODE = "auto"
OCI_REGION = "us-ashburn-1"
COMPARTMENT_OCID = "ocid1.compartment.oc1..<your-compartment-ocid>"
BASTION_SESSION_OCID = "ocid1.bastion.oc1.iad.<your-static-session-key>"
ADB_PRIVATE_IP = "192.168.111.2"
ADB_HOSTNAME = "<your-adb-hostname>.adb.us-ashburn-1.oraclecloud.com"
# Always required
ADB_SERVICE_NAME = "<your_db_name>_medium" # see Step 3 below
DB_USERNAME = "<your_db_username>"
DB_PASSWORD = "<your_db_password>"
# Leave as "" if you didn't set a password when downloading the wallet
WALLET_PASSWORD = ""
Step 3 — Find your ADB service name
The service name is inside your wallet zip:
Expand-Archive C:\scripts\oci_01.zip -DestinationPath C:\scripts\wallet_preview -Force
type C:\scripts\wallet_preview\tnsnames.ora
You'll see entries like mydb_high, mydb_medium, mydb_low, mydb_tp.
Use mydb_medium for general use — good balance of speed and concurrency.
Step 4 — Register with Cline (VS Code)
- Open VS Code with the Cline extension installed
- Click the Cline icon in the sidebar → MCP Servers → Edit Config
- Add the following:
{
"mcpServers": {
"oracle-adb": {
"command": "C:\\scripts\\mcp-oracle-env\\Scripts\\python.exe",
"args": ["C:\\scripts\\oracle-mcp\\server.py"]
}
}
}
- Save the file — Cline will pick up the server automatically.
Also works with Claude Desktop. Config file is at:
C:\Users\mh026488\AppData\Roaming\Claude\claude_desktop_config.jsonUse the same JSON block above.
Step 5 — Connect and use
Manual tunnel mode (default)
- Open a PowerShell terminal and run your ossh command — leave it running
- In Cline, say:
Connect to the Oracle database - The server verifies the tunnel is up and connects
Auto tunnel mode
- Set
TUNNEL_MODE = "auto"in config.py - In Cline, say:
Connect to the Oracle database - The server launches ossh, waits for the tunnel, then connects
- When you say
disconnect, the tunnel is killed cleanly
Example prompts once connected
Show me all tables starting with AP_
Generate an ERD for the AP invoicing tables
Explain the AP_INVOICES table — row count, columns, sample data
Search for all columns containing EMPLOYEE across the schema
Query the top 10 suppliers by invoice count
Troubleshooting
| Problem | Fix |
|---|---|
No listener on localhost:1522 |
You're in manual mode but haven't run your ossh command yet |
ossh tunnel exited unexpectedly |
Check BASTION_SESSION_OCID and COMPARTMENT_OCID in config.py match your command |
ORA-01017 invalid credentials |
Check DB_USERNAME / DB_PASSWORD in config.py |
Wallet error / SSL error |
Verify WALLET_ZIP_PATH is C:\scripts\oci_01.zip and WALLET_PASSWORD is correct |
Service name not found |
Check ADB_SERVICE_NAME matches an entry in tnsnames.ora (Step 3) |
| Tunnel drops after a while | Normal — the watch -n 90 date keepalive in your ossh command handles this; in auto mode it's included automatically |
File layout
C:\scripts\
├── oracle-mcp\
│ ├── server.py # MCP entrypoint
│ ├── connection.py # ossh tunnel + wallet + DB connection
│ ├── schema.py # Table/column introspection
│ ├── relationships.py # Heuristic FK inference
│ ├── diagram.py # Mermaid ERD generation
│ ├── query.py # Read-only SQL executor
│ ├── config.py # ← EDIT THIS
│ └── requirements.txt
├── oci_01.zip # Your wallet ✅
└── mcp-oracle-env\ # Python venv (created in Step 1)
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。