mcp-hello-world
A Kotlin 'Hello World' example for the Model Context Protocol (MCP). This client-server demo uses STDIO for communication, where the client launches an MCP server to execute a simple 'greet' tool. Ideal for understanding MCP's fundamentals without complex LLM integrations.
claude mcp add --transport stdio rwachters-mcp-hello-world java -jar server/build/libs/mcp-hello-world-server.jar
How to use
This MCP server is a minimal Kotlin-based Hello World example that exposes a single tool named greet. The server runs as a Java JAR and communicates with an MCP client via standard I/O when launched by the client. The paired client discovers the available tools on the server (in this case, greet) and allows an interactive session where you provide tool arguments (for greet, the name) and receive a personalized greeting as the response. The flow demonstrates the core MCP client-server interaction: tool discovery, argument collection, remote execution, and result handling, all without external AI models.
To use it, first build both server and client JARs, then run the client and point it at the server JAR. The client will start the server as a subprocess, establish a communication channel over stdio, and present an interactive prompt. You can see the tool list, select greet, enter the name, and observe the response printed back from the server as Hello, <name>!. This setup is ideal for learning MCP concepts and testing simple tool-based interactions.
How to install
Prerequisites:
- Java 17 or later
- Gradle (optional if you use the Gradle wrapper)
Step-by-step installation:
-
Clone the repository git clone https://github.com/your-username/mcp-hello-world.git cd mcp-hello-world
-
Build the server and client fat JARs ./gradlew :server:jar ./gradlew :client:jar
-
Run the client (which will spawn the server as a subprocess) java -jar client/build/libs/mcp-hello-world-client.jar server/build/libs/mcp-hello-world-server.jar
Notes:
- The server JAR is produced at server/build/libs/mcp-hello-world-server.jar
- The client JAR is produced at client/build/libs/mcp-hello-world-client.jar
- Ensure you run each command from the project root or adjust paths accordingly.
Additional notes
Tips and common issues:
- Fat JARs: Ensure you build the fat JARs (server and client) so runtime dependencies are bundled. This prevents NoClassDefFoundError at runtime.
- Duplicate entries in jars: If you see Duplicate entry errors during build, verify the jar task excludes META-INF and module-info.class as described in the project notes.
- Connectivity: If the client cannot connect, verify the server JAR path provided to the client is correct and that the server process starts without permission issues.
- Logging: If you see SLF4J warnings, you can add a SLF4J binding dependency (e.g., slf4j-simple) to silence the warning; it does not affect functionality.
- Extending: To add more tools, implement additional Tool definitions in the server and expose them through the MCP Kotlin SDK, then re-build the jars.
Related MCP Servers
modex
Modex is a Clojure MCP Library to augment your AI models with Tools, Resources & Prompts using Clojure (Model Context Protocol). Implements MCP Server & Client.
boilerplate
TypeScript Model Context Protocol (MCP) server boilerplate providing IP lookup tools/resources. Includes CLI support and extensible structure for connecting AI systems (LLMs) to external data sources like ip-api.com. Ideal template for creating new MCP integrations via Node.js.
adbfriend
Android ADB CLI tool including integrated MCP Server with common adb actions used during development
evernote
Evernote MCP server - allows LLMs that support MCP (like Claude Desktop) to query your notes in Evernote
MCP-Client -Project-using-NodeJS
A minimal Model Context Protocol (MCP) implementation built with Node.js and TypeScript. This project demonstrates client–server communication over stdio, structured message handling, and local data access, developed with VS Code and GitHub Copilot to explore modern AI tool integration workflows.
paylink
A payment framework that helps developers easily integrate payments into their AI agents and apps.