Get the FREE Ultimate OpenClaw Setup Guide →

spring-boot -example

MCP server from sohamkamani/spring-boot-mcp-server-example

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio sohamkamani-spring-boot-mcp-server-example mvn spring-boot:run

How to use

This Java MCP server example runs a Spring Boot application that implements the Model Context Protocol (MCP). The repository provides a basic shopping list scenario to demonstrate MCP interactions over STDIO. Once started, the server waits for an MCP client to connect via standard input/output streams and processes MCP messages according to the protocol’s model context operations. Use this to test client implementations or to learn how a Java-based MCP server handles model context requests and updates in a simple data domain (shopping list).

To use it, navigate to the project root and start the server using the recommended run command. The application logs will indicate startup status and readiness to accept MCP client connections. You can then connect an MCP client (for example, a weather or shopping list client) via STDIO and exercise typical MCP operations such as creating, updating, and querying model contexts and context models implemented by the server.

How to install

Prerequisites:

  • JDK 8+ (preferably JDK 11+ for Spring Boot compatibility)
  • Maven (or use the Maven wrapper provided by the project)
  • Git

Steps:

  1. Clone the repository: git clone https://github.com/your-org/sohamkamani-spring-boot-mcp-server-example.git
  2. Change into the project directory: cd sohamkamani-spring-boot-mcp-server-example
  3. If you have the Maven wrapper (mvnw) included, you can use it directly. Alternatively, ensure Maven is installed.
  4. Build and run the Spring Boot application: ./mvnw spring-boot:run

    or if not using the wrapper:

    mvn spring-boot:run
  5. Monitor the console output for startup logs. When you see the server is running, it is waiting for MCP clients to connect via STDIO.

Additional notes

Notes and tips:

  • The server uses STDIO for MCP communication. Ensure your MCP client is configured to connect via standard input/output streams.
  • If you modify application.properties to reduce console verbosity, startup logs may be minimal, but the server should still indicate readiness.
  • The repository mentions a weather MCP server example in model-context-protocol/weather/starter-stdio-server, which may provide a separate reference for client interactions.
  • If you encounter porting or dependency issues, ensure you’re using a compatible Java version with the Spring Boot version used by the example.

Related MCP Servers

Sponsor this space

Reach thousands of developers