Skip to content

Could not connect to an Spring boot MCP server with STDIO #704

@deleSerna

Description

@deleSerna

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:

  1. Build the spring boot sample
  2. Start the inspector using either npx @modelcontextprotocol/inspector -- 'java -jar replace-with-full-path/spring_mcp-0.0.1-SNAPSHOT.jar' or npx @modelcontextprotocol/inspector and in the UI fill java as command and provide ["-jar" " replace-with-full-path//spring_mcp-0.0.1-SNAPSHOT.jar"]as the argument. 3 SelectSTDIO` 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions