MCP server/database

Oracle APEX MCP Server

MCP server for Oracle Database and Oracle APEX integration

★ 3silviosotelo/oracle-apex-mcp-server ↗by silviosoteloupdated
Manual setup required. The maintainer's config contains paths only you know - edit the placeholders below before adding it to Claude Code.
1

Prepare the server locally

Run this once before adding it to Claude Code.

git clone https://github.com/silviosotelo/oracle-apex-mcp-server
cd oracle-apex-mcp-server
npm install
npm run install:claude
2

Register it in Claude Code

claude mcp add oracle-apex-mcp -- node /path/to/oracle-apex-mcp-server/dist/index.js

Replace any placeholder paths in the command with the real path on your machine.

3

Make your agent remember this setup

oracle-apex-mcp's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.

npx conare@latest

Free · one command · indexes the sessions already on disk. Set up in the browser instead →

What it does

  • Multi-database support with on-the-fly switching
  • Automatic TNS names discovery from standard paths
  • Full support for SQL, DML, DDL, and PL/SQL execution
  • Read-only inspection of Oracle APEX metadata and applications
  • Connection pooling with configurable limits and timeouts

Tools 3

oracle_list_tns_entriesLists available Oracle database TNS entries.
oracle_connectConnects to an Oracle database using TNS alias or manual connection details.
oracle_current_connectionReturns information about the current active database connection.

Environment Variables

ORACLE_HOSTOracle DB hostname
ORACLE_PORTOracle DB port
ORACLE_SERVICE_NAMEOracle service name
ORACLE_USERNAMEDatabase username
ORACLE_PASSWORDDatabase password
TNS_ADMINDirectory containing tnsnames.ora

Try it

List all available Oracle databases from my TNS configuration.
Connect to the PROD_DB database as the hr user.
Which database am I currently connected to?
Switch my connection to the DEV_DB environment.
Describe the structure of the employees table in the current database.
Original README from silviosotelo/oracle-apex-mcp-server

Oracle APEX MCP Server

MCP (Model Context Protocol) server for Oracle Database and Oracle APEX integration. Provides 25 tools for multi-database management, querying, executing DDL/DML, inspecting database objects, and reading APEX metadata — all through a standardized MCP interface.

Features

  • Multi-database support: switch between databases on the fly without restarting
  • TNS names: auto-discovers tnsnames.ora from ORACLE_HOME, TNS_ADMIN, or common paths
  • 3 connection modes: TNS alias, connection string, or manual (host/port/service)
  • Oracle Database: query, execute DML/DDL/PL/SQL, transactions, explain plans, compile objects, show errors
  • Object Inspection: list tables, describe tables (columns, indexes, constraints, triggers), list objects, get source, search, dependencies
  • APEX Metadata (read-only): list applications, describe apps/pages, workspace users, REST services, ORDS-enabled objects
  • Connection pooling with configurable min/max/timeout
  • Thick mode support for legacy Oracle databases (pre-12c crypto)

Requirements

  • Node.js >= 18.0.0
  • Oracle Database accessible via network (any version supported by oracledb driver)
  • Oracle Instant Client (only if using Thick mode for legacy databases)

Quick Install (auto-registers with Claude Code)

git clone <repo-url>
cd oracle-apex-mcp-server
npm install
npm run install:claude

That's it. Restart Claude Code and start using it. No manual configuration needed.

The installer will:

  1. Install dependencies
  2. Build the TypeScript project
  3. Register the MCP server in ~/.claude/mcp.json

To register for a specific project instead: npm run install:project

Windows note: If npm run build runs out of memory, use:

set NODE_OPTIONS=--max-old-space-size=4096
npx tsc

How It Works

When you start a Claude Code session, the server starts with no pre-configured database. You choose how to connect:

1. Browse available databases from TNS

> list my available oracle databases
  (Claude calls oracle_list_tns_entries)

> connect to PROD_DB as user hr
  (Claude calls oracle_connect mode=tns tns_alias=PROD_DB username=hr password=...)

2. Connect with host/port/service

> connect to oracle on 192.168.1.100 port 1521 service MYDB as user admin
  (Claude calls oracle_connect mode=manual host=192.168.1.100 port=1521 service_name=MYDB ...)

3. Switch databases anytime

> switch to DEV_DB
  (Claude calls oracle_connect mode=tns tns_alias=DEV_DB ...)

> now switch to TEST_DB
  (same — closes old pool, opens new one)

4. Check current connection

> which database am I connected to?
  (Claude calls oracle_current_connection)

Configuration

Environment Variables (all optional)

Set these in ~/.claude/mcp.json under env if you want a default connection at startup:

Variable Default Description
ORACLE_HOST localhost Oracle DB hostname
ORACLE_PORT 1521 Oracle DB port
ORACLE_SERVICE_NAME XE Oracle service name
ORACLE_USERNAME hr Database username (also reads ORACLE_USER)
ORACLE_PASSWORD (empty) Database password
ORACLE_CONNECTION_STRING (auto-built) Full TNS connect string (overrides host/port/service)
ORACLE_TNS_ALIAS (none) TNS alias to use from tnsnames.ora
TNS_ADMIN (none) Directory containing tnsnames.ora
ORACLE_HOME (none) Oracle home directory (fallback for TNS lookup)
TNS_NAMES_FILE (auto-detected) Explicit path to tnsnames.ora
ORACLE_POOL_MIN 1 Minimum pool connections
ORACLE_POOL_MAX 10 Maximum pool connections
ORACLE_POOL_TIMEOUT 60 Pool timeout in seconds
ORACLE_STMT_CACHE_SIZE 30 Statement cache size
ORACLE_FETCH_SIZE 100 Fetch array size
ORACLE_OLD_CRYPTO false Set true to enable Thick mode (required for pre-12c databases)
ORACLE_CLIENT_LIB_DIR (none) Path to Oracle Instant Client (Thick mode only)

TNS Discovery

The server automatically searches for tnsnames.ora in these locations (in order):

  1. $TNS_ADMIN/tnsnames.ora
  2. $ORACLE_HOME/network/admin/tnsnames.ora
  3. Common Windows paths (C:\oracle\..., C:\app\oracle\...)
  4. Common Linux paths (/etc/oracle/..., /opt/oracle/..., /u01/...)

Manual Claude Code Setup

If you prefer manual configuration instead of the auto-installer:

Option 1: CLI command

claude mcp add-json oracle-apex '{"type":"stdio","command":"node","args":["/ruta/a/oracle-apex-mcp-server/dist/index.js"],"env":{"TNS_ADMIN":"/ruta/a/network/admin"}}' --scope user

Option 2: Edit `~/.claude/mcp.json`

{
  "mcpServers": {
    "oracle-apex": {
      "type": "stdio",
      "command": "node",
      "args": ["/ruta/a/oracle-apex-mcp-server/dist/index.js"],
      "env": {
        "TNS_ADMIN": "/ruta/a/netwo

Frequently Asked Questions

What are the key features of Oracle APEX MCP Server?

Multi-database support with on-the-fly switching. Automatic TNS names discovery from standard paths. Full support for SQL, DML, DDL, and PL/SQL execution. Read-only inspection of Oracle APEX metadata and applications. Connection pooling with configurable limits and timeouts.

What can I use Oracle APEX MCP Server for?

Executing complex SQL queries and PL/SQL blocks directly from Claude. Analyzing database object dependencies and schema structures. Inspecting Oracle APEX application pages and workspace metadata. Managing database connections across multiple environments like DEV, TEST, and PROD.

How do I install Oracle APEX MCP Server?

Install Oracle APEX MCP Server by running: git clone https://github.com/silviosotelo/oracle-apex-mcp-server && cd oracle-apex-mcp-server && npm install && npm run install:claude

What MCP clients work with Oracle APEX MCP Server?

Oracle APEX MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Conare · memory for coding agents

Turn this server into reusable context

Keep Oracle APEX MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Set up free$npx conare@latest