oracle-sqlplus-mcp
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/PRODClaude Desktopの設定
claude_desktop_config.jsonに以下を追加します:
{
"mcpServers": {
"oracle": {
"command": "npx",
"args": ["-y", "oracle-sqlplus-mcp"],
"env": {
"ORACLE_CONNECTION": "username/password@host:port/servicename"
}
}
}
}オプションの環境変数
変数 | デフォルト | 説明 |
| (必須) | 完全な接続文字列 |
|
| PATHにない場合のsqlplusバイナリへのパス |
|
| クエリのタイムアウト時間(ミリ秒) |
カスタム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"
}
}
}
}利用可能なツール
ツール | 説明 |
| 接続をテストし、Oracleのバージョンを返す |
| テーブル数を含む全スキーマを一覧表示 |
| スキーマや名前パターンでフィルタリング可能なテーブル一覧を表示 |
| カラム、データ型、NULL可否、主キーを表示 |
| テーブルからサンプル行を取得 |
| SELECTクエリを実行 |
| DDL/DML(INSERT, UPDATE, DELETE, CREATEなど)を実行 |
| ストアドプロシージャ、関数、パッケージを一覧表示 |
プロンプトの例
"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 toolsdescribe_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
Scored across 8 tools
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.
All tool names follow a consistent verb_noun pattern with underscores (e.g., describe_table, list_tables), making them easy to parse and predict.
Eight tools is an appropriate number for a database interaction server, covering essential operations without being overwhelming or too sparse.
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
Related MCP Connectors
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Draxlr's remote MCP server connects AI assistants to your SQL databases and dashboards. Explore schemas, run read-only queries, manage saved queries and dashboards, and export results, all with row-level security so each user sees only their own data.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Related MCP Servers
- AlicenseBqualityCmaintenanceMCP server for accessing Oracle databases, enabling schema exploration, query execution, and performance analysis.12MIT
- AlicenseNot gradedqualityNot gradedmaintenanceA comprehensive MCP server for SQL Server database operations, enabling CRUD operations, schema exploration, and stored procedure execution through natural language.7 npmMIT
- AlicenseNot gradedqualityDmaintenanceMCP server to connect to Oracle databases and run SQL queries (up to 150 rows) via a single 'query' tool.ISC
- AlicenseAqualityCmaintenanceMCP 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.102MIT