i23098/mcp-server-java
If you are the rightful owner of mcp-server-java and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This document provides a structured summary of a simple Hello World MCP Server implemented in Java using the Model Context Protocol (MCP) SDK.
MCP Server - Hello World
Simple Hello World MCP Server done in Java, using https://github.com/modelcontextprotocol/java-sdk
Build
Execute:
./gradlew :build
This will generate build/libs/hello-world-mcp.war
Execute
Can be executed in Tomcat 11. Just copy build/libs/hello-world-mcp.war to the webapps folder.
MCP Client
To test the server, can use MCP inspector by executing:
./gradlew :runMCPInspector
It 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.