Content
# Weather MCP Server
A Model Context Protocol server that provides weather forecasts and city information query functionalities. This server allows LLMs to obtain weather information for the next 24 hours and supports querying city information by city name, latitude and longitude, etc.
### Available Tools
- `get_24h_weather` - Get the weather forecast for the next 24 hours.
- Required parameters:
- `location` (string): City name or latitude and longitude (e.g., Beijing or 116.41,39.92)
## Installation
### Using uv (Recommended)
No specific installation is required when using [`uv`](https://docs.astral.sh/uv/). We will run *mcp-server-weather* directly using [`uvx`](https://docs.astral.sh/uv/guides/tools/).
### Using PIP
Alternatively, you can install `mcp-server-weather` via pip:
```bash
pip install mcp-server-weather
```
After installation, you can run it as a script using the following command:
```bash
python -m mcp_server_weather
```
## Configuration
### Configuring Claude.app
Add the following in Claude settings:
<details>
<summary>Using uvx</summary>
```json
"mcpServers": {
"weather": {
"command": "uvx",
"args": ["mcp-server-weather"]
}
}
```
</details>
<details>
<summary>Using docker</summary>
```json
"mcpServers": {
"weather": {
"command": "docker",
"args": ["run", "-i", "--rm", "mcp/weather"]
}
}
```
</details>
<details>
<summary>Using pip installation</summary>
```json
"mcpServers": {
"weather": {
"command": "python",
"args": ["-m", "mcp_server_weather"]
}
}
```
</details>
### Configuring Zed
Add the following in Zed's settings.json:
<details>
<summary>Using uvx</summary>
```json
"context_servers": [
"mcp-server-weather": {
"command": "uvx",
"args": ["mcp-server-weather"]
}
],
```
</details>
<details>
<summary>Using pip installation</summary>
```json
"context_servers": {
"mcp-server-weather": {
"command": "python",
"args": ["-m", "mcp_server_weather"]
}
},
```
</details>
## Example Interaction
1. Get the weather for the next 24 hours:
```json
{
"name": "get_24h_weather",
"arguments": {
"location": "Guangzhou Tianhe"
}
}
```
Response:
```json
{
"location": "Guangzhou Tianhe",
"forecast": "Weather information for the next 24 hours..."
}
```
## Debugging
You can use the MCP inspector to debug the server. For uvx installation:
```bash
npx @modelcontextprotocol/inspector uvx mcp-server-weather
```
Or if you have installed the package in a specific directory or are developing:
```bash
cd path/to/servers/src/weather
npx @modelcontextprotocol/inspector uv run mcp-server-weather
```
## Build
Docker build:
```bash
docker build -t mcp/weather .
```
## Contribution
We encourage contributions to mcp-server-weather to help expand and improve its functionalities. Whether it's adding new weather-related tools, enhancing existing features, or improving documentation, your input is valuable.
For examples of other MCP servers and implementation patterns, please see:
https://github.com/modelcontextprotocol/servers
Feel free to submit pull requests! Contribute new ideas, bug fixes, or enhancements to make mcp-server-weather even more powerful and useful.
## License
mcp-server-weather is licensed under the MIT License. This means you can freely use, modify, and distribute the software, but you must comply with the terms and conditions of the MIT License. For more details, please refer to the LICENSE file in the project repository.
Connection Info
You Might Also Like
markitdown
Python tool for converting files and office documents to Markdown.
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
Sequential Thinking
A structured MCP server for dynamic problem-solving and reflective thinking.
Fetch
Retrieve and process content from web pages by converting HTML into markdown format.
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.