Oracle MCP Server

Oracle MCP Server

Provides flexible access to Oracle databases for AI assistants like Claude, supporting SQL queries across multiple schemas with comprehensive database introspection capabilities.

Category
访问服务器

Tools

execute_query

Execute a SQL query on the Oracle database

list_tables

List tables from specified schema or all accessible schemas

describe_table

Get table structure including columns, data types, and constraints

get_table_indexes

Get indexes for a specific table

get_table_constraints

Get constraints (primary keys, foreign keys, unique, check) for a table

list_schemas

List all schemas in the database

README

Oracle MCP Server

A Model Context Protocol (MCP) server that provides flexible access to Oracle databases for AI assistants like Claude. Supports querying across multiple schemas and comprehensive database introspection.

Features

  • Execute SQL queries with parameter binding
  • List tables across multiple schemas or filter by specific schema
  • Describe table structures with multi-schema support
  • View indexes and constraints across schemas
  • Multiple Oracle authentication methods
  • Automatic parameter conversion (PostgreSQL style to Oracle)
  • SQL injection prevention via bind variables
  • Audit logging for security monitoring

Installation

npm install

Configuration

Environment Variables

Create a .env file with your Oracle connection details. Choose one of these methods:

Method 1: Easy Connect String

ORACLE_CONNECTION_STRING=hostname:1521/service_name
ORACLE_USER=your_username
ORACLE_PASSWORD=your_password

Method 2: TNS Name

ORACLE_TNS_NAME=ORCL
ORACLE_USER=your_username
ORACLE_PASSWORD=your_password

Method 3: Individual Components

ORACLE_HOST=localhost
ORACLE_PORT=1521
ORACLE_SERVICE_NAME=ORCL  # or ORACLE_SID=ORCL
ORACLE_USER=your_username
ORACLE_PASSWORD=your_password

Optional settings:

ORACLE_DEFAULT_SCHEMA=HR  # Default schema if different from user

Usage with Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "oracle": {
      "command": "node",
      "args": ["/path/to/oracle-mcp/src/index.js"],
      "env": {
        "ORACLE_CONNECTION_STRING": "hostname:1521/service_name",
        "ORACLE_USER": "your_username",
        "ORACLE_PASSWORD": "your_password"
      }
    }
  }
}

Alternatively, use npx if you publish the package:

{
  "mcpServers": {
    "oracle": {
      "command": "npx",
      "args": ["-y", "oracle-mcp-server"],
      "env": {
        "ORACLE_CONNECTION_STRING": "hostname:1521/service_name",
        "ORACLE_USER": "your_username",
        "ORACLE_PASSWORD": "your_password"
      }
    }
  }
}

Usage with Claude Code

For Claude Code, add to ~/.claude.json:

{
  "mcpServers": {
    "oracle": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/oracle-mcp/src/index.js"],
      "env": {
        "ORACLE_CONNECTION_STRING": "hostname:1521/service_name",
        "ORACLE_USER": "your_username",
        "ORACLE_PASSWORD": "your_password"
      }
    }
  }
}

After updating the configuration, restart Claude Desktop or Claude Code.

Available Tools

  1. execute_query - Execute any SQL query

    • Supports parameter binding
    • Auto-converts PostgreSQL-style parameters ($1) to Oracle (:1)
    • Returns rows, rowCount, and metadata
  2. list_tables - List database tables

    • Filter by specific schema or show all accessible schemas
    • Filter by pattern (with % wildcards)
    • Shows schema name, table name, row count, and last analyzed date
  3. describe_table - Get table structure

    • Column names, types, sizes
    • Nullable constraints
    • Default values
    • Works across all accessible schemas or filter by specific schema
  4. get_table_indexes - View table indexes

    • Index types and uniqueness
    • Indexed columns
    • Status information
    • Shows schema name for each index
  5. get_table_constraints - View table constraints

    • Primary keys, foreign keys
    • Unique and check constraints
    • Referenced tables
    • Shows schema name for each constraint
  6. list_schemas - List all accessible schemas

Security

  • All queries use bind variables to prevent SQL injection
  • Connections are created per-query (no persistent pools)
  • Comprehensive audit logging with timestamps and duration
  • Environment variables keep credentials secure
  • Supports both read-only and read-write operations

Requirements

  • Node.js 18+
  • Oracle Database (any version)
  • Network access to Oracle database

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选