OracleDB MCP server

Provides a bridge to Oracle Database, enabling dynamic table and column discovery, secure query execution, and metadata retrieval through natural language interactions for data analysts and developers.
Back to servers
Provider
Rahul Kiran Gaddam
Release date
Mar 26, 2025
Language
Python
Package
Stats
1.4K downloads
20 stars

The OracleDB MCP Server is a Model Context Protocol Server that provides Oracle Database tables and columns as context to Large Language Models (LLMs). This enables LLMs to interact with Oracle databases, generate SQL statements, and return results using natural language prompts.

Installation

Install the Package

pip install oracledb_mcp_server

Configure the Server

  1. Create a .env file in your desired folder with at least the Oracle DB connection string
  2. Add the following configuration parameters to your .env file:
DB_CONNECTION_STRING=oracle+oracledb://USERNAME:PASSWORD@IP:PORT/?service_name=SERVICENAME
COMMENT_DB_CONNECTION_STRING=oracle+oracledb://USERNAME:PASSWORD@IP:PORT/?service_name=SERVICENAME
TABLE_WHITE_LIST=ACCOUNTS,CUS_ACC_RELATIONS,CUSTOMERS
COLUMN_WHITE_LIST=ACCOUNTS.ACC_AAD_ID,CUS_ACC_RELATIONS.CAR_CUS_ID,CUS_ACC_RELATIONS.CAR_AAD_ID,CUSTOMERS.CUS_ID

Start the Server

Run the server using the following command from the folder containing your .env file:

uv run oracledb_mcp_server

Usage

Environment Variables

Configure the server using these environment variables:

  • DEBUG: Enable debug logging (optional, default is False)
  • COMMENT_DB_CONNECTION_STRING: Oracle DB connection string for comments (required)
  • DB_CONNECTION_STRING: Oracle DB connection string for executing queries (required)
  • TABLE_WHITE_LIST: Comma-separated list of whitelisted table names (required)
  • COLUMN_WHITE_LIST: Comma-separated list of whitelisted table-column names (required)
  • QUERY_LIMIT_SIZE: Maximum number of records to return (optional, default is 10)

Claude Desktop Integration

To configure the OracleDB MCP Server with Claude Desktop, add the following to your Claude Desktop configuration:

{
  "mcpServers": {
    "oracledb_mcp_server":{
      "command": "uv",
      "args": ["run","oracledb_mcp_server"],
      "env": {
          "DEBUG":"True",
          "COMMENT_DB_CONNECTION_STRING":"oracle+oracledb://USERNAME:PASSWORD@IP:PORT/?service_name=SERVICENAME",
          "DB_CONNECTION_STRING":"oracle+oracledb://USERNAME:PASSWORD@IP:PORT/?service_name=SERVICENAME",
          "TABLE_WHITE_LIST":"ACCOUNTS,CUS_ACC_RELATIONS,CUSTOMERS",
          "COLUMN_WHITE_LIST":"ACCOUNTS.ACC_AAD_ID,CUS_ACC_RELATIONS.CAR_CUS_ID,CUS_ACC_RELATIONS.CAR_AAD_ID,CUSTOMERS.CUS_ID"
      }
    }
  }
}

Using MCP Inspector

You can inspect the MCP server using the MCP inspector tool:

npx @modelcontextprotocol/inspector uv --directory "PATH_TO_SERVER_DIRECTORY" run -m oracledb_mcp_server

Replace PATH_TO_SERVER_DIRECTORY with the path to your OracleDB MCP Server directory.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later