accuweather-mcp
Provides tools for retrieving AccuWeather weather data, enabling lookups of current conditions and forecasts for locations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@accuweather-mcpwhat's the current weather in London?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
accuweather-mcp
Setup
Define the following environment variables in your system
export ACCUWEATHER_API_KEY=replace-with-your-api-keyDefine a
application-local.yamlinsrc/main/resources/application.yamlwith the following content:
logging:
console:
enabled: trueIf using Cursor, add the following documentation sources:
[Wiremock documentation][https://wiremock.org/docs/]
[Lombok documentation][https://projectlombok.org/features/]
Related MCP server: mcp-weather-server
Run
Run with
SPRING_PROFILES_ACTIVE=local ./gradlew bootRun
Testing
Note: If you enable the Java debugger, it will produce output to standard out which will trigger errors in the stdio MCP protocol.
Unit and integration testing
Unit and integration tests use mockito and wiremock. To run the tests, use:
./gradlew buildMutation testing
This project uses PIT mutation testing via the gradle-pitest-plugin to verify that tests detect injected faults, complementing JaCoCo line coverage.
./gradlew pitest— run mutation tests overcom.jonjam.accuweathermcp.*(excluding DTOs and the bootstrap class).Open
build/reports/pitest/index.htmlto review results. Surviving mutants indicate code that is executed by tests but where a fault would not be caught.
MCP Inspector
To test with MCP Inspector, run the following from the root of the repo:
npx @modelcontextprotocol/inspector -e 'JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005' java -jar "build/libs/accuweather-mcp-local-snapshot.jar"This was sourced from this blog.
AI chat (Claude, Cursor)
Add this configuration to the MCP settings:
{
"mcpServers": {
"accuweather-mcp": {
"command": "PATH_TO_JAVA",
"args": ["-jar", "ABSOLUTE_PATH_TO_REPO/build/libs/accuweather-mcp-local-snapshot.jar"],
"env": {
"ACCUWEATHER_API_KEY": "API_KEY"
}
}
}
}If you are using SDKMAN, command should be ~/.sdkman/candidates/java/current/bin/java
This was sourced from the MCP docs.
Example user prompt:
Use the accuweather-mcp to look up the current weather in Manchester, UK.Docker
This project uses the Jib Gradle plugin to build a Docker image.
Build and load the image into your local Docker daemon:
./gradlew jibDockerBuildThe default image name is jonjam/accuweather-mcp.
To use the docker image with MCP Inspector, the command looks as follows:
npx @modelcontextprotocol/inspector docker run --rm -i --env "ACCUWEATHER_API_KEY=$ACCUWEATHER_API_KEY" jonjam/accuweather-mcp:latestPatterns and practies
More information about patterns and practises for this project can be found in AGENTS.md.
Git
This project uses semantic-release to automate versioning, changelog generation, and publishing.
Important: Commit messages that are intended to trigger a release must be prefixed according to the Conventional Commits standard. For example:
feat: add new forecast endpointfix: correct hourly forecast time calculation
Spotless
This project uses the Spotless Gradle plugin to enforce a consistent Java style.
./gradlew spotlessApply— format sources and fix style issues../gradlew spotlessCheck— verify formatting without changing files.
Checkstyle
Static analysis and broader code-quality checks are handled by Checkstyle using a Google-style-based configuration (with formatting delegated to Spotless):
./gradlew checkstyleMain— run Checkstyle over main sources../gradlew checkstyleTest— run Checkstyle over test sources.
MCP
Tools Ensure to handle errors (i.e. validation) according to the specification
MCP Registry
This server is published to the MCP Registry.
When using an MCP client that supports the registry (e.g. Cursor, Claude Desktop), you can add io.github.jonjam/accuweather-mcp from the registry and configure your AccuWeather API key as the ACCUWEATHER_API_KEY environment variable.
Future improvements
Improve error handling in gateway classes based upon AccuWeather status codes
Add in-memory caching for AccuWeather API calls that caches data according to expires header
Add ability to specify desired metric (i.e. Celsius or Fahrenheit) in Tools
End to end integration tests based on Spring AI Examples
This server cannot be deployed
Maintenance
Related MCP Connectors
OpenWeather MCP — wraps the OpenWeatherMap API (openweathermap.org)
WeatherAPI.com MCP — wraps WeatherAPI.com (api.weatherapi.com)
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
Weather MCP — wraps Open-Meteo API (free, no auth)
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProvides weather data from WeatherAPI.com through MCP, enabling AI agents to query current conditions and forecasts via natural language.178 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables MCP clients like Kiro and Claude to access current weather conditions and forecasts for any location using the OpenWeatherMap API.-
- AlicenseNot gradedqualityDmaintenanceIntegrates OpenWeatherMap API with MCP to provide weather data, forecasts, air quality, maps, alerts, and geocoding via natural language.40 npmMIT
- AlicenseNot gradedqualityCmaintenanceProvides weather data including current conditions, forecasts, and summaries via Open-Meteo with no API key required, enabling natural language queries through an MCP interface.MIT