Can the Oracle SQLcl MCP server be locked down for an AI assistant's database access?
Yes, but only partly inside SQLcl. The SQLcl MCP server has restrict levels set through the -R argument, and it defaults to level 4, the most restrictive, which prohibits host commands, scripts and other sensitive operations. What the assistant can change is bounded by the privileges of the database user it connects as, so the restrict level is only one layer and the database account is the control that matters most. Treat the restrict level and the database user as a pair that must be approved together.
Built-in controls in SQLcl are the restrict level, the choice of named or saved connections (credentials stay in the SQLcl connection store, so the model sees a connection name rather than a password), and the tool set itself. The run-sql tool executes SQL and PL/SQL, and run-sqlcl executes SQLcl commands, so a reviewer should confirm which of these the chosen restrict level permits. Outside SQLcl sit the controls that actually bound damage: a least-privilege, read-only database user for testing as Oracle's developer blog recommends, database roles and grants, the network path from the workstation to the database, and database-side auditing. Confirm each of these with your DBA, because SQLcl does not supply them. Also confirm that the server is the oracle/mcp repository's own product: its README says it is not intended for production use, so an approval for production access needs a documented basis beyond that repository.
Oracle SQLcl MCP controls by version and component
This table compares the SQLcl MCP Server controls documented in the 25.2 and 26.2 guides, the 26.3 tools reference and Oracle's developer blog. Read each row across what ships built in, what your database or client configuration must supply, and what is not documented and must be confirmed with Oracle. The main takeaway is that restrict level 4 is the default, while SSO and session audit logging are not documented and need confirmation before approval.
| Control | Built in | Needs database or client configuration | Not documented, confirm with Oracle |
|---|---|---|---|
| Restrict levels 0 to 4 | Five levels, set per server with the -R argument | Client config args must include -R to change the level | Full command list for levels 2 and 3 |
| Default restrict level | Level 4, the most restrictive, when no -R is given | No database setting needed | Whether the default differs between 25.2 and 26.x |
| Script and host command blocking | Level 4 blocks host commands, scripts and sensitive operations | Level 1 allows @ and @@ scripts but blocks host commands | How levels 2 and 3 treat scripts and host commands |
| Least-privilege database user | run-sql and run-sqlcl follow the connected user's privileges | Create a read-only user; Oracle's blog recommends it for testing | Whether SQLcl checks privileges before running statements |
| Credential store behavior | Model sees the connection name, not the password | Save credentials in the SQLcl connection store before starting | Encryption and access controls on the connection store |
| Single connection per server instance | One active database connection per server instance | Run a separate server instance for each database | Whether a single instance can switch connections in 26.3 |
| SSO on the MCP connection | None documented for the server itself | Database logins use the saved connection's credentials | Whether an external identity provider can sign in to the server |
| Audit logging of MCP sessions | None documented for the server itself | Database auditing set by the DBA may record sessions | What session logs SQLcl writes, which fields, and retention |
| oracle/mcp repository status | SQLcl MCP server ships with SQLcl 25.2.0 or newer | Requires Java 17 or 21 available to SQLcl; repo README says not for production | Production support status of the oracle/mcp repository |
Where SQLcl enforces restrictions and where the database enforces them
Restrictions on the Oracle SQLcl MCP server sit at two separate points, and a reviewer should not treat either one as a complete control. The first is SQLcl itself. The server is started with sql -mcp, and the MCP client launches and manages it automatically. SQLcl then applies the restrict level to the commands it is willing to run. The default is level 4, which prohibits host commands, scripts and other sensitive operations. Lower levels open more: level 1 allows scripts (@ and @@) but still blocks host commands, and level 0 gives full access. The level is set through the -R argument in the args array of the client configuration, so the reader should confirm which value each developer's client actually passes.
The second point is the database. The run-sql tool executes SQL queries and PL/SQL blocks, and run-sqlcl executes SQLcl commands, so a restrict level does not decide whether the assistant can insert, update, drop or grant. Those outcomes depend on the privileges of the database user behind the active connection. A permissive restrict level combined with a privileged account gives the assistant wide reach, and a restrictive level does not make a privileged account safe. Decide the database role first, then set the restrict level as a second layer on top of it.
Connections come from preconfigured named or saved SQLcl connections, so the assistant selects a connection by name and never sees the password, which stays in the SQLcl connection store. That design keeps credentials out of the prompt, but it also means anyone who can start the server can reach whichever databases are saved for that profile. Ask which connection names each client can use, keep production and development connections in separate profiles, and confirm that the saved connections point to a read-only account for any environment where the assistant should only query.
How an assistant request reaches the Oracle database
The request starts in the AI client, which launches the SQLcl MCP server with sql -mcp and uses a saved connection. The server applies its restrict level before any tool runs, so run-sql or run-sqlcl is passed on or refused. The database then checks the privileges of the connected user, which is the step that decides what a change can actually do. Check the restrict level, the database user's grants and where logs are written, since the diagram marks those controls as outside the request path.
Request path from the AI client to the database, with logging and network controls shown outside it.
Which MCP tools carry the most risk
The SQLcl MCP Server exposes a small set of named tools, and each one reaches the database in a different way. Some run arbitrary SQL, some run SQLcl commands, and some change which database the session points at, so the controls that matter differ from tool to tool.
run-sql executes SQL and PL/SQL
The run-sql tool runs SQL queries and PL/SQL blocks sent by the assistant. It can read, insert, update, delete, and run DDL, so what it can change is set by the privileges of the connected database user, not by the tool itself. Before approving the server, confirm which grants the connected user holds, and test with a read-only account first, as Oracle's developer blog recommends for testing.
Tool referencerun-sqlcl executes SQLcl commands
The run-sqlcl tool runs SQLcl commands rather than plain SQL, so it reaches beyond the database itself. Commands that touch the host or run scripts are the ones the restrict level governs, which is why the level set in the server's args array is a primary control. Confirm the restrict level in effect for each client configuration, because a default or a loosened level changes what this tool can do.
Restrict level guideconnect and disconnect switch databases
The connect and disconnect tools change which database the session uses during a conversation. A session that starts on a test connection can be moved to a production connection by the assistant, so the set of available connections matters as much as the tool itself. Ask Oracle or your DBA to confirm whether the server can be limited to named connections and whether switching is logged.
list-connections exposes connection names
The list-connections tool returns the names of the saved SQLcl connections the server can use. Oracle's developer blog says credentials stay in the connection store, so the model sees the connection name but not the password. Still, connection names can reveal environment layout, such as production or customer-data sources, so review which saved connections are visible to each client before rollout.
schema-information reveals structure
The schema-information tool returns the structure of database objects, which helps the assistant write queries but also maps the data model for anyone reading the transcript. Table names, column names and relationships can be sensitive even when no row data is returned. Decide whether the connected user should see the full schema or only the schemas the assistant needs, and check that the user's grants match that decision.
26.3 tools need confirmation
The 26.3 guide lists context_retrieve, annotation_generate, skill_sync and request_status alongside the older tools. Read the 26.3 tool reference for what each one reads, writes or syncs, and whether it sends content outside the database, before approving them. Do not assume they inherit the restrict level or database privileges described for run-sql without confirming that in writing.
26.3 tool referenceChoosing a restrict level for each use
Level 4 is the default restrict level for the SQLcl MCP Server and the most restrictive one. It prohibits host commands, scripts and other sensitive operations, so it is the right starting point for general assistant use against a shared or business database. The trade-off is capability: an assistant working at this level can run SQL and PL/SQL through the tools, but it cannot reach into the operating system or run script files that a developer might rely on for routine work. Leave this level in place unless a specific need is documented and approved.
- Host commands blocked: The assistant cannot run commands on the machine that hosts SQLcl.
- Scripts blocked: Script calls such as @ and @@ are not available, so the assistant cannot chain files you have not reviewed.
- Database privileges still apply: The run-sql tool executes whatever the connected user is allowed to do, so level 4 does not replace a least-privilege database account.
- Lowest operational friction for review: Security reviewers can describe the server's behavior in one sentence, which simplifies approval.
- Default in the client configuration: If the
-Rargument is absent from the args array, confirm with the vendor guide that the default still applies in your SQLcl version.
Before approving general use, confirm the level actually in effect on each workstation and that the connected database user is read-only for that audience.
Level 1 is the choice when a team's approved workflows depend on SQL scripts that use @ or @@ calls, and when host commands must stay blocked. It relaxes only the script restriction compared with level 4. That makes it useful for reviewed migration or reporting scripts, but it also means the assistant may trigger script files that exist on the machine, so the content of those files becomes part of the control.
- Scripts allowed: The @ and @@ script calls run, so the scripts directory must be controlled.
- Host commands still blocked: Operating system commands remain unavailable at this level.
- Script review becomes a gate: Each script the assistant can reach should be version-controlled and approved, with its SQL reviewed for writes.
- Narrower than level 0: Because host commands are blocked, the blast radius is smaller than full access, though scripts can still change data if the database user allows it.
- Confirm the level in the args array: The
-Rvalue with 1 is set in the client configuration, and reviewers should check that file in each environment.
Before approving level 1, list the script files the assistant can reach, confirm who owns them, and verify that the connected database user cannot make changes that the scripts do not need.
Level 0 gives full access, with no restriction on host commands or scripts. It belongs only in isolated test environments: a disposable database with synthetic or masked data, no network path to production, and no stored production credentials. The trade-off is that a level 0 assistant can do anything the operating system and the connected database user allow, so the risk moves from the tool to the environment around it.
- Full access, no restriction: Host commands, scripts and sensitive operations are all available.
- Isolation is the control: The test database, host and network should be separated from production and from shared corporate systems.
- Test data only: Confirm that the data is synthetic or masked before any use.
- Never in shared client configurations: A level 0 setting copied into a team template can reach developers who did not intend it.
- Recorded exception: Document who approved level 0, for which environment, and when it is reviewed.
Before any level 0 use, check that the environment cannot reach production, that the host account has no privileged rights, and that the configuration file is not distributed to general users.
Decisions to make before approving the server
Approving the Oracle SQLcl MCP server is less a single yes or no than a set of configuration choices. The restrict level, the database user, the connection store, the connection scope and the environments the server can reach together decide what an assistant can read, change and expose.
Restrict level
The server defaults to restrict level 4, which blocks host commands, scripts and other sensitive operations. Lowering it through the -R argument in the args array widens what the assistant may run, with level 1 allowing scripts and level 0 giving full access. Ask the team to justify any level below 4 in writing, and confirm the level in the client configuration file, not only in the team's notes.
- Default restrict level
- Level 4
Read-only or write-capable database user
The run-sql and run-sqlcl tools execute whatever the connected user's privileges allow, so the database account is the real boundary. Oracle's developer guidance recommends a least-privilege, read-only user for testing. Use separate accounts per environment, grant only the schemas and objects needed, and confirm that DDL and DML are denied where the use case is read-only.
Connection store ownership and rotation
Credentials stay in the SQLcl connection store, so the model sees the connection name but not the password. That protects the secret from the prompt, but it does not decide who owns the store or how often its credentials change. Name a database owner for each saved connection, rotate its password on a fixed schedule and remove connections when a project ends.
One connection per server instance
Each server instance holds a single active database connection, so reaching several schemas or databases means running several instances. Each instance then carries its own restrict level, user and client entry. Before approval, list every connection the team needs and confirm that the extra instances are reviewed, not added quietly by developers.
Whether production data is reachable
A server pointed at production can read customer records and, with a write-capable user, change them. Most organizations decide that production stays out of reach for AI assistants, or that access is limited to a read-only account with restrict level 4 and logged use. Write that decision into the approval record and confirm that no saved production connection exists on developer machines.
Oracle's server versus community servers for the same risk
The first decision is which server sits between the AI client and the database, and the answer changes how much review you owe. The oracle/mcp repository holds MCP servers for Oracle products published by Oracle under the UPL-1.0 license, and its README says the code is not intended for production use. That statement should end any plan to deploy a repository server as-is. The community projects, Tommi2Day/oracle-mcp-server and luprzybyl/mcp-oracle, are individual developer projects, not Oracle products. Each repository describes its own features and settings, so their tool lists, defaults and maintenance status can differ from one another and from Oracle's SQLcl MCP Server.
Before any of these servers touches a database, your security team should review the repository itself. Read the code that runs queries, check how it stores and passes connection credentials, confirm which tools it registers and whether any of them write or execute DDL by default, and look at the commit history, open issues and release cadence. Ask whether the project has a named maintainer and a published process for reporting vulnerabilities. For community code, also confirm the license terms and the dependencies it pulls in, since your organization inherits both. Record the version you reviewed and pin it, so a later update does not change the behavior your reviewers approved.
Whichever server you choose, the database account is the control that limits damage. A server can only do what the connected user's privileges allow, so a least-privilege, read-only user is the baseline for every option, and the restrict levels in SQLcl only apply to the SQLcl server. Use separate credentials per server, keep them in a store the AI client cannot read, and confirm with each vendor or maintainer how the password is handled. Test each candidate server against a non-production database with a deliberately limited account, and check that write attempts fail as expected before any staff member connects one to production.
Order of work before production use
This sequence moves the SQLcl MCP server from a version check to an approved, monitored connection, with each step closing on a check that can be recorded. Work it in order, because later steps assume the database user and restrict level from earlier ones are already fixed.
Confirm SQLcl version and Java runtime
The platform engineering lead confirms that the SQLcl installation is version 25.2.0 or newer and that Java 17 or 21 is available to SQLcl on the machine or host that will run the server. Oracle's developer blog states both requirements. Record the SQLcl version string and the Java version reported by the host, and keep them with the change ticket so that a later reviewer can match the tested build to the approved one.
Create a dedicated least-privilege database user
A database administrator creates a separate user for the assistant, not a shared application or administrator account. Grant only the object privileges the use case needs, and avoid DBA roles, system privileges and write grants on production schemas. Oracle's developer blog recommends a least-privilege, read-only user for testing. Confirm the result by querying the data dictionary for the user's granted roles and privileges and checking that the list matches the written design.
Test the user read-only before any write path
The engineer saves the connection in the SQLcl connection store so the model sees only the connection name and not the password, then runs the agreed read-only queries through the MCP client. Attempt a few statements the user should not be able to run, such as DDL or an update on a table it can see, and confirm the database rejects them. Keep the output as evidence. If any write succeeds, fix the grants before continuing.
Set the restrict level explicitly
The engineer adds the -R argument to the args array in the MCP client configuration and sets the value deliberately instead of relying on the default. The SQLcl guide documents restrict level 4 as the default and most restrictive, with 0 through 3 as lower settings. Choose the lowest level the approved use case needs, and confirm by starting the server and checking that a blocked operation, such as a host command, is refused. Store the configuration file under change control.
Enable database auditing for the assistant user
A database security administrator turns on auditing for the dedicated user, covering logons and the statement types that matter for this use, such as DDL, privilege changes and data changes. Confirm the audit policy is active and that a test session from the assistant user produces an audit record. Also confirm who can read and purge those records, because the assistant's activity is only useful evidence if it is retained where the assistant cannot change it.
Restrict the network path to the database
The network engineer limits which hosts can open a connection to the database listener for this user, using firewall rules or the database's own access controls, and allows only the workstation or runner that hosts the MCP client. Verify from an unapproved host that the connection is refused, and from the approved host that it succeeds. Record both results. This step ensures that a credential copied from one machine cannot be used from another.
Run injection and over-privilege tests on a copy
The security engineer restores a non-production copy of the database and repeats the configuration there. Test prompt-injection attempts, such as instructions hidden in table content that ask the assistant to run other statements, and queries that try to reach objects the user should not see. Confirm that grants, restrict level and auditing each stop or record what they should. Log every failed control as a finding with a fix and a retest before going further.
Approve the configuration for production use
The data owner, security lead and the database administrator sign the approval record. The record lists the SQLcl version, the database user and its grants, the restrict level, the audit policy, the approved network hosts and the test results from the copy. Production use starts only after the approvers have reviewed the evidence and any open findings are closed or accepted in writing.
Evidence a security reviewer will ask for
This table lists the artifacts a reviewer should request for an Oracle SQLcl MCP deployment, and where each one comes from: the SQLcl configuration, the database, the network, or a test report. Read each row as a question to answer with a file, a query result or a signed test record. The main takeaway is that the assistant's real reach depends on the database user's privileges, so the database evidence matters as much as the SQLcl settings.
| Evidence item | Where it comes from | Owner |
|---|---|---|
| Restrict level in the MCP client config | SQLcl config: the -R argument in the args array, with 0 to 3 or the default level 4 | Platform or developer lead who owns the MCP client config |
| Database user grants and role list | Database: system and object privileges, roles and any DDL or write grants held by the connected user | DBA |
| Connection store handling | SQLcl connection store: confirmation that connection names are used and passwords are not placed in MCP client config | Security engineer with DBA support |
| SQLcl and Java versions in use | Installed SQLcl (25.2.0 or newer) and the Java 17 or 21 runtime SQLcl uses | Platform engineering |
| Database audit policy covering the MCP user | Database audit configuration naming the connected user and the statements captured | DBA with the compliance lead |
| Network path rules to the database | Network: firewall or security group rules showing which hosts can reach the database listener | Network or cloud security team |
| One active connection per server instance | SQLcl MCP setup record showing which database each server instance points to | Platform engineering |
| Read-only enforcement test results | Test report: a retest where write statements run as the MCP user and the database refuses them | Security team or independent tester |
Questions buyers ask before approving the Oracle MCP server
Is the Oracle SQLcl MCP server supported for production use?
Oracle's own MCP repository says its servers are not intended for production use, so get Oracle's written support position for the SQLcl MCP server before approving production access. The server runs inside SQLcl and needs SQLcl 25.2.0 or newer, with Java 17 or 21 available to SQLcl. Oracle's developer blog recommends a least-privilege, read-only user for testing, which points to a controlled test rollout first. Ask Oracle to confirm the supported SQLcl and Java versions, the support path, and which features are covered. Community servers from individual developers are a separate question, with their own settings and no Oracle support behind them.
Can we use SSO to sign the AI assistant into Oracle Database?
The sources available to this page do not document SSO for the SQLcl MCP server, so treat it as unconfirmed until Oracle or your own test shows how it works. What is documented is that the server uses preconfigured named or saved SQLcl connections, and the model sees the connection name while the password stays in the connection store. A single database connection is active per server instance, so access is tied to a connection rather than to an individual sign-in. Ask Oracle whether database authentication can be federated or linked to a named person, and confirm what your database audit trail records when a shared connection is used.
What privileges should the least-privilege database user have?
Start with a read-only user that has SELECT rights only on the schemas and objects the assistant needs, with no DML, DDL or administrative grants. Oracle's developer blog recommends a least-privilege, read-only user for testing. The run-sql tool executes SQL and PL/SQL blocks and run-sqlcl runs SQLcl commands, so the database user's privileges decide what the assistant can change. Effort rises with the number of schemas, since each needs explicit grants and review by your DBA. Write needs add a second user or a narrow write role with its own approval path. Audit requirements add policies on the user, which your DBA should define before testing begins.
Can the assistant drop tables at the default restrict level?
The sources do not show that the restrict level filters SQL statements, so do not rely on it to stop a DROP TABLE. The SQLcl MCP Server defaults to restrict level 4, which prohibits host commands, scripts and other sensitive operations. The run-sql tool executes SQL and PL/SQL, so whether a DROP succeeds depends on the privileges of the connected database user. To verify this, run a test in a non-production database with a user holding the privileges you plan to grant, and record which statements succeed. Level 0 gives full access, and level 1 allows scripts (@, @@) but blocks host commands. Confirm the exact behavior of each level with the restrict level documentation for your SQLcl version.
What must we build ourselves around the Oracle MCP server?
Oracle supplies the server, but your team owns the database accounts, saved connections, restrict level, client configuration and review process. Plan for a dedicated database user for each use case, with grants reviewed by the DBA. Keep credentials in the SQLcl connection store, not in client configuration files the model can read. Set the restrict level in the args array with the -R argument, and document the level chosen. Stand up a test database for trials, decide which MCP clients may connect, and monitor database activity from the connection. DeployOpen can test the finished setup for tool permissions, credential handling and data exposure, with a findings report and a retest.
Can our own team lock down the server without outside help?
A team with DBA and platform skills can do the lockdown in-house, because the steps are configuration and privilege work the vendor documents. The main steps are setting the restrict level, creating a read-only user, and keeping credentials in saved connections. Effort depends on the number of schemas and objects, the write needs, the audit requirements, and how many developers share one connection. Outside help is most useful for independent testing of the result. DeployOpen tests AI agent setups for prompt injection, tool and file permissions, data exposure and credential handling. Work is fixed-scope, agreed in writing, and quoted from that scope, since DeployOpen publishes no price list.
What a database-level incident would have needed
The sources for this page do not cover a reported incident involving the SQLcl MCP Server, so this section cannot describe one. What it can establish is what would have had to be true for an over-privileged or manipulated query to cause lasting damage. The main condition is the database account behind the connection. The run-sql tool executes SQL queries and PL/SQL blocks, and run-sqlcl executes SQLcl commands, so an assistant can change whatever the connected user is allowed to change. A prompt that steers the model toward a write, a grant or a schema change only succeeds if that user holds the privilege to do it. Before rollout, list the exact privileges on the account the server will use, and confirm that no shared administrative or application owner account is preconfigured in the connection store.
Four controls limit the damage a manipulated query can do. The first is a least-privilege, read-only database user, which Oracle's developer blog recommends for testing. The second is the restrict level. The SQLcl MCP Server defaults to level 4, the most restrictive, which prohibits host commands, scripts and other sensitive operations. Setting -R in the args array to 1 allows scripts but still blocks host commands, while level 0 gives full access and should not be used for assistant-driven sessions. The third is credential handling. Credentials stay in the SQLcl connection store, so the model sees the connection name and not the password, which limits what a manipulated session can reveal. The fourth is database auditing on the connected account, which is the record you will rely on if something goes wrong.
Treat these controls as the minimum baseline, not a substitute for a current security review. Ask Oracle for its security advisories and check them against the SQLcl version you plan to deploy, which must be 25.2.0 or newer. Confirm in writing which restrict level the deployed configuration uses, and test that level 4 blocks the host commands and scripts you expect it to block. Then run a planned negative test: ask the assistant to perform a write outside its approved scope and confirm that the database account refuses it and that the attempt appears in your audit trail. Repeat these checks after each SQLcl upgrade or change to the connection configuration, because the protection depends on settings that can drift over time.
How DeployOpen reviews an Oracle MCP setup before rollout
DeployOpen reviews Oracle MCP setups as part of AI agent rollout security reviews, covering the SQLcl MCP server, its restrict levels, the database user behind it and the surrounding admin and logging controls. The work is scoped in writing, tested against your environment, and handed over with findings, fixes and a retest.
How we scope
- Agree in writing which Oracle databases, SQLcl versions and MCP clients are in the review
- Record which tools the agent may reach, including run-sql, run-sqlcl and schema-information
- Confirm which database users, connection store entries and restrict levels each team uses
- Engagements are fixed-scope, with deliverables and timelines agreed before work starts
How we build
- Test the server with prompt injection attempts that target write, DDL and host-level actions
- Check whether the connected database user holds privileges beyond what the use case needs
- Verify that credentials stay in the SQLcl connection store and never reach the model
- Build a least-privilege, read-only test user and confirm the restrict level blocks prohibited operations
How we hand over
- Deliver a findings report with severity, reproduction steps and specific fixes for each issue
- Document the approved configuration, including restrict level, database grants and client settings
- Explain which audit and session records Oracle's documentation supports, and which need confirming
- Retest the agreed fixes and record the results before the setup is handed over
How we support
- Review changes to SQLcl versions, Java runtime, client configuration or database grants
- Run continuous testing of the Oracle MCP setup as teams add connections or new agent tools
- Prepare evidence for internal security reviews and customer security questionnaires
- Ongoing support, upgrades and continuous testing are available as a retainer

