Get the FREE Ultimate OpenClaw Setup Guide →

Spring-Boot-Sample

MCP server from tobiassteidle/Spring-Boot-Sample-MCP-Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio tobiassteidle-spring-boot-sample-mcp-server java -jar sample-mcp-server-0.0.1-SNAPSHOT.jar --port 8080 --host localhost \
  --env JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"

How to use

This MCP server is a Spring Boot implementation that exposes a RESTful API for interacting with model context tools and data sources. It is designed to be tested and debugged with the MCP Inspector, and can be wired into AI assistants like Claude Desktop to demonstrate how external tools can be invoked via MCP. The server runs as a standard Spring Boot application and demonstrates a minimal, extensible approach to exposing tools through annotated endpoints. You can use the REST API to query, execute actions, and retrieve context data that the AI model should access during a session.

How to install

Prerequisites:

  • Java 17 or higher
  • Maven
  • Optional: MCP Inspector for testing
  1. Install Java JDK 17+ and Maven on your system.
  2. Build the MCP server from source: mvn clean package
  3. Run the built artifact (example): java -jar target/sample-mcp-server-0.0.1-SNAPSHOT.jar --port 8080 --host localhost
  4. (Optional) Configure debugging with an IDE by enabling remote debugging (as shown in the README) and attaching to port 5005 using JAVA_TOOL_OPTIONS if needed.
  5. If you want to test with the MCP Inspector, install it and run the inspector with the appropriate command to connect to the running server.

Additional notes

Tips and notes:

  • Ensure the Java tool options for remote debugging are set if you need to attach a debugger (JAVA_TOOL_OPTIONS as shown in the example).
  • The server exposes a simple REST API; you can extend it by adding additional controllers or services following Spring Boot conventions.
  • When integrating with Claude Desktop or other MCP clients, use the provided port and host settings to register the MCP server in the client configuration.
  • If you change the server jar name or version, update the run command accordingly (sample-mcp-server-0.0.1-SNAPSHOT.jar).
  • The README mentions a Spring Boot-based extension of the MCP Java SDK; keep an eye on framework version compatibility if you upgrade Spring Boot or Java versions.

Related MCP Servers

Sponsor this space

Reach thousands of developers