A simple weather MCP server implementation in Java
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"mcp-weather-server": {
"args": [
"-Dspring.ai.mcp.server.stdio=true",
"-jar",
"/absolute/path/to/weather-mcp-server-0.0.1-SNAPSHOT.jar"
],
"command": "java"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A simple Model Context Protocol (MCP) server that provides weather information for any location.
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in maps
A Model Context Protocol (MCP) server providing TomTom's location services, search, routing, and traffic data to AI agents.
Real-time BART departures, trip planning, fares, stations, and advisories.
MCP server for the VesselAPI — maritime vessel tracking, port events, emissions, and navigation data
Fair meeting point discovery for AI agents with isochrone-based travel time fairness
MCP Security Weekly
Get CVE alerts and security updates for Weather Mcp Server Java and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A simple Model Context Protocol (MCP) server that provides weather information for any location.
Accompanying blog post: Building a simple MCP Server in Java.
The Model Context Protocol (MCP) is a standardized way for AI applications and agents to connect with data sources and tools. It allows AI models like Claude to interact with your local system, external services, and custom tools through a standardized interface.
This project relies on the following key components:
<dependencies>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-mcp-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
</dependencies>
The server uses STDIO transport mode and is typically started automatically by the client.
The first step is to clone the project:
git clone https://github.com/chrischiedo/weather-mcp-server-java.git
cd weather-mcp-server-java
To build the server jar, use:
./mvnw clean install -DskipTests
This will create a jar file in the target directory.
To run tests, use:
./mvnw test
Execute the jar file to start the MCP server:
java -jar target/weather-mcp-server-0.0.1-SNAPSHOT.jar
To integrate the MCP server with Claude Desktop, add the following configuration to your Claude Desktop config settings:
{
"mcpServers": {
"mcp-weather-server": {
"command": "java",
"args": [
"-Dspring.ai.mcp.server.stdio=true",
"-jar",
"/absolute/path/to/weather-mcp-server-0.0.1-SNAPSHOT.jar"
]
}
}
}
Note: On MacOS, the config settings file can be opened using:
vi ~/Library/Application\ Support/Claude/claude_desktop_config.json
Note: Remember to replace /absolute/path/to/ with the actual path to your built jar file.
Once connected, you can ask Claude to use the weather tool:
Note: The prompts above were issued on 4th May 2025.
This server implements the Model Context Protocol to provide a tool that fetches weather data from the wttr.in API. When Claude or another MCP client connects to this server, they can use the getWeatherDetailsByLocation tool to retrieve current weather conditions for any location.
You can extend this server by: