Connecting Claude Code to Oracle ATP through Visual Studio Code on a Windows machine

If you're working with Oracle Autonomous Transaction Processing (ATP) and want your AI coding assistant to actually query your database  not just guess at your schema  you can wire Claude Code directly into Oracle through SQLcl's MCP (Model Context Protocol) support. Once it's set up, you can ask Claude Code to run SQL, inspect tables, and even compile PL/SQL objects, right from your terminal or VS Code.

Here's the full Windows setup, end to end.

What you'll end up with

By the end of this post, Claude Code will be able to connect to your Oracle ATP instance, list your saved database connections, and run live SQL queries against it all from a chat prompt.

The setup has three moving parts:

  1. Claude Code -  Anthropic's CLI, available as a VS Code extension
  2. Oracle SQL Developer extension for VS Code - which bundles SQLcl, Oracle's command-line SQL client
  3. SQLcl registered as an MCP server -  the bridge that lets Claude Code call SQLcl as a tool



Install the Claude Code extension

  1. Open VS Code and go to Extensions (Ctrl+Shift+X).
  2. Search for Claude Code.
  3. Install the extension published by Anthropic — double-check the publisher, since similarly named third-party extensions exist.
  4. Once installed, click the Claude Code icon in the sidebar, sign in through the browser prompt, and authorize the connection. You should return to VS Code signed in.



















Install the Oracle SQL Developer extension

This extension bundles a full copy of SQLcl, so there's no separate download needed.

  1. Back in Extensions, search for Oracle SQL Developer.
  2. Install the one published by Oracle.

Once installed, SQLcl lives inside the extension's folder, something like:

C:\Users\<your-username>\.vscode\extensions\oracle.sql-developer-<version>-win32-x64\dbtools\sqlcl\bin

You'll need this path again later, so make a note of it — the version number will match whatever release you installed.












Create and save your ATP connection

  1. Open the Oracle SQL Developer panel from the VS Code Activity Bar (the database icon).
  2. Click + Add Connection.
  3. Fill in your connection name, username, password, and set Connection Type to Cloud Wallet.
  4. Browse to your ATP wallet ZIP and select the appropriate service 
  5. Click Test to confirm it connects, then Save.

Make sure Save Password is checked. SQLcl's MCP server needs the saved password to reconnect automatically - without it, every Claude Code session will fail with a credentials error.








Test the connection on its own

Before involving Claude at all, confirm the database connection works independently.

  1. Right-click your new connection and choose Open SQL Worksheet.
  2. Run:
    select sysdate from dual;
    
  3. You should get back a date. If you don't, stop and troubleshoot the ATP connection — none of the later steps will work without this passing first.






Verify SQLcl from the terminal

Confirm the bundled SQLcl executable actually runs.

Open a new VS Code terminal and run below command in  (PowerShell):

& "C:\Users\<your-username>\.vscode\extensions\oracle.sql-developer-<version>-win32-x64\dbtools\sqlcl\bin\sql.exe" -version

You should see a version number printed, like SQLcl: Release 24.x .... The leading & is PowerShell's syntax for running an executable by full path — needed here since the path isn't on PATH yet.







Install the Claude Code CLI

  1. Open PowerShell/ Terminal in vs code.
  2. Run the official installer:
    irm https://claude.ai/install.ps1 | iex
    
  3. You should see a confirmation with the installed version and its location, typically:
    C:\Users\<your-username>\.local\bin\claude.exe



Add Claude Code to your PATH

The installer doesn't always put claude.exe on your PATH automatically.

Add it permanently:

[Environment]::SetEnvironmentVariable(
    "Path",
    [Environment]::GetEnvironmentVariable("Path", "User") + ";C:\Users\<your-username>\.local\bin",
    "User"
)




Update your current session immediately (so you don't have to restart):

$env:Path += ";C:\Users\<your-username>\.local\bin"


Verify:

claude --version



If it's still not recognized, close VS Code completely, reopen it, start a new terminal, and try again.

Register SQLcl as an MCP server

This is the step that actually connects Claude Code to your database tooling. Register SQLcl at user scope, so it's available across every project on your machine:

claude mcp add sqlcl -s user -- "C:\Users\<your-username>\.vscode\extensions\oracle.sql-developer-<version>-win32-x64\dbtools\sqlcl\bin\sql.exe" -mcp

You should see: Added stdio MCP server sqlcl to user config.




Using -s user means you only have to do this once — without it, you'd need to reconfigure SQLcl separately for every project.

Verify the MCP configuration

claude mcp list

You should see sqlcl listed with its full path. You can double-check a specific entry with:



claude mcp get sqlcl


Start Claude Code and check the MCP connection

  • Start Claude Code:
    claude









Inside the prompt, type:
  • /mcp
You should see sqlcl listed as connected. If it shows as disconnected, double-check the sql.exe path and confirm the SQL Developer extension is still installed at that location.


List your saved connections

Ask Claude Code directly:

List my saved SQLcl database connections.

Your saved connection should appear in the response. If it doesn't, go back to Step 3 and make sure Save Password was enabled.








Connect and run a real query

This is the full end-to-end test.

Connect:

Connect to [your connection name].



 

Run a basic query:

Run: select sysdate from dual



 

Confirm user and database:

Run this query on ATP:

select user, sys_context('USERENV','DB_NAME') as database_name from dual;



 

If that last query returns your username and database name, everything is wired up correctly - Claude Code can now query your Oracle ATP database directly.

Once this is set up, Claude Code stops being just a code-writing assistant and becomes something that can actually see your live schema, verify assumptions against real data, and help debug queries with ground truth instead of guesses. It's a small amount of setup for a meaningful jump in how useful an AI assistant is for database-heavy work.



Since Claude code is now integrated with ATP, we need to be little careful as at this  point it can run anything. SO we need to instruct that few commands should not be run for our data safety. For example, Drop, delete, Truncate etc.


Follow the below steps:


Open a Claude Code session on your machine (the claude command in your terminal) and the below exact message as a prompt. 


Please inspect my global Claude Code instructions at ~/.claude/CLAUDE.md. Append a clearly labeled "SQLcl Safety Rules" section without changing or deleting any existing instructions. The rule must prohibit execution of DROP, DELETE, and TRUNCATE through SQLcl, including those commands inside scripts or multi-statement SQL. If detected, refuse to execute the SQL

Steps:

  1. In PowerShell, run claude to start an interactive Claude Code session (or continue one you already have open) in a directory context — it doesn't need to be a specific project folder since you're targeting the global ~/.claude/CLAUDE.md.
  2. Paste your message in as-is:
    Please inspect my global Claude Code instructions at ~/.claude/CLAUDE.md. Append a clearly labeled "SQLcl Safety Rules" section without changing or deleting any existing instructions. The rule must prohibit execution of DROP, DELETE, and TRUNCATE through SQLcl, including those commands inside scripts or multi-statement SQL. If detected, refuse to execute the SQL.
    
  3. Claude Code will read the file, show you a diff of what it's about to append, and ask for approval before writing (assuming you haven't disabled edit confirmations). Review the diff carefully before accepting.
  4. After it applies the edit, verify it directly:
    type $env:USERPROFILE\.claude\CLAUDE.md
    
    or open it in an editor — confirm the new section is there and nothing existing was altered.