I follow the document to develop a MCP tool and set the server in local, And I can use it in Claude desktop. But when I use the MCP plus-in. But when I use it in n8n, it come up this error.
Make sure the MCP server is running and listening for connections.
netstat -anp | grep <porta>
Replace with the port used by the MCP server (usually configured in the Java code).
Make sure the port used by the MCP server is open for connections
sudo ufw allow <porta>
The correct value in the Arguments field should follow exactly:
-jar /MY_PC/Test/Java/Test/courses/target/courses-0.0.1-SNAPSHOT.jar
Make sure that:
The path to the JAR is correct.
It is accessible by the user running n8n.
The java -jar command works manually.
If the MCP server depends on environment variables (such as CLASSPATH, JAVA_HOME or others), they must be passed in the Environments field.
Format in n8n:
CLASSPATH=/example/path
JAVA_HOME=/MY_PC/programs/linux_jdk/Jdk-17.0.14+7
If this suggestion solved your problem, please mark my post as the solution (blue box with check mark) so that this ongoing discussion does not distract others who want to find the answer to the original question and click the heart. Thanks