Get the FREE Ultimate OpenClaw Setup Guide →

mcp_Server

Trying out new MCP server feature using spring boot

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio yash-a11y-mcp_server java -jar target/mcp_feature-0.0.1-SNAPSHOT.jar \
  --env JAVA_OPTS="Optional JVM options (e.g., -Xms512m -Xmx1g)"

How to use

This MCP server is the Spring Boot integration for the Model Context Protocol (MCP) that enables seamless interaction between a Spring-based application and the Goose AI Agent. The setup assumes you build a Spring Boot application that includes the MCP client integration and then run Goose to coordinate AI-assisted capabilities within your app ecosystem. The workflow typically involves building a JAR for your Spring Boot extension, launching it as an MCP-enabled service, and using Goose sessions to drive AI tasks or agent behaviors inside the running extension. The README guides you through building the JAR, installing Goose, and running a Goose session, which together enable you to leverage MCP for model-driven interactions within your Spring application.

How to install

Prerequisites:

  • Java Development Kit (JDK 17+ recommended; verify compatibility with your Spring Boot project)
  • Gradle (or the Gradle wrapper included in your project)
  • Goose AI Agent and its client tooling as documented by Goose
  • Basic familiarity with running Java JARs and Spring Boot projects

Installation steps:

  1. Ensure prerequisites are installed
  • JDK: confirm with
java -version
  • Gradle (or use the project wrapper):
./gradlew help
  • Goose: follow the official Goose docs to install and configure the AI Agent.
  1. Build the Spring Boot/MCP project
./gradlew clean build

The resulting JAR will typically be located under target/ (for example: target/mcp_feature-0.0.1-SNAPSHOT.jar).

  1. Run the MCP-enabled Spring Boot extension
# Example command if you expose the JAR directly
java -jar target/mcp_feature-0.0.1-SNAPSHOT.jar
  1. Install and start Goose sessions (as per Goose docs)
  • Follow Goose setup instructions to install the client.
  • Start a session and, if needed, pass in the extension JAR path or configuration so Goose can interact with MCP.
  1. Optional WSL considerations (as described in the README):
  • Create and use a run-extension.sh script to launch the JAR inside WSL, ensure Java is installed, and make the script executable before starting Goose with your extension.

Additional notes

Tips and common issues:

  • Ensure the JAR name in the run command matches the built artifact (target/mcp_feature-0.0.1-SNAPSHOT.jar in the example).
  • If you run into Java memory issues, adjust JVM options via JAVA_OPTS (e.g., -Xms512m -Xmx2g).
  • When using WSL, follow the steps to create a small launcher script (run-extension.sh) and make it executable before starting Goose sessions.
  • Goose integration relies on MCP primitives; ensure the Goose client is properly installed and reachable from the Spring application environment.
  • If your project uses a different artifact name or version, update the mcp_config accordingly.
  • The mcp_config assumes a Java-based MCP server; if you containerize the app, you can adapt to docker-based execution instead.

Related MCP Servers

Sponsor this space

Reach thousands of developers