-
Notifications
You must be signed in to change notification settings - Fork 744
Description
Describe the bug
I am newbie in the MCP and wanted to start a MCP server based on spring boot project. I have used a sample spring boot project from here. But when I tried to connect to the MCP sever via npx @modelcontextprotocol/inspector
, with the STDIO protocol, I am running into the following issue.
STDIO transport: command=java , args=[-jar, replace-with-full-path/spring_mcp-0.0.1-SNAPSHOT.jar] Error in /stdio route: Error: spawn java ENOENT at ChildProcess._handle.onexit (node:internal/child_process:286:19) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:90:21) { errno: -2, code: 'ENOENT', syscall: 'spawn java ', path: 'java ', spawnargs: [ '[-jar', 'replace-with-full-path/spring_mcp-0.0.1-SNAPSHOT.jar]' ] }
I am using modelcontextprotocol/inspector version 0.16.3
To Reproduce
Steps to reproduce the behavior:
- Build the spring boot sample
- Start the inspector using either
npx @modelcontextprotocol/inspector -- 'java -jar replace-with-full-path/spring_mcp-0.0.1-SNAPSHOT.jar'
ornpx @modelcontextprotocol/inspector
and in the UI filljava as command and provide
["-jar" " replace-with-full-path//spring_mcp-0.0.1-SNAPSHOT.jar"]as the argument. 3 Select
STDIO` as the transport type.
4 Press connect button and observe the reported error in the terminal where inspector has started.
5 Previously I also tried with a StreamableHttp sample but that also had similar issues
Expected behavior
Inspector is able to connect to the MCP server and tools will be listed in the UI.
Logs
If applicable, add logs to help explain your problem.
Additional context
- I have explicitly ran the spring_mcp-0.0.1-SNAPSHOT.jar and made sure that there is no issue with the jar.
- Java is spawned from a sample javascript to make sure that there is no issue in spawning java as a sub process.
- Executer permission has explicitly given to the
spring_mcp-0.0.1-SNAPSHOT.jar
- Java version that is used 17.0.15+6-LTS an d Mac OS sequoia 15.5
Therefore, at this point I am exhausted all options to debug the issue. I feel that I am missing something very basic but I could not figure out what is it. Therefore, can some one please shed some light to fix the issue. Happy to provide any other relevant info if it's needed.