Get the FREE Ultimate OpenClaw Setup Guide →

mcp -spring-java

MCP Server using Spring Boot Java

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mtwn105-mcp-server-spring-java java -Dspring.ai.mcp.server.stdio=true -Dspring.main.web-application-type=none -Dlogging.pattern.console= -jar target/mcp-spring-java-0.0.1-SNAPSHOT.jar

How to use

This MCP server provides a Spring Boot-based implementation of a Model Context Protocol (MCP) server focused on user management. It exposes a set of tools such as getAllUsers, getAllUsersDefault, getUserById, searchUsers, addUser, updateUser, and deleteUser via MCP tool calls. The server operates in synchronous mode and supports Standard I/O and Server-Sent Events transports, allowing both terminal and streaming interactions. To interact with it, you can send JSON toolCall payloads to the /mcp/message endpoint, instructing the server to invoke the desired tool with appropriate parameters. The server is configured to fetch or manage user data via a DummyJSON external API, enabling realistic responses for development and testing.

How to install

Prerequisites:

  • Java 21 or higher
  • Maven

Installation steps:

  1. Clone the repository: git clone https://github.com/yourusername/mcp-spring-java.git cd mcp-spring-java

  2. Build the project with Maven: mvn clean package

  3. Run the application: java -jar target/mcp-spring-java-0.0.1-SNAPSHOT.jar

  4. Verify the server is running:

Additional notes

Tips and notes:

  • The server is configured for port 8090 and exposes the /mcp/message endpoint for MCP interactions.
  • If you need to change the transport (e.g., enable SSE or STDIO), adjust the application.yml and startup arguments accordingly.
  • Ensure Java 21 is installed and JAVA_HOME is set.
  • For MCP client usage, you can configure the client to run the Java command with the specified system properties and jar path as shown in the configuration example.
  • If you encounter issues with the external API (DummyJSON), check network access and consider configuring a mock API during development.

Related MCP Servers

Sponsor this space

Reach thousands of developers