Skip to Main Content

SQLcl: MCP Server & SQL Prompt

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cannot Run SQL Project Command via SQLcl MCP ; Configuration files not found

Alexander Kluev11 hours ago

Hi Team,

I cannot run SQLcl Project command via MCP server, get an error

Exception Type: oracle.dbtools.extension.project.core.exceptions.ProjectExistsException 
Error Message: Could not identify the project you are in, configuration files not found 
Please ensure you can access the files and are in the correct directory 

when I'm sure I'm in the correct directory and SQLcl Project commans run form it just fine, .dbtools folder exists and properly configured

Environment:

  • VS Code with Github Copilot
  • Winodws
  • SQLcl 25.4.1.

Copilot wrote this debug log:

SQLCL PROJECT EXPORT - ERROR LOG 
================================ 
Date: 2026-02-19 
Command: project export -o CLA_APEX.fbo_tr_users -debug -verbose 
SQLcl Version: 25.4.1 
MCP Oracle Server Version: 0.9.0 

----- DISPLAY ARGUMENTS ----- 

LIST: null 
OBJECTS: [CLA_APEX.FBO_TR_USERS] 
SCHEMAS: null 
THREADS: null 
DEBUG: true 
VERBOSE: true 

----- END ARGUMENTS ----- 

----- ERROR DETAILS ----- 

Exception Type: oracle.dbtools.extension.project.core.exceptions.ProjectExistsException 
Error Message: Could not identify the project you are in, configuration files not found 
Please ensure you can access the files and are in the correct directory 

Root Cause Location: ProjectUtils.getProjectRootFolder(ProjectUtils.java:215) 

Full Stack Trace: 
at oracle.dbtools.extension.project@25.4.1/oracle.dbtools.extension.project.core.utils.ProjectUtils.getProjectRootFolder(ProjectUtils.java:215) 
at oracle.dbtools.extension.project@25.4.1/oracle.dbtools.extension.project.commands.handler.ProjectCommand.handleEvent(ProjectCommand.java:66) 
at oracle.dbtools.common@25.4.1/oracle.dbtools.raptor.newscriptrunner.util.command.ParsedCommandListener.handleEvent(ParsedCommandListener.java:64) 
at oracle.dbtools.common@25.4.1/oracle.dbtools.raptor.newscriptrunner.CommandRegistry.fireListeners(CommandRegistry.java:474) 
at oracle.dbtools.common@25.4.1/oracle.dbtools.raptor.newscriptrunner.ScriptRunner.lambda$run$0(ScriptRunner.java:241) 
at oracle.dbtools.common@25.4.1/oracle.dbtools.raptor.newscriptrunner.ScriptRunnerContext.runWithStoredContext(ScriptRunnerContext.java:838) 
at oracle.dbtools.common@25.4.1/oracle.dbtools.raptor.newscriptrunner.ScriptRunner.run(ScriptRunner.java:124) 
at oracle.dbtools.common@25.4.1/oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:364) 
at oracle.dbtools.common@25.4.1/oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:245) 
at oracle.dbtools.common@25.4.1/oracle.dbtools.runner.SqlClCommandsRunner.run(SqlClCommandsRunner.java:62) 
at oracle.dbtools.extension.mcp@25.4.1/oracle.dbtools.extension.mcp.tools.RunSqlCLTool.lambda$create$0(RunSqlCLTool.java:91) 
at io.modelcontextprotocol.sdk.mcp@0.9.0/io.modelcontextprotocol.server.McpServerFeatures$AsyncToolSpecification.lambda$fromSync$0(McpServerFeatures.java:235) 
at reactor.core@3.7.0/reactor.core.publisher.MonoCallable.call(MonoCallable.java:72) 
at reactor.core@3.7.0/reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:228) 
at reactor.core@3.7.0/reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) 
at reactor.core@3.7.0/reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) 
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) 
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) 
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) 
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) 
at java.base/java.lang.Thread.run(Thread.java:1583) 

----- ANALYSIS ----- 

Issue: The MCP SQLcl Oracle Server cannot locate the project root folder, 
which should be identified by the presence of .dbtools/ configuration directory. 

The error originates from the RunSqlCLTool (RunSqlCLTool.java:91) in the 
MCP extension layer, suggesting the issue may be with how the MCP tool 
is passing the working directory context to SQLcl's project utils. 

Possible Causes: 
1. Working directory context not passed to SQLcl session 
2. MCP tool running in a different context than the project directory 
3. Project configuration files (.dbtools/) not accessible from MCP tool context 

Thanks in advance,

Alex

Comments
Post Details
Added 11 hours ago
1 comment
15 views