Sunday, November 22, 2026

How to integrate oracle SQL-cL MCP server using VS code

Ø  Introduction

Model Context Protocol (MCP) has emerged as a popular standard for enabling communication between AI agents and external tools or data sources. Before MCP, developers had to create custom integrations for each data source, which often increased development effort and made applications harder to maintain. MCP simplifies this process by providing a standardized interface between AI applications and external systems. In an MCP-based architecture, the AI agent primarily acts as an orchestrator, while the actual interactions with databases, APIs, and other resources are performed by MCP servers.

This article provides a brief overview of MCP architecture and demonstrates a practical use case with an Oracle Database using the Oracle SQL Developer extension in Visual Studio Code.

Why is MCP important for Oracle professionals?

Traditionally, developers needed to manually write SQL queries, database integrations, and API connectivity layers. MCP enables AI agents to discover and interact with Oracle databases through standardized tools. This reduces integration complexity and allows AI-driven workflows such as schema exploration, query generation, database health analysis, and data discovery.

 

Ø  MCP architecture

MCP (Model Context Protocol) is an open-source standard for connecting AI applications to external systems. Using MCP, AI applications like Claude or ChatGPT can connect to data sources (e.g. local files, databases), tools (e.g. search engines, calculators) and workflows (e.g. specialized prompts)—enabling them to access key information and perform tasks.

 



MCP follows a client-server architecture where an MCP host — an AI application like Claude Code or Claude Desktop — establishes connections to one or more MCP servers. The MCP host accomplishes this by creating one MCP client for each MCP server. Each MCP client maintains a dedicated connection with its corresponding MCP server.Local MCP servers that use the STDIO transport typically serve a single MCP client, whereas remote MCP servers that use the Streamable HTTP transport will typically serve many MCP clients.The key participants in the MCP architecture are:

MCP Host: The AI application that coordinates and manages one or multiple MCP clients

MCP Client: A component that maintains a connection to an MCP server and obtains context from an MCP server for the MCP host to use

MCP Server: A program that provides context to MCP clients

For example: Visual Studio Code acts as an MCP host. When Visual Studio Code establishes a connection to an MCP server, such as the SQL cl MCP server the Visual Studio Code runtime instantiates an MCP client object that maintains the connection to the SQL cl MCP server.

Note that MCP server refers to the program that serves context data, regardless of where it runs. MCP servers can execute locally or remotely. For example, when Claude Desktop launches the filesystem server, the server runs locally on the same machine because it uses the STDIO transport. This is commonly referred to as a “local” MCP server. The official Sentry MCP server runs on the Sentry platform, and uses the Streamable HTTP transport. This is commonly referred to as a “remote” MCP server.

 

MCP consists of two layers:

Data layer: Defines the JSON-RPC based protocol for client-server communication, including capability and version discovery, and core primitives, such as tools, resources, prompts and notifications.

Transport layer: Defines the communication mechanisms and channels that enable data exchange between clients and servers, including transport-specific connection establishment, message framing, and authorization.

How This Works in AI Applications

When the language model decides to use a tool during a conversation, the AI application intercepts the tool call, routes it to the appropriate MCP server, executes it, and returns the results back to the LLM as part of the conversation flow. This enables the LLM to access real-time data and perform actions in the external world.

 

Ø  Environment/Tools used:

A.              Download and install vss code using below link

https://code.visualstudio.com/download

B.              Install latest Oracle SQL Developer for VSCode extension

C.              Install Cline extension

D.              Create an autonomous database in OCI

E.               Download sample schema from oracle using below GIT repository link and import the data

https://github.com/oracle-samples/db-sample-schemas/releases/tag/v23.3

Import Data with Oracle Data Pump Latest Version or an Older Version

 

Ø  Pre-requisite:

Test successful database connection from SQL developer to your ADB instance.

 

Ref:- https://docs.oracle.com/en/database/oracle/sql-developer/23.1/dmrig/download-client-credentials-wallet-files.html

Select your ADB instance from OCI console and click on database connection tab.There you can see

Download wallet button.




 

Please provide password and download the wallet in your local desktop/laptop where SQL developer is running. Make sure you save or remember the password you have used.

 



 

Click on the SQLdeveloper tools as shown in left panel and provide connection information.

You need to select connection type as Cloud Wallet. 



If you forgot admin password then it can be changed from More actions tab(Administrator password) in OCI console and change password



 Setup cline which is an open source AI coding agent using below options




 

Select Free model like below.If you have subscription for Claude you can utilize that one also.Click on create my account and it will take you

to use your email account and complete your authentication to cline.                       

     


                                     

Add MCP server provided by SQL developer extension

Click on Cline tool from the left panel and hover over 3 parallel bars as highlighted below and click on settings button

 


    Click on edit configuration



               Find the absolute path of sqldev.exe and add below line

                              {

        "mcpServers": {

        "SQLcl - SQL Developer": {

        "timeout": 60,

        "type": "stdio",

        "command": "C:\\Users\\DELL\\.vscode\\extensions\\oracle.sql-developer-26.3.1-win32-x64\\cli\\sqldev.exe",

        "args": [

        "--jvm-option",

        "-Duser.language=en",

        "sql",

        "-mcp"

                 ]

               }

             }

 }

                You can see connection has been established and green dot is appeared like below




What happens behind the scenes?

1.      Cline starts sqldev.exe sql -mcp

2.      SQL Developer registers MCP tools

3.      Cline discovers available tools

4.      LLM decides which tool to invoke

5.      Tool executes SQL against Oracle Database

6.        Result is returned to the user

 

Current limitations:

Ø  Access is restricted by database privileges.

Ø  Incorrect AI-generated queries may still need validation.

Ø  MCP does not replace DBA knowledge.

Ø  Sensitive production databases should be protected with proper access controls.


After the MCP server is configured successfully, we can begin interacting with the Oracle database using natural language prompts.

Below is an user query where I asked size of the database..

 




 Help me to write a query which product has highest sale group by country..



I hope you have learned something useful..

How to integrate oracle SQL-cL MCP server using VS code

Ø   Introduction Model Context Protocol (MCP) has emerged as a popular standard for enabling communication between AI agents and external ...