Spring AI MCP Weather STDIO Server

Spring AI MCP Weather STDIO Server

my-mcp-stdio-server•bycloud4java

A Spring Boot sample implementing a Model Context Protocol server over STDIO that exposes weather forecast and alert tools using the National Weather Service API.

License: Not specified•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides a weather forecast tool that returns temperature, wind speed and direction, and a detailed forecast description for a latitude/longitude.
  • •Provides a weather alerts tool for a two-letter US state code, returning active alerts with event type, affected area, severity, description, and safety instructions.
  • •Uses STDIO transport and is typically started automatically by the client.
  • •Registers tools through Spring beans, merging multiple ToolCallback lists via auto-configuration.

BEST FOR

  • •Developers learning how to build an MCP server with the Spring AI MCP Server Boot Starter.
  • •Integrating weather lookups into an AI assistant such as Claude Desktop.
  • •Running a synchronous or asynchronous MCP server with configurable server type.

ABOUT MY-MCP-STDIO-SERVER

Spring AI MCP Weather STDIO Server is cataloged as an MCP server attributed to cloud4java. A Spring Boot sample implementing a Model Context Protocol server over STDIO that exposes weather forecast and alert tools using the National Weather Service API. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Spring AI MCP Weather STDIO Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What transport does this server use?

It uses STDIO transport mode and is typically started automatically by the client.

Does it support asynchronous operation?

Yes; the server type can be set to SYNC or ASYNC, with ASYNC using McpAsyncServer for non-blocking operations with Project Reactor support.

Upstream README

View this exact version on GitHub

README.md · 75f0bae24754 · Fetched 2026-11-13 12:14:40 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

Spring AI MCP Weather STDIO Server

A Spring Boot starter project demonstrating how to build a Model Context Protocol (MCP) server that provides weather-related tools using the National Weather Service (weather.gov) API. This project showcases the Spring AI MCP Server Boot Starter capabilities with STDIO transport implementation.

For more information, see the MCP Server Boot Starter reference documentation.

Prerequisites

  • Java 17 or later
  • Maven 3.6 or later
  • Understanding of Spring Boot and Spring AI concepts
  • (Optional) Claude Desktop for AI assistant integration

About Spring AI MCP Server Boot Starter

The spring-ai-mcp-server-spring-boot-starter provides:

  • Automatic configuration of MCP server components
  • Support for both synchronous and asynchronous operation modes
  • STDIO transport layer implementation
  • Flexible tool registration through Spring beans
  • Change notification capabilities

Project Structure

About Spring AI MCP Server Boot Starter

The spring-ai-mcp-server-spring-boot-starter provides:

  • Automatic configuration of MCP server components
  • Support for both synchronous and asynchronous operation modes
  • STDIO transport layer implementation
  • Flexible tool registration through Spring beans
  • Change notification capabilities

Project Structure

src/
├── main/
│   ├── java/
│   │   └── org/springframework/ai/mcp/sample/server/
│   │       ├── McpServerApplication.java    # Main application class with tool registration
│   │       └── WeatherService.java          # Weather service implementation with MCP tools
│   └── resources/
│       └── application.properties           # Server and transport configuration
└── test/
    └── java/
        └── org/springframework/ai/mcp/sample/client/
            └── ClientStdio.java             # Test client implementation

Building and Running

The server uses STDIO transport mode and is typically started automatically by the client. To build the server jar:

./mvnw clean install -DskipTests

Tool Implementation

The project demonstrates how to implement and register MCP tools using Spring's dependency injection and auto-configuration:

@Service
public class WeatherService {
    @Tool(description = "Get weather forecast for a specific latitude/longitude")
    public String getWeatherForecastBrazil(
        double latitude,   // Latitude coordinate
        double longitude   // Longitude coordinate
    ) {
        // Implementation
    }

    @Tool(description = "Get weather alerts for a US state")
    public String getAlerts(
        String state  // Two-letter US state code (e.g., CA, NY)
    ) {
        // Implementation
    }
}

@SpringBootApplication
public class McpServerApplication {
    @Bean
    public List<ToolCallback> weatherTools(WeatherService weatherService) {
        return ToolCallbacks.from(weatherService);
    }
}

The auto-configuration automatically registers these tools with the MCP server. You can have multiple beans producing lists of ToolCallbacks, and the auto-configuration will merge them.

Available Tools

1. Weather Forecast Tool

