Skip to main content
Glama
sagar1012

oracle-sqlplus-mcp

by sagar1012

oracle-sqlplus-mcp

一个使用 sqlplus 作为连接后端的 Oracle 数据库 MCP (Model Context Protocol) 服务器。无需 Oracle Instant Client Node.js 绑定 —— 只需要一个可用的 sqlplus 二进制文件。


先决条件

  • sqlplus 必须已安装并可在 PATH 中找到(随 Oracle Instant Client 或完整 Oracle 客户端提供)

  • Node.js 18+


Related MCP server: oracle-db-mcp

安装

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

显示列、数据类型、可空性、主键

get_table_sample

从表中获取示例行

execute_query

运行任何 SELECT 查询

execute_ddl

运行 DDL/DML (INSERT, UPDATE, DELETE, CREATE 等)

list_procedures

列出存储过程、函数、包


示例提示词

  • "Test the Oracle connection" (测试 Oracle 连接)

  • "List all schemas in the database" (列出数据库中的所有模式)

  • "Show me tables in the SCOTT schema" (显示 SCOTT 模式下的表)

  • "Describe the EMPLOYEES table" (描述 EMPLOYEES 表)

  • "Get 5 sample rows from HR.EMPLOYEES" (从 HR.EMPLOYEES 获取 5 行示例数据)

  • "Run this query: SELECT * FROM departments WHERE department_id < 50" (运行此查询:SELECT * FROM departments WHERE department_id < 50)

  • "List all stored procedures in the HR schema" (列出 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 静默模式(所有现代版本均支持)。

Install Server
A
license - permissive license
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A production-grade Node.js MCP server for Oracle Database with HTTP transport, enabling SQL query execution, table listing, schema retrieval, and natural language to SQL conversion via MCP tools.
    14
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for accessing Oracle databases, enabling schema exploration, query execution, and performance analysis.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A comprehensive MCP server for SQL Server database operations, enabling CRUD operations, schema exploration, and stored procedure execution through natural language.
    8
    MIT

View all related MCP servers

Related MCP Connectors

  • GibsonAI MCP server: manage your databases with natural language

  • Official Microsoft MCP Server to query Microsoft Entra data using natural language

  • MCP server for managing Prisma Postgres.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sagar1012/oracle-sqlplus-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server