Monday, December 1, 2025

Talk to Your Oracle Database Using Natural Language in VS Code with SQLcl MCP Server

 
stop writing SQL from scratch — let AI understand your schema and generate SQL for you.
 
Oracle SQLcl 25.2+ introduced one of the most important developer features in years: native MCP (Model Context Protocol) server support. With this, Oracle becomes the first major database platform to offer a standardized way for AI assistants like ChatGPT and Claude to securely understand your schema, generate SQL, and even run queries — all from plain English.
 
In this post, we’ll walk through:
 
  • What MCP is and why it matters
  •  How SQLcl can act as an MCP Server
  • Setting up VS Code to use natural language chat with your database
  • Real demos — from simple queries to advanced analytics
  • How AI can generate reports and dashboards from your Oracle data
 
Let’s get started.
 
What is MCP (Model Context Protocol)?
 
MCP is an open-source standard for connecting AI models to real systems.
 
Just like USB-C gives your devices a universal connector, MCP gives AI a universal connector to databases, filesystems, tools, and workflows
.
 


 
With MCP:
 
  • An AI assistant can inspect your database schema
  • Generate SQL queries
  • Execute them only with your permission
  • Produce dashboards, summaries, or reports
  • Plug into developer tools like VS Code
 
Oracle SQLcl now supports this protocol natively — no separate servers, plugins, or bridges needed.

 
SQLcl as an MCP Server
 
SQLcl 25.2 introduced the new command:

 
sql -mcp
 
Running this transforms SQLcl into a live MCP Server, allowing AI clients to talk to the database through a safe, controlled interface.
 
Example:

 
C:\Users\Rajeshwaran Jeyabal> sql -mcp
---------- MCP SERVER STARTUP ----------
MCP Server started successfully on Fri Nov 28 19:27:09 IST 2025
Press Ctrl+C to stop the server
----------------------------------------
 
This server acts as a secure gateway — the AI can propose SQL, but you must approve execution.
 
 
Prerequisites
 
Before beginning, ensure the following: 
  •  Visual Studio Code v1.101 or later
  • Oracle SQL Developer Extension for VS Code (version 25.2.0+)
  • At least one Oracle Database connection with password saved
 
Once this setup is complete, the chat panel in VS Code will automatically detect the MCP tools exposed by SQLcl.

 
Saving a Database Connection for MCP
 
First create a saved connection in SQLcl — MCP relies on this.

 
C:\Trash> sql /nolog
SQLcl: Release 25.3 Production on Thu Nov 27 20:46:15 2025
idle> conn hr/hr@localhost:1521/ora23ai
Connected.
hr@ORA23AI> connect -savepwd -save hr_local_mcp
Name: hr_local_mcp
Connect String: localhost:1521/ora23ai
User: hr
Password: ******
 
Now the MCP server will be able to use this connection automatically.
 
 
See It in Action — Talking to Your Database in Natural Language
 
Open the Chat Panel in VS Code.
You will notice SQLcl’s MCP tools automatically appear on the left sidebar.
 
This confirms that VS Code + AI Assistant + SQLcl MCP Server are connected.

 


 
 
Example 1 — “Show me all tables with their data volume”
 
You simply ask the AI:
 
Can you connect to the HR database and show me all tables with their data volume?
 
Claude / ChatGPT will: 
  • Check available MCP tools
  • Propose a SQL query
  • Ask for your confirmation
  • Execute it through SQLcl
  • Return a neat table of row counts
This ensures safety — nothing runs without approval.

 

 
Claude always asks permission prior to executing any queries. We can see exactly what it plans to execute before approving.
 


 
 
Example 2 — Analyzing Employees Hired in 2008
 
You ask:

 
Show me employees hired in 2008, grouped by department, with average salary for each group. Also show the highest-paid employee in each department.
 
AI generates a multi-part SQL including:
  • Filtering by hire year
  • GROUP BY analyses
  • JOINs to departments
  • Window functions to identify the highest salary
 
And after you approve, the results come back instantly.

 
 


 
Example 3 — AI-Generated Analytics Dashboard (Markdown Report)
 
Now let’s ask something more advanced:
 
Can you create a comprehensive HR dashboard showing: department headcount, salary ranges, recent hiring trends, and identify any departments that might need attention based on salary distribution or hiring patterns. Create the report as MarkDown
 
The AI will:
 
  • Pull multiple SQL queries
  • Aggregate the results
  • Identify anomalies/trends
 
Generate a clean Markdown report that looks like this:
 
HR Dashboard (Generated by AI)
1. Department Headcount
 
                Sales — 34 employees
                IT — 19 employees
                Marketing — 12 employees
                Finance — 11 employees
 
2. Salary Distribution
 
                IT: Highest variance, indicates mixed seniority
                Sales: Several outliers with high commission-based compensation
                Finance: Narrow salary band → stable structure
 
3. Recent Hiring Trends
 
                Hiring spikes in Q2 and Q4
                Marketing hired heavily last year due to campaign cycle
 
4. Departments Needing Attention
 
                IT — high salary spread
                Marketing — rapid hiring, potential onboarding load

 
 




 
This entire dashboard was produced using: 
  • Your HR schema
  • SQL generated automatically
  • Data analyzed via AI
  • Result formatted into Markdown
 No SQL written manually.
 
Why This Matters
 
This workflow fundamentally changes how developers work with Oracle:
 
  • No need to remember every syntax detail
  • No need to hand-craft queries
  • Faster exploration of schema and data
  • Insightful reports without BI tools
  • Safe execution (AI asks before running SQL)
  • Works locally — no cloud dependency
 
With SQLcl MCP Server, your database becomes conversational.
 
Conclusion
 
Oracle has taken a major step forward by bringing MCP support directly into SQLcl. Combined with VS Code AI chat, developers can now:
 
  • Query databases in plain English
  • Let AI generate complex joins and analytics
  • Approve execution safely
  • Produce dashboards and reports instantly
 
This is the future of database development — not replacing SQL, but removing the friction around writing it.