Blog

SQLcl + MCP: The Game-Changer for DBAs in an AI World

Written by Chanaka Yapa | Jan 15, 2026 11:15:00 AM

Introduction

We are living in a fast-moving and highly volatile AI-driven world. Every day, something new emerges in the AI space. However, most Large Language Models (LLMs) today are primarily used to work with unstructured data – such as PDFs, documents, and internet content – and still struggle to understand and interact with structured enterprise data effectively.

At the same time, business users want to ask questions in simple, natural language and get answers quickly. If we can enable large Oracle databases to be queried and understood using natural language, that becomes a true game-changer.

This is where Oracle SQLcl and MCP servers come into play.

SQLcl (SQL Command Line) is Oracle’s modern command-line interface for working with Oracle Databases. It goes far beyond traditional SQL*Plus by supporting scripting, REST calls, JSON, Git integration, and now, AI-driven and MCP-based interactions. SQLcl acts as the execution layer that can run queries, collect results, and expose database information programmatically.

MCP (Model Context Protocol) servers act as a bridge between AI models (such as LLMs) and enterprise systems like databases. An MCP server defines secure, structured ways for an AI model to request data, execute predefined actions, and receive results – without giving the model unrestricted or unsafe access to the system.

If you need to learn more about MCP, read: https://blogs.oracle.com/database/introducing-mcp-server-for-oracle-database

When SQLcl is connected to an MCP server:

  • The LLM sends a natural-language request (for example, “Show me top 10 customers by revenue last quarter”).
  • The MCP server interprets and validates the request.
  • SQLcl executes the corresponding SQL or script against the Oracle database.
  • The results are returned through MCP to the AI, which formats them into a human-readable answer.

This creates a secure and controlled pipeline between AI and structured data.

I strongly believe that every DBA, data engineer, and developer should learn SQLcl and MCP. This combination fundamentally changes how we interact with enterprise data – making it faster, more accessible, and far more intuitive.

Data is gold. If you can easily access it, manipulate it, and extract insights from it, you can build better products, make smarter decisions, and create a real competitive advantage.

Why It Matters

  • For DBAs:
    Learn SQLcl + MCP to stay ahead. These tools fundamentally change how you interact with databases — faster queries, automated insights, and safer AI-driven access to structured data.
  • For Business Users:
    No more waiting for analysts or writing SQL. You can ask questions in natural language and get real-time insights from enterprise data.

How it Works (DBA vs Business Audience)

Here’s a simple architecture view:

[Business User / LLM] 
│ (Natural Language Request)

[MCP Server]
│ (Validate & Translate Request → SQL)

[SQLcl]
│ (Execute Query / Script)

[Oracle Database]
│ (Results)

[SQLcl → MCP → LLM / Business User]
Figure 1: MCP Server for Oracle Database

 

In this article, I will demonstrate how to integrate an Oracle database with Claude AI.

Pre-requsities


Before integrating Oracle SQLcl with Claude using MCP, ensure the following components are installed and configured.

  1. Download and install Java 17 (or later): https://www.oracle.com/java/technologies/downloads/#java17-windows
  2. Download SQLcl and install: https://www.oracle.com/ca-en/database/sqldeveloper/technologies/sqlcl/download/
  3. Install Claude Desktop
  4. Set up your database connection in sqlcl.

Installing SQLcl and Registering the Database Connection

Step 1: Download and Install Oracle SQLcl


If you have not yet installed Oracle SQLcl, download it from here.

First, determine the path of Oracle SQLcl installed using which SQL, we will need this to configure the Model Context Protocol (MCP) Server.

On Windows, installation is simply extracting the ZIP archive to a directory of your choice.

Step 2: Locate the SQLcl Binary


We need the full path to the SQLcl executable to configure the MCP server later.

Linux / macOS: which


Windows, it’s just a matter of extracting the zip file. To check binary is running fine, navigate to the folder and execute ./sql

Example path : D:\SOP\MCP\sqlcl-25.4.0.346.1855\sqlcl\bin\sql.exe

Step 3: Verify SQLcl Is Working


Sample output:

D:\SOP\MCP\sqlcl-25.4.0.346.1855\sqlcl\bin> .\sql /nolog
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.jline.nativ.JLineNativeLoader in an unnamed module (file:/D:/SOP/MCP/sqlcl-25.4.0.346.1855/sqlcl/lib/jline.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

SQLcl: Release 25.4 Production on Tue Jan 06 00:22:35 2026

Copyright (c) 1982, 2026, Oracle. All rights reserved.

Step 4: Save the Database Connection for MCP

Now, create and save a named database connection that the MCP server will use.

using : conn -save oracle19c_mcp -savepwd scott/******@192.168.56.200:1521/<service-name>
SQLcl: Release 25.4 Production on Tue Jan 06 00:22:35 2026

Copyright (c) 1982, 2026, Oracle. All rights reserved.

SQL> conn -save oracle19c_mcp -savepwd scott/******@192.168.56.200:1521/m_pdb
Name: oracle19c_mcp
Connect String: 192.168.56.200:1521/m_pdb
User: scott
Password: ******
Connected.
SQL>

Step 5: Validate the Saved Connection

Use SQLcl’s connection manager to verify the connection:

CONNMGR show oracle19c_mcp
CONNMGR test oracle19c_mcp

Sample output :

SQL> CONNMGR show oracle19c_mcp
Name: oracle19c_mcp
Connect String: 192.168.56.200:1521/m_pdb
User: scott
Password: ******
SQL> CONNMGR test oracle19c_mcp
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Connection Test Successful
SQL>

SQL> CONNMGR test oracle19c_mcp
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Connection Test Successful

Step 6: Test the MCP Server

Start the MCP server using the saved connection:sql -mcp -name <connection-name>

PS D:\SOP\MCP\sqlcl-25.4.0.346.1855\sqlcl\bin> .\sql -mcp -name oracle19c_mcp
---------- MCP SERVER STARTUP ----------
MCP Server started successfully on Tue Jan 06 10:14:07 EST 2026
Press Ctrl+C to stop the server
----------------------------------------
Server shutting down...

Integrating SQLcl + MCP with Claude Desktop


Now that the foundation is in place, the next step is to integrate our Oracle + MCP setup with Claude Desktop, so we can start querying the database using natural language.

Step 1: Install Claude Desktop

Download and install Claude Desktop by following the official documentation:
Installing Claude for Desktop

Make sure the installation completes successfully before proceeding.

Step 2: Open Claude Desktop Settings

  1. Launch Claude Desktop.
  2. Click on Menu (top left).
  3. Select File → Settings.
  4. In the Settings window, go to the Developer tab.
  5. Click Edit Config.

This action opens the claude_desktop_config.json file, where we will add and register our SQLcl-based MCP server so that Claude Desktop can connect to the Oracle database.

Figure 2: Add MCP server

Step 3: Enable Developer Configuration

In the Settings window:

  1. Navigate to the Developer tab.
  2. Click Edit Config.

This will open the claude_desktop_config.json configuration file, where MCP server connections can be defined and managed.

At this point, Claude Desktop is ready to be configured to communicate with SQLcl MCP servers, enabling secure, AI-driven access to Oracle structured data.

{
"mcpServers": {
"oracle19c": {
"command": "D:/SOP/MCP/sqlcl-25.4.0.346.1855/sqlcl/bin/sql.exe",
"args": ["-mcp", "-name", "oracle19c_mcp"]
}
}
}

Explanation

  • oracle19c_mcp – Logical name of the MCP server. This must match the credential profile name stored in SQLcl.
  • command – Full path to the SQLcl executable. Update this based on where SQLcl is installed on your system.
  • args 
    • -mcp enables MCP server mode in SQLcl.
    • -name oracle19c_mcp tells SQLcl which saved credential profile to use.

After saving the file, restart Claude Desktop to load the new configuration.

Once restarted, Claude Desktop will be able to send structured data requests to Oracle via SQLcl using the MCP protocol.

Figure 3: Restart Claude AI

Once the configuration is complete, your local MCP server will be registered and displayed here.

Figure 4: Validate Local MCP Server

 

Start Exploring MCP — Chatting with Your Database

Now that everything is configured, it’s time to start playing with MCP.

What this enables is something truly powerful: you can now directly chat with your database using natural language. Instead of writing SQL, you ask questions – and MCP, SQLcl, and the AI work together to translate those questions into structured queries and return meaningful answers.

In this example, I am testing against an Oracle 19c database.

Connect to the Database

First, let’s establish the connection.

Figure 5: Connecto database using Claude AI

After the connection is successfully established, the interface presents a set of available options, guiding you on what you can do next.

Figure 6: Claude AI prompt options

This is the output of the: Exploring the schema

As an Oracle Architect, I typically need deeper visibility than the default options provide. So I granted DBA privileges to the user to test whether we could analyze tablespaces and other internal database structures.

Claude AI (Sonnet 4.5) is incredibly powerful. It can analyze structured database data and generate detailed reports, complete with real observations and insights.

I genuinely love this – this is how we elevate our skills with AI. This is the future of how architects, DBAs, and engineers will be working on our skills with AI, this is what I was really looking for.

Conclusion

We are living in a fast-moving, AI-driven world, yet most AI systems today still focus primarily on unstructured data such as documents, PDFs, and web content. Structured enterprise data – where the real business value lives – has remained largely outside the reach of AI.

By combining Oracle SQLcl with MCP servers, that gap is finally closing.

This approach allows AI to interact with structured Oracle data in a secure, controlled, and auditable way, while preserving governance, performance, and data integrity. Instead of replacing technical expertise, it enhances it , allowing DBAs, architects, and engineers to move from manual execution to higher-level analysis, validation, and optimization.

More importantly, it democratizes access to data. Business users can ask meaningful questions in natural language and receive real-time, trusted insights without needing to understand schemas, SQL, or internal database structures.

This is not just a productivity improvement – it is a fundamental shift in how humans and databases interact.