Home / MCP / Oracle MCP Server

Oracle MCP Server

Provides MCP endpoints to interact with Oracle databases via SSE for listing tables, describing structures, and executing SQL.

other
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "oracle_mcp": {
            "url": "http://{server-ip}:{server-port}/sse"
        }
    }
}

You can interact with an Oracle database through a dedicated MCP server that uses Server-Sent Events (SSE) for real-time communication. This MCP server exposes practical tools to list tables, describe their structures, and execute SQL statements, all while managing secure connections.

How to use

You connect to the Oracle MCP Server from your MCP client by selecting a server configuration that points to the server’s designated MCP endpoint. Once connected, you can list all oracle tables, inspect table structures, and run SQL statements. Real-time updates arrive via SSE, so you can monitor long-running queries or updates as they execute.

How to install

Prerequisites and initial setup are as follows. Ensure you have Java 17 and Maven 3.6+ installed, and that an Oracle Database instance is accessible.

Step 1: Prepare the Oracle MCP server configuration for your environment.

Step 2: Build the project.

Step 3: Run the application.

Follow the concrete steps below to complete the setup.

mvn clean install
mvn spring-boot:run

Configuration and usage notes

Configuration for the MCP server is defined to expose an HTTP MCP endpoint that clients connect to. The MCP URL is used by your MCP client to subscribe to events and issue tools.

Example MCP server configuration you can use in your MCP client setup (HTTP method). Copy this as a reference and adapt the host and port to your environment.

{
  "mcpServers": {
    "oracle_mcp": {
      "type": "http",
      "url": "http://{server-ip}:{server-port}/sse",
      "args": []
    }
  }
}

Server tools and capabilities

The server offers three MCP tools you can use from your MCP client to interact with the Oracle database.

List Tables: retrieve all tables in the Oracle database.

Describe Table: obtain the structure of a specific table, including columns, data types, nullable status, and primary key information.

Execute SQL: run an arbitrary SQL statement and receive results or the number of affected rows.

Security considerations

Ensure secure handling of database credentials and enable appropriate connection pooling. Validate and sanitize inputs to minimize SQL injection risks, and sanitize error messages to avoid leaking sensitive information.

Testing and troubleshooting

Run unit tests to verify connectivity, table listing, and SQL execution: mvn test.

If you encounter connection or permission errors, review your database user's privileges and verify the MCP server can reach the Oracle database host and port.

Available tools

list_tables

Get a list of all tables in the Oracle database

describe_table

Get structure information of a specified table, including columns, data types, nullable status, data length, and primary key information

execute_sql

Execute an Oracle SQL statement and return results; for SELECT results are CSV, for DML statements return the number of affected rows