Get the FREE Ultimate OpenClaw Setup Guide →

mcp -java-clima

MCP server from caiocf/mcp-server-java-clima

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio caiocf-mcp-server-java-clima java -jar target/mcpweather-0.0.1-SNAPSHOT.jar \
  --env JAVA_HOME="path/to/java/home (optional, depends on system)"

How to use

This MCP server provides weather/climate tools exposed via the MCP protocol over HTTP (default) and supports compatible streaming transports for clients like ChatGPT through MCP. It exposes tools such as search and fetch for discovery, and concrete weather tools like getWeatherForecastByLocation(lat, lon) for detailed forecasts (source: weather.gov) and getAlerts(uf) for weather alerts by US state. Clients can initialize a connection using MCP handshake, then list available tools and call them by name with appropriate arguments. The server operates at http://localhost:8080/mcp by default (and equivalent streaming endpoints for SSE/Streamable HTTP depending on the transport in use). Use the provided examples in the README to interact with the server and validate responses.

To use the tools, first initialize the MCP session, then request the list of tools, and finally invoke a tool such as getWeatherForecastByLocation with latitude and longitude. For example, you can fetch a forecast for Seattle by calling the tool with latitude 47.6062 and longitude -122.3321. You can also query alerts by state, e.g., NY, CA, to obtain weather warnings and advisories. The server supports both HTTP+SSE (Spring AI 1.0.2) and Streamable HTTP (Spring AI 1.1.x) transports, so choose the transport compatible with your client and follow the corresponding request format from the examples.

How to install

Prerequisites:

  • Java 17+ installed on your machine
  • Maven 3.9+ (wrapper available as mvnw in the repo)
  • Internet access to fetch dependencies (Open-Meteo reference data is accessed at runtime)

Steps:

  1. Clone the repository (replace placeholders with your GitHub info): git clone https://github.com/<SEU_USUARIO>/<SEU_REPO>.git
  2. Navigate to the repository: cd <SEU_REPO>
  3. Build the project (use Maven Wrapper if available): ./mvnw package -DskipTests
  4. Run the generated JAR (as configured in mcp_config): java -jar target/mcpweather-0.0.1-SNAPSHOT.jar
  5. Verify the server is listening (default): http://localhost:8080/mcp

If you prefer Docker or another runtime, package and run the same JAR inside your environment following your chosen method.

Additional notes

Tips and caveats:

  • The MCP endpoints can be exposed via HTTPS with a public domain (recommended for ChatGPT integration) or via tunnels (ngrok, Cloudflare Tunnel) as described in the README.
  • When using ngrok, configure a public URL and point the MCP transport to the appropriate endpoint (e.g., /sse or /mcp).
  • Ensure Java 17+ is correctly installed and JAVA_HOME is set if needed by your environment.
  • The included examples show how to initialize the session, list tools, and call getWeatherForecastByLocation. If you modify tool names or arguments, keep to the MCP parameter structure (JSON-RPC style).
  • For production, secure the endpoint and consider authentication/authorization on the MCP entry point.

Related MCP Servers

Sponsor this space

Reach thousands of developers