Weather MCP Server
by Leonwjj
README.md
# MCP Server Collections
A [Model Context Protocol](https://modelcontextprotocol.io/) server that provides weather query capabilities using the free [Open-Meteo](https://open-meteo.com/) API ā no API key required.
## Features
- **`get_weather` tool** ā Query current weather by city name or latitude/longitude coordinates
- **`weather://current/{lat}/{lon}` resource** ā Access weather data as a resource URI
- **Zero-config** ā Uses Open-Meteo's free API, no API key or account needed
## Installation
```bash
git clone <repo-url> mcps
cd mcps
npm install
npm run build
```
## Usage
### Running the server
```bash
npm run dev # Development mode (tsx, no build step)
npm start # Production mode (requires npm run build first)
```
### MCP Client Configuration
Add to your MCP client configuration (e.g., Claude Code's `mcpServers`):
```json
{
"mcpServers": {
"weather": {
"command": "node",
"args": ["/path/to/mcps/dist/weather/index.js"]
}
}
}
```
Or using the dev script:
```json
{
"mcpServers": {
"weather": {
"command": "npx",
"args": ["tsx", "/path/to/mcps/src/weather-mcp/index.ts"]
}
}
}
```
## Available Tool
### `get_weather`
Get current weather conditions for a location.
**Parameters** (provide either a city name OR coordinates):
| Parameter | Type | Description |
|-----------|------|-------------|
| `location` | string (optional) | City name, e.g. `"Berlin"`, `"Tokyo"`, `"San Francisco"` |
| `latitude` | number (optional) | Latitude coordinate, e.g. `52.52` |
| `longitude` | number (optional) | Longitude coordinate, e.g. `13.41` |
**Example responses:**
```
š¤ Weather for Berlin, Germany
āāāāāāāāāāāāāāāāāāāāāāāāā
š” Temperature: 22.1°C (feels like 21.5°C)
š§ Humidity: 54%
šØ Wind: 12.3 km/h WSW (248°)
ā Conditions: Partly cloudy
```
## Available Resource
### `weather://current/{lat}/{lon}`
Returns current weather as a JSON resource for the given coordinates.
## API
This server uses [Open-Meteo](https://open-meteo.com/), a free and open-source weather API. No API key is required. The free tier allows up to 10,000 requests per day.
## HOW to test
### npm run inspector -- node dist/browser-console/index.js
## License
ISC
This server cannot be deployed
Maintenance
ActivityStale
ResponsivenessNo issues