@Tool(description = "Get weather forecast for a specific latitude/longitude")
public String getWeatherForecastBrazil(
    double latitude,   // Latitude coordinate
    double longitude   // Longitude coordinate
) {
    // Returns detailed forecast including:
    // - Temperature and unit
    // - Wind speed and direction
    // - Detailed forecast description
}

// Example usage:
CallToolResult forecast = client.callTool(
    new CallToolRequest("getWeatherForecastBrazil",
        Map.of(
            "latitude", 47.6062,    // Seattle coordinates
            "longitude", -122.3321
        )
    )
);

2. Weather Alerts Tool

@Tool(description = "Get weather alerts for a US state")
public String getAlerts(
    String state  // Two-letter US state code (e.g., CA, NY)
) {
    // Returns active alerts including:
    // - Event type
    // - Affected area
    // - Severity
    // - Description
    // - Safety instructions
}

// Example usage:
CallToolResult alerts = client.callTool(
    new CallToolRequest("getAlerts",
        Map.of("state", "NY")
    )
);

Client Integration

Java Client Example

Create MCP Client Manually

// Create server parameters
ServerParameters stdioParams = ServerParameters.builder("java")
    .args("-Dspring.ai.mcp.server.transport=STDIO",
          "-Dspring.main.web-application-type=none",
          "-Dlogging.pattern.console=",
          "-jar",
          "target/my-mcp-stdio-server-0.0.1-SNAPSHOT.jar")
    .build();

// Initialize transport and client
var transport = new StdioClientTransport(stdioParams);
var client = McpClient.sync(transport).build();

The ClientStdio.java demonstrates how to implement an MCP client manually.

For a better development experience, consider using the MCP Client Boot Starters. These starters enable auto-configuration of multiple STDIO and/or SSE connections to MCP servers. See the starter-default-client and starter-webflux-client projects for examples.

Use MCP Client Boot Starter

Use the starter-default-client to connect to the weather starter-stdio-server:

  1. Follow the starter-default-client readme instructions to build a mcp-starter-default-client-0.0.1-SNAPSHOT.jar client application.

  2. Run the client using the configuration file:

java -Dspring.ai.mcp.client.stdio.connections.server1.command=java \
     -Dspring.ai.mcp.client.stdio.connections.server1.args=-jar,/Users/christiantzolov/Dev/projects/spring-ai-examples/model-context-protocol/weather/starter-stdio-server/target/my-mcp-stdio-server-0.0.1-SNAPSHOT.jar \
     -Dai.user.input='What is the weather in NY?' \
     -Dlogging.pattern.console= \
     -jar mcp-starter-default-client-0.0.1-SNAPSHOT.jar

Claude Desktop Integration

To integrate with Claude Desktop, add the following configuration to your Claude Desktop settings:

{
  "mcpServers": {
    "spring-ai-mcp-weather": {
      "command": "java",
      "args": [
        "-Dspring.ai.mcp.server.stdio=true",
        "-Dspring.main.web-application-type=none",
        "-Dlogging.pattern.console=",
        "-jar",
        "/absolute/path/to/my-mcp-stdio-server-0.0.1-SNAPSHOT.jar"
      ]
    }
  }
}

Replace /absolute/path/to/ with the actual path to your built jar file.

Configuration

Application Properties

All properties are prefixed with spring.ai.mcp.server:

# Required STDIO Configuration
spring.main.web-application-type=none
spring.main.banner-mode=off
logging.pattern.console=

# Server Configuration
spring.ai.mcp.server.enabled=true
spring.ai.mcp.server.name=my-weather-server
spring.ai.mcp.server.version=0.0.1
# SYNC or ASYNC
spring.ai.mcp.server.type=SYNC
spring.ai.mcp.server.resource-change-notification=true
spring.ai.mcp.server.tool-change-notification=true
spring.ai.mcp.server.prompt-change-notification=true

# Optional file logging
logging.file.name=my-mcp-stdio-server.log

Key Configuration Notes

  1. STDIO Mode Requirements

    • Disable web application type (spring.main.web-application-type=none)
    • Disable Spring banner (spring.main.banner-mode=off)
    • Clear console logging pattern (logging.pattern.console=)
  2. Server Type

    • SYNC (default): Uses McpSyncServer for straightforward request-response patterns
    • ASYNC: Uses McpAsyncServer for non-blocking operations with Project Reactor support

Additional Resources

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Spring AI MCP Weather STDIO Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/my-mcp-stdio-server)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools