Skip to main content
Glama
Cdalwadi

MCP Weather Server

by Cdalwadi

MCP Weather Server

A lightweight, self‑hosted Model Context Protocol (MCP) server that exposes your weather‑forecast API as MCP tools.
This allows LLMs and agent frameworks to call your weather data directly through a standardized interface.

Clients run this server inside their own environment and connect it to their preferred MCP‑compatible LLM (e.g., Claude Desktop, Cursor, etc.).


🚀 Features

  • MCP‑compatible WebSocket server

  • Tools for:

    • Current weather by latitude/longitude

    • Multi‑day forecast

  • JSON Schema–validated tool inputs

  • Simple configuration via environment variables

  • No external dependencies required to run the server (beyond Node.js)

  • Ready for Docker, CI, and cloud deployment


Related MCP server: Weather MCP Server

🛠️ Requirements

  • Node.js 20+

  • A valid API key for your weather service

  • Access to your weather API base URL


⚙️ Configuration

Copy the example environment file:

bash cp .env.example .env

Then edit `.env`:

WEATHER_API_KEY=your_api_key_here WEATHER_API_URL=https://api.yourweather.com PORT=3001 LOG_LEVEL=info


▶️ Running the Server

Development mode

bash npm run dev

Build & run

bash npm run build npm start

The server will start on: ws://localhost:3001


🌤️ Available MCP Tools

`getCurrentWeather`

Retrieve current weather conditions for a specific latitude/longitude.

Input:

json { "lat": 38.9, "lon": -77.0 }

Output (example):

json { "summary": "Current weather at (38.9, -77)", "data": { ... } }


`getForecast`

Retrieve a multi‑day forecast for a location.

Input:

json { "lat": 38.9, "lon": -77.0, "days": 5 }

Output (example):

json { "summary": "5‑day forecast for (38.9, -77)", "data": { ... } }


🧪 Testing

bash npm test


🐳 Docker (Optional)

A Dockerfile is included.

Build: bash docker build -t mcp-weather-server .

Run: bash docker run -p 3001:3001 -e WEATHER_API_KEY=your_api_key -e WEATHER_API_URL=https://api.yourweather.com mcp-weather-server


🔒 Security Notes

  • Host this server inside your network or VPC

  • Protect access with firewall rules or mTLS if exposing externally

  • Rotate API keys regularly

  • Avoid exposing your weather API key in logs or client‑side code


📄 License

MIT License.
Feel free to fork, modify, and integrate into your own systems.


🤝 Contributing

Pull requests and issues are welcome.
If you extend the toolset or add new weather endpoints, feel free to contribute back.

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • -
    license
    -
    quality
    -
    maintenance
    Provides weather forecast data from the US National Weather Service API through MCP tools. Enables users to get detailed weather forecasts by ZIP code or coordinates using natural language queries.
    Last updated
  • A
    license
    -
    quality
    D
    maintenance
    Provides weather data from OpenWeatherMap API through MCP tools and a REST API with OpenAPI support. Enables LLM agents to retrieve current weather, forecasts, and temperature ranges by city or coordinates.
    Last updated
    29
    MIT
  • A
    license
    -
    quality
    C
    maintenance
    Provides weather data from WeatherAPI.com through MCP, enabling AI agents to query current conditions and forecasts via natural language.
    Last updated
    6
    MIT

View all related MCP servers

Related MCP Connectors

  • OpenWeather MCP — wraps the OpenWeatherMap API (openweathermap.org)

  • Open-Meteo MCP — weather forecast + historical reanalysis + sister APIs

  • WeatherAPI.com MCP — wraps WeatherAPI.com (api.weatherapi.com)

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Cdalwadi/MCPServer_AgenticApp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server