Skip to main content
Glama
oracle-sqlplus-mcp

oracle-sqlplus-mcp

by sagar1012

oracle-sqlplus-mcp

sqlplusを接続バックエンドとして使用するOracle Database用MCP(Model Context Protocol)サーバーです。Oracle Instant ClientのNode.jsバインディングは不要で、sqlplusバイナリが動作すれば利用可能です。


前提条件

  • sqlplusがインストールされており、PATHに通っていること(Oracle Instant ClientまたはフルOracleクライアントに付属)

  • Node.js 18以上


Related MCP server: sqlserver-mcp-colossal

インストール

npm install -g oracle-sqlplus-mcp
# or run directly with npx (no install needed):
npx oracle-sqlplus-mcp

接続文字列の形式

username/password@host:port/servicename

例:

scott/tiger@localhost:1521/ORCL
myuser/mypass@192.168.1.10:1521/XEPDB1
admin/secret@db.example.com:1521/PROD

Claude Desktopの設定

claude_desktop_config.jsonに以下を追加します:

{
  "mcpServers": {
    "oracle": {
      "command": "npx",
      "args": ["-y", "oracle-sqlplus-mcp"],
      "env": {
        "ORACLE_CONNECTION": "username/password@host:port/servicename"
      }
    }
  }
}

オプションの環境変数

変数

デフォルト

説明

ORACLE_CONNECTION

(必須)

完全な接続文字列

SQLPLUS_PATH

sqlplus

PATHにない場合のsqlplusバイナリへのパス

QUERY_TIMEOUT_MS

30000

クエリのタイムアウト時間(ミリ秒)

カスタムsqlplusパスの例

{
  "mcpServers": {
    "oracle": {
      "command": "npx",
      "args": ["-y", "oracle-sqlplus-mcp"],
      "env": {
        "ORACLE_CONNECTION": "scott/tiger@192.168.1.10:1521/ORCL",
        "SQLPLUS_PATH": "C:\\oracle\\instantclient_21_9\\sqlplus.exe",
        "QUERY_TIMEOUT_MS": "60000"
      }
    }
  }
}

利用可能なツール

ツール

説明

test_connection

接続をテストし、Oracleのバージョンを返す

list_schemas

テーブル数を含む全スキーマを一覧表示

list_tables

スキーマや名前パターンでフィルタリング可能なテーブル一覧を表示

describe_table

カラム、データ型、NULL可否、主キーを表示

get_table_sample

テーブルからサンプル行を取得

execute_query

SELECTクエリを実行

execute_ddl

DDL/DML(INSERT, UPDATE, DELETE, CREATEなど)を実行

list_procedures

ストアドプロシージャ、関数、パッケージを一覧表示


プロンプトの例

  • "Oracleへの接続をテストして"

  • "データベース内の全スキーマをリストアップして"

  • "SCOTTスキーマ内のテーブルを見せて"

  • "EMPLOYEESテーブルの構造を教えて"

  • "HR.EMPLOYEESからサンプルを5行取得して"

  • "次のクエリを実行して: SELECT * FROM departments WHERE department_id < 50"

  • "HRスキーマ内の全ストアドプロシージャをリストアップして"


トラブルシューティング

sqlplus: command not found

SQLPLUS_PATHにsqlplusバイナリのフルパスを設定してください。

ORA-12541: TNS:no listener

ホスト、ポート、およびOracleリスナーが起動しているか確認してください。

ORA-01017: invalid username/password

認証情報を確認してください。接続文字列の形式: user/pass@host:port/service。

SP2-0306: Invalid option

sqlplusのバージョンが-Sサイレントモードをサポートしているか確認してください(最近のバージョンはすべてサポートしています)。

Available Tools

8 tools
describe_tableA

Describe the columns, data types and constraints of a table.

Inputs: table_name (required).

execute_ddlA

Execute a DDL or DML statement (CREATE, INSERT, UPDATE, DELETE, ALTER, DROP). Use with caution — changes are committed immediately.

Inputs: statement (required).

execute_queryA

Execute a SQL SELECT query against the Oracle database and return the results. Use standard Oracle SQL syntax. Do NOT include a trailing semicolon — it is added automatically.

Inputs: query (required).

get_table_sampleA

Fetch a sample of rows from a table (default: 10 rows).

Inputs: table_name (required), limit.

list_proceduresA

List stored procedures and functions for a given schema.

Inputs: schema.

list_schemasA

List all schemas (users/owners) in the database that have at least one table.

Inputs: no named parameters.

list_tablesB

List all tables accessible to the current user, optionally filtered by schema/owner.

Inputs: schema, search.

test_connectionA

Test the Oracle connection and return server version info.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 8 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose: describing tables, executing DDL, running queries, sampling rows, listing procedures, schemas, tables, and testing connections. No overlapping functionality.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with underscores (e.g., describe_table, list_tables), making them easy to parse and predict.

    Tool Count5/5

    Eight tools is an appropriate number for a database interaction server, covering essential operations without being overwhelming or too sparse.

    Completeness4/5

    The toolset covers core database operations (querying, DDL/DML, listing objects, describing, sampling) but lacks capabilities like viewing procedure source code or managing users, which are minor gaps.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      MCP server for accessing Oracle databases, enabling schema exploration, query execution, and performance analysis.
      12
      MIT
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      A comprehensive MCP server for SQL Server database operations, enabling CRUD operations, schema exploration, and stored procedure execution through natural language.
      7 npm
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      MCP server for Oracle Database enabling AI assistants to explore schemas, run queries, write data, and monitor sessions via natural language. Features read-only mode by default and uses Oracle Thin mode for zero-install connectivity.
      10
      2
      MIT