Simple Hello World MCP Server done in Java, using https://github.com/modelcontextprotocol/java-sdk
Execute:
./gradlew :buildThis will generate build/libs/hello-world-mcp.war
Can be executed in Tomcat 11. Just copy build/libs/hello-world-mcp.war to the webapps folder.
To test the server, can use MCP inspector by executing:
./gradlew :runMCPInspectorIt will open in the browser and should be configured using:
- Transport Type: Streamable HTTP
- URL: http://localhost:8080/hello-world-mcp/mcp
- Connection Type: Via Proxy
Click Connect button.
Click List Tools button. Click on the hello_world tool that is listed.
Click Run Tool button. Should have a success tool result with a "Hello World!" response.