AI chatting with your Oracle Database - step by step for beginners [SQLcl MCP Server ]

Heard of MCP?

Test SQLcl MCP Server in just 5 minutes and see AI chatting with your database.

Here's a quick intro.

Warning

Try the below steps only on your sandbox environments - free tiers, sample schemas, etc.

Please don’t do it on real databases! (until you learn more)

Step 1 - get tools

You need these:

  • Sample database schema to use - I use the HR schema in my Oracle OCI Free Tier

  • SQLcl - minimum 25.2.2 ( read here how to install)

  • Account at github.com with a Github Copilot Pro - you can give it a try with a 30-day free trial.

  • Visual Studio Code (latest)

    • Github Copilot extensions installed and enabled in VS Code ( log in with your account at Github)

    • Oracle SQL Developer Extension for VS Code

Step 2 - set DB connection

Set a connection to the HR schema (or any other you have) in SQL Developer Extension in VS Code:

Step 3 - start MCP server

  • Open VS Code

  • Click View → Command Palette

  • Type “MCP” and choose “List Servers”

  • Click on “SQLcl Stopped”

  • Then click “Start server”

  • You will see something like this, saying that SQLcl MCP Server started:

Step 4 - configure your AI

  • Open GitHub Copilot chat in VS Code by clicking “Open Chat”

  • It will open a chat window. Choose “Agent” mode and preferred AI Model. I will pick “Agent” and “GPT-4.1”

Step 5 - ask AI to talk with your database

  • In the chat window, I typed: “Connect to my SQLcl HR database” (make sure to use a connection name you created in step 2)

  • AI Agent shows you what command it would like to execute. I chose “Continue” → “Always Allow” ( be careful with it and select “Use in this session” to check every command)

I got this:

Ok, let’s ask AI for something fancy (I have an HR schema with tables like countries, departments, employees, jobs, jobs_history)

Give me the average of employees’ salaries and group them by the country that employees come from

  • “Continue”

Ok, improve previous query and group salaries by departments

Show me the exact SQL query required to achieve those results.

Create a file with the API package for the EMPLOYEES table.

Summary

That’s it. 5 minutes as I promised :)

Try it on your own now.

Extras

Now, if you want to know more about MCP and are thinking about using it in more real scenarios, consider reading those articles:

First, read this “MCP Oracle Database Integration: Balancing Opportunity and Risk

Then go with some of these:

https://docs.oracle.com/en/database/oracle/sql-developer-command-line/25.2/sqcug/starting-and-managing-sqlcl-mcp-server.html#GUID-42167832-B364-4A3E-8A17-9FAE1F6CCFD3

https://dev.to/demasy/ai-meets-oracle-database-mcp-integration-with-oracle-sqlcl-4fn6

https://connor-mcdonald.com/2025/07/14/first-dabblings-with-sqlcl-mcp-server/

https://www.thatjeffsmith.com/archive/2025/07/getting-started-with-our-mcp-server-for-oracle-database/

https://www.youtube.com/watch?v=hj6WoZVGUBg&t=1740s

https://blogs.oracle.com/database/post/introducing-mcp-server-for-oracle-database

https://medium.com/@hamzaeraoui2000/sqlcl-mcp-server-tips-tricks-and-use-cases-aada55cdfbc2

0
Subscribe to my newsletter

Read articles from Rafal Grzegorczyk directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Rafal Grzegorczyk
Rafal Grzegorczyk

Oracle APEX & PL/SQL Developer with 10 years of experience in IT, including financial systems for government administration, energy, banking and logistics industry. Enthusiast of database automation. Oracle ACE Associate. Certified Liquibase database versioning tool fan. Speaker at Kscope, APEX World, SOUG, HrOUG, POUG and DOAG. Likes swimming in icy cold lakes in winter and playing basketball.