Skip to main content

Command Palette

Search for a command to run...

Claude Code & SQLcl MCP server

Updated
3 min read
Claude Code & SQLcl MCP server
M

With around 20 years on the job, Matt is one of the most experienced software developers at Pretius. He likes meeting new people, traveling to conferences, and working on different projects.

He’s also a big sports fan (regularly watches Leeds United, Formula 1, and boxing), and not just as a spectator – he often starts his days on a mountain bike, to tune his mind.

First follow this guide to set up your working Claude Desktop & SQLcl MCP server.

You at least need to get to this screen showing sqlcl running as an MCP server

Claude Desktop and Claude Code do not share the same MCP servers; so you have to set this up manually.

In Claude Code run this;

! claude mcp add sqlcl "C:/Oracle/sqlcl/bin/sql" -- -R 0 -mcp

You can optionally add it to any of these 3 levels by changing the command above

Scope Available in How to set
local current projects only. As above
project. IE current project shared by Git. --scope project
User All your projects. --scope user
Optional - I don't think you need this - Add the env environment variables

Edit this filename

#windows
C:\Users\%USERNAME%\.claude.json

#mac ~/.claude.json

search for sqlcl in the folder you need. After the env parameters.

"env": {
  "ORACLE_HOME": "C:/Oracle/sqlcl/",
  "JAVA_TOOL_OPTIONS": "-Djdk.net.unixdomain.tmpdir=C:\\Temp -Djava.io.tmpdir=C:\\Temp",
  "JAVA_HOME": "C:\\Java\\jdk-21"
}

Important step because MCP servers are loaded on startup

quit

and then back into Claude.

claude

Then check its connected; run this.

! claude mcp list

and you'll see something like this - look out for sqlcl and ✓ connected

!  claude mcp list
Checking MCP server health…

sqlcl: C:/Oracle/sqlcl/bin/sql -R 0 -mcp - ✓ Connected

You should now be able to form a connection (change the below connection name. It must be identical to the one you have stored in SQLcl or SQL Developer VS Code extension)

Connect to sqlcl MPC server localhost-docker-26aifree-tso

and it will show

❯ Connect to sqlcl MPC server localhost-docker-26aifree-tso

I'll load the SQLcl tool schemas and connect to that server.

  Called sqlcl

Connected to localhost-docker-26aifree-tso — Oracle Database 23.26.1.0.0. Ready for queries.

✻ Crunched for 8s

Then you can test it 🍌🍎🍍

❯ Do I have any tables in this schema named after fruit 🍌🍎🍍?

  Called sqlcl

No tables in this schema are named after fruit. The search covered common fruits (apple, banana, mango, orange, peach, etc.) and came up empty.

and again

❯ What boring tables do I have?

  Called sqlcl

You have 3 tables:

- EMP — employee data (classic Oracle demo table)
- DEPT — department data (classic Oracle demo table)
- DBTOOLS$MCP_LOG — MCP query audit log (system table used to log queries made through this MCP connection)

you can ask for it which skills it has

❯ What skills does this MCP server have

  Called sqlcl

The SQLcl MCP server provides 5 Oracle-maintained skills:

- apex — Oracle APEX application development
- db — Oracle Database (SQL, PL/SQL, SQLcl, ORDS, etc.)
- fusion — Oracle Fusion
- graal — GraalVM Native Image
- oci — Oracle Cloud Infrastructure

great you're all ready now to create some APEXLang applications.

ENJOY

What's the picture? It's the back exit of Leeds train station looking out to the canal. I was on my way to watch Leeds United smash Burnley - which they did! Visit Yorkshire