Skip to main content
Glama
monsterygy

Oracle Database MCP Server

by monsterygy

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
LOG_JSONNoOutput JSON-structured logs if truefalse
LOG_LEVELNoLog level: DEBUG, INFO, WARN, ERROR, or NONEINFO
TNS_ADMINNoPath to Oracle network admin directory (for TNS alias usage)
ORACLE_USERYesOracle database username
DML_MAX_ROWSNoMaximum rows DML can affect (safety cap)1000
ALLOWED_TABLESNoComma-separated uppercase table names allowed for access
BLOCKED_TABLESNoComma-separated uppercase table names blocked from access
QUERY_MAX_ROWSNoMaximum rows returned by db_query500
READ_ONLY_MODENoIf true, blocks all DML operationsfalse
ORACLE_PASSWORDYesOracle database password
QUERY_TIMEOUT_MSNoQuery timeout in milliseconds10000
ORACLE_CLIENT_DIRNoPath to Oracle Instant Client directory (for thick mode)
RATE_LIMIT_ENABLEDNoEnable or disable rate limitingtrue
ORACLE_CONNECT_STRINGYesOracle connection string (EZ Connect, TNS alias, or full descriptor)
RATE_LIMIT_PER_MINUTENoMaximum requests per minute60

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
db_health_checkA

Verify that the Oracle driver is loaded correctly and the database connection is working.

Reports: oracledb driver version, driver mode (thin/thick), connection status, Oracle DB version, connect string, TNS config, pool stats, and available TNS aliases.

Use this tool FIRST when setting up the MCP server or when troubleshooting connection issues.

No parameters required.

db_list_tnsA

Read and parse the local tnsnames.ora file, returning all available TNS alias names.

Searches in order: TNS_ADMIN directory → ORACLE_HOME/network/admin → current directory.

Args:

  • file_path (string, optional): Explicit path to tnsnames.ora.

db_list_tablesA

List all tables in the connected Oracle database (excluding system schemas like SYS, SYSTEM, etc.).

Use this FIRST to discover what tables exist before running queries.

Args:

  • owner (string, optional): Filter by schema/owner name (case-insensitive)

db_describe_tableA

Get the column structure of a specific Oracle table: column names, data types, data lengths, nullable flag, and default values.

Use this after db_list_tables to understand a table's schema before writing queries.

Args:

  • table_name (string): The table name to inspect (case-insensitive)

  • owner (string, optional): Schema/owner name for cross-schema access

db_queryA

Execute a read-only SQL query against the Oracle database. Only SELECT and WITH (CTE) statements are allowed.

IMPORTANT: Always use Oracle bind variables (:1, :2, ...) instead of string interpolation to prevent SQL injection.

Example: sql: "SELECT * FROM users WHERE active = :1 AND created_at > :2" params: ["Y", "2024-01-01"]

Safety:

  • Only SELECT/WITH queries allowed (INSERT/UPDATE/DELETE/DROP blocked)

  • Automatic row limit (FETCH FIRST n ROWS ONLY)

  • Query timeout enforced

  • Maximum 500 rows returned

Args:

  • sql (string): Read-only SQL with :1, :2, ... bind variables

  • params (array): Values for bind variables (default: [])

  • max_rows (number): Max rows to return (default: 100, max: 500)

db_explain_planA

Generate and display the execution plan for a SQL query WITHOUT executing it.

Uses Oracle's EXPLAIN PLAN to show how the query optimizer would run the query: table access methods (FULL SCAN, INDEX RANGE SCAN, etc.), join strategies, and filter predicates.

Use this to understand query performance before running expensive queries.

Args:

  • sql (string): Read-only SQL (SELECT/WITH only) to analyze

  • params (array): Bind variable values (default: [])

db_insertA

Insert a single record into an Oracle database table using parameterized named binds.

Auto-generates an INSERT with named bind variables from the provided data object. Column names are validated to prevent SQL injection. After insert, the full row is fetched back via ROWID.

dry_run mode: Set dry_run=true to preview the generated SQL without executing it.

Example: table_name: "users" data: { "name": "Alice", "email": "alice@example.com", "active": true } dry_run: false

Args:

  • table_name (string): Target table name

  • data (object): Column-value pairs to insert

  • dry_run (boolean): Preview SQL without executing (default: false)

db_updateA

Update one or more records in an Oracle database table using parameterized named binds.

Auto-generates the SET clause from the data object. The WHERE clause MUST include named bind variables (:w_1, :w_2, ...) with corresponding where_params.

Safety features:

  • WHERE clause is REQUIRED (updates without conditions are blocked)

  • Pre-counts matching rows and refuses if exceeding DML_MAX_ROWS (default: 1000)

  • dry_run mode previews SQL + affected row count

Example: table_name: "users" data: { "status": "active" } where: "id = :w_1" where_params: [42] dry_run: false

Args:

  • table_name, data, where, where_params, dry_run (default: false)

db_deleteA

Delete one or more records from an Oracle database table using parameterized named binds.

Safety features:

  • WHERE clause is REQUIRED (deletes without conditions are blocked)

  • Pre-counts matching rows and refuses if exceeding DML_MAX_ROWS (default: 1000)

  • dry_run mode previews SQL + affected row count

Example: table_name: "users" where: "id = :w_1 AND status = :w_2" where_params: [42, "inactive"] dry_run: false

db_transactionA

Execute multiple DML statements (INSERT/UPDATE/DELETE) in a single atomic transaction.

All steps either succeed and commit together, or fail and roll back together. This ensures data consistency for multi-step operations.

Limits: 1-10 steps per transaction. Each step must use Oracle bind variables (:1, :2, ...) — never string interpolation.

Example: steps: [ { sql: "UPDATE accounts SET balance = balance - :1 WHERE id = :2", params: [100, 1] }, { sql: "UPDATE accounts SET balance = balance + :1 WHERE id = :2", params: [100, 2] }, { sql: "INSERT INTO transfers (from_id, to_id, amount) VALUES (:1, :2, :3)", params: [1, 2, 100] } ]

This is an atomic money transfer: either all three succeed or none do.

db_session_infoA

Retrieve information about the current database session: connected user, schema, instance name, host, database name and version, session ID, NLS date format.

Useful for verifying which database/schema you're connected to and for debugging NLS-related issues.

No parameters required.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

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/monsterygy/oracle-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server