mcpField
M
MCP Sample Java Application

MCP Sample Java Application

Local
github.com/Saularch97Developer Tools1Updated 77w ago

About MCP Sample Java Application

A minimal Spring Boot application that implements an MCP server with Spring AI. It is intended for developers who need an external Java server to connect to MCP clients.

Key features

  1. 01Spring Boot-based MCP server
  2. 02Spring AI integration
  3. 03Maven packaging
  4. 04Java 21 requirement

Use cases

  1. 01Running an external MCP server for a client
  2. 02Building a Java MCP server sample

MCP support

Implements an MCP server using Spring AI's server WebMVC starter. It is configured to run as an external server for MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP Sample Java Application

This is a minimal Spring Boot application implementing an MCP (Model Controller Provider) server using Spring AI.
It is designed to be used as an external MCP server for client applications.


🚀 Getting Started

1. Clone the Project
    git clone [email protected]:Saularch97/mcp-java-sample.git
    cd openmeteomcp
2. Build the Project
  mvn clean package

The output will be located at target/openmeteomcp-0.0.1-SNAPSHOT.jar

⚙️ Client Configuration

To run the server from your client, insert the following configuration:

{
  "mcpServers": {
    "mcpopenmeteo": {
      "command": "java",
      "args": [
        "-jar",
        "<PATH_TO_YOUR_PROJECT>/openmeteomcp/target/openmeteomcp-0.0.1-SNAPSHOT.jar",
        "--port",
        "8080",
        "--host",
        "localhost"
      ]
    }
  }
}

Replace <PATH_TO_YOUR_PROJECT> with the actual path to your project directory.

📦 Project Dependencies

The project depends on the following Spring AI starter module:

<dependencies>
    <dependency>
        <groupId>org.springframework.ai</groupId>
        <artifactId>spring-ai-starter-mcp-server-webmvc</artifactId>
    </dependency>
</dependencies>

🧰 Requirements

  • Java 21
  • Maven 3.8+

To use the project just connect with an client, Cursor, ClaudeDesktop, Vscode etc.

img.png

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.