Getting Started with Oracle AI Database 26ai with SQLcl MCP and the Claude Desktop

With the generally availability of on-premises Oracle AI Database 26ai imminent, I thought it was a good time to revisit a topic I played with earlier with Oracle 23ai.

Oracle AI Database 26ai

If you want to follow along with this blog post, and have yet to install Oracle AI Database 26ai, you may want to check-out this blog post, where I detailed how to get an Oracle AI Database 26ai up an running on your Mac.

Oracle SQLcl

If you have yet to install 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.

% which sql
/Applications/sqlcl/bin/sql

Add confirm database connectivity using sql, I have already created connections, as you can see below:

Oracle SQLcl

Claude Desktop

Install Claude Desktop following the Installing Claude for Desktop documentation.

Open Claude Desktop, click Menu, select File, and then click Settings. In the Settings window, click the Developer tab. Click Edit Config to open the claude_desktop_config.json JSON configuration file.

Add a JSON configuration as below, updating the path as required.

{
  "mcpServers": {
    "oracle-sqlcl": {
      "command": "/Application/sqlcl/bin",
      "args": ["-mcp"]
    }
  }
}

Restart Claude Desktop, and return to settings to confirm SQLcl is running.

Local MCP servers

Now we have confirmed Claude has an Oracle SQLcl MCP server, lets start a chat and try some prompts.

Chat 1 – Connect to HR

List all available database connections, then connect to hr and show me all available tables in the schema 
Database connections and HR schema tables

Chat 2 – Highest Paid Employee

Connect to hr and show me the highest paid employees and their departments  
Highest pain employees by department

Chat 3 – New Employee

Using hr connection, add a new employee Lucy Maclean,Engineering department,salary $50000,hired today
Add new employee Lucy Maclean to HR system

Chat 3 – Update Employee

Using hr connection, update employee Lucy Maclean, manager Alexander James
Update Lucy Maclean’s manager in HR connection

Summary

In this blog I have shared how to configure a Claude Desktop use the Oracle SQLcl Model Context Protocol (MCP) server and query Oracle AI Database 26ai HR schema.

As Uncle Ben said to Peter Parker (Spider-Man) “With great power comes great responsibility” and the same could be said for SQLcl MCP.

Before using SQLcl MCP in a production environment remember to consider and evaluate any data and database schema security requirements.

Leave a Reply

Create a website or blog at WordPress.com

Up ↑

Discover more from Ron Ekins' - Oracle Technology, DevOps and Kubernetes Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading