Extending Your Oracle 26ai Free Local Setup (Docker) with SQLcl MCP and Claude Desktop

In our earlier guide on setting up Oracle 26ai Free locally in Docker, we walked through how to pull the official Oracle 26ai image, start it in a container, and verify that your database instance (including the pluggable database FREEPDB1) was ready for use with SQLcl. You now have a locally runnable, AI‑capable Oracle Database that you can use for development, testing, experimentation, and learning without paying for a cloud instance or worrying about external connectivity.

One of the powerful capabilities introduced in Oracle 26ai is the ability to integrate with tools that speak the Model Context Protocol (MCP). MCP lets intelligent agents like Claude Desktop interact directly with your database through SQLcl, enabling natural‑language‑driven database exploration, query generation, and automation workflows. This post will walk you through the next logical step: extending your local Oracle 26ai Docker environment by configuring SQLcl with MCP support and connecting it to Claude Desktop for an interactive, AI‑powered SQL experience.


I also have a YouTube video on the same - Do check it out:

To recap quickly, at this point you already have Oracle 26ai Free running locally in Docker, and you’ve verified connectivity using SQLcl 25.3. In this extension, we’ll add a dedicated database schema for MCP clients, persist a named SQLcl connection that can be used from MCP tools, install and configure Claude Desktop, and then connect and query the database using Claude’s MCP interface. This approach is extremely useful when you want to:

  • Enable a conversational AI assistant to explore your schema and data
  • Automate query generation and schema insight without writing SQL manually
  • Prototype AI‑augmented tools that interact with your local database

You can think of this as moving from “Oracle 26ai locally installed” to “Oracle 26ai locally driven by AI tools”, where Claude Desktop becomes a powerful companion for exploration and rapid development against your database.

Why SQLcl MCP Matters

The Model Context Protocol (MCP) is a protocol that enables intelligent agents to call SQL and metadata commands directly through a database command‑line interface like SQLcl. Instead of hard‑coded connectors or ODBC/JDBC drivers, Claude Desktop uses MCP to launch SQLcl and send commands to it. This lets Claude treat SQLcl as a “SQL assistant” without exposing sensitive credentials or letting arbitrary AI access your system environment.

By the end of this tutorial, you will have a new database schema dedicated for AI exploration, a saved named connection that MCP clients can invoke without manually entering credentials, and a Claude Desktop MCP configuration that connects seamlessly to your local Oracle 26ai Free database.


Extending Your Oracle 26ai Free Local Setup (Docker) with SQLcl MCP and Claude Desktop

1. Connect as SYSTEM user

Before we create any new schema, we need to connect as a privileged user to perform user creation and role assignment. SYSTEM is the default administrative account in Oracle that allows you to manage schemas, tablespaces, and roles.

sql system/YourPassword123@//localhost:1521/FREEPDB1

2. Create a new schema for MCP

For AI-powered interactions through Claude Desktop, it’s best practice to create a dedicated schema. This keeps AI actions separate from other development or production data and provides full control over privileges.

CREATE USER app_schema IDENTIFIED BY app_pwd DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp QUOTA UNLIMITED ON users;

3. Grant a role to the schema

Oracle 26ai introduces a predefined DB_DEVELOPER_ROLE which bundles commonly required privileges for development tasks like creating objects, executing PL/SQL, and running queries. Granting this to your schema ensures Claude Desktop or other AI agents can fully interact with your schema.

GRANT DB_DEVELOPER_ROLE TO app_schema;

4. Create a named connection for SQLcl / MCP

Named connections in SQLcl are reusable credentials stored securely. These allow tools like Claude Desktop to connect without prompting for a password every time, improving automation and security.

conn -save app_schema -savepwd app_schema/app_pwd@//localhost:1521/FREEPDB1

5. List all named connections

Verify that your new named connection was saved correctly. This ensures Claude Desktop will be able to reference it without issues.

CONNMGR LIST

6. Test the connection from SQLcl

Before moving to Claude Desktop, always perform a quick test connection. This validates your credentials, named connection, and database accessibility.

connect -name app_schema

7. Configure Claude Desktop to use SQLcl MCP

Install Claude Desktop. Edit claude_desktop_config.json in Claude Desktop Settings → Developer → Edit configuration:

{
"mcpServers": {    
    "sqlcl": {
      "command": "C:/Oracle/sqlcl/bin/sql",
      "args": ["-mcp"]
    }
  }
}

8. Verify MCP setup

After saving the configuration, start Claude Desktop, go to the MCP Tools section, and you should see app_schema as an available database connection. Test by running a simple query:

SELECT sys_context('USERENV','CON_NAME') FROM dual;

Now your Oracle 26ai DB is fully ready with MCP-enabled Claude Desktop!

data:post.title

Extending Your Oracle 26ai Free Local Setup (Docker) with SQLcl MCP and Claude Desktop

Written by JENISH JOYAL J

Published on December 21, 2025

No comments:

Powered by Blogger.