一个基于 FastMCP 的天气查询服务
Project description
Weather MCP Tool
A minimalist weather query tool that lets you check global weather with just one sentence, perfectly integrated with Cursor editor.
Watch how easy it is to query weather with natural language
✨ Features
- 💡 Minimalist: One-line weather query
- 🤖 Smart: Natural language support in Chinese/English
- 🌏 Global: Support for all major cities
- 🔌 Plug & Play: Perfect Cursor integration
- 🚀 High Performance: Async processing, quick response
- 🎨 Beautiful: Clear and intuitive weather display
🚀 Quick Start
1. Get API Key
🔑 Before starting, please Get OpenWeather API Key
2. One-Click Installation (Recommended)
Install and configure with Smithery in one command:
npx -y @smithery/cli@latest install @MrCare/mcp_tool --client cursor --config "{\"openweathermapApiKey\":\"your_api_key_here\",\"port\":8000}"
For WindSurf and Cine installation, please visit our Smithery repository.
3. Manual Installation
3.1 Clone and Install
git clone https://github.com/yourusername/weather-server.git && cd weather-server && pip install -e .
3.2 Configure API Key
Method 1: Using Configuration File (Recommended)
Copy the example configuration file and modify it:
cp env.example .env
Then edit the .env file, replace your_api_key_here with your API Key.
Method 2: Using Environment Variables
macOS/Linux:
export OPENWEATHERMAP_API_KEY="your_api_key"
Windows:
set OPENWEATHERMAP_API_KEY=your_api_key
3.3 Enable Tool
Edit ~/.cursor/mcp.json (Windows: %USERPROFILE%\.cursor\mcp.json):
{
"weather_fastmcp": {
"command": "python",
"args": ["-m", "weather_server.server"]
}
}
Restart Cursor and you're ready to go!
📝 Usage Examples
Simply type in Cursor:
Show me the weather in Tokyo
What's the forecast for London?
How's the weather in New York?
Will it rain tomorrow in Paris?
That's it!
⚙️ Parameters
For more precise queries, you can specify these parameters:
| Parameter | Description | Default |
|---|---|---|
| city | City name (Chinese/English) | Required |
| days | Forecast days (1-5) | 5 |
| units | Temperature unit (metric: Celsius, imperial: Fahrenheit) | metric |
| lang | Response language (zh_cn: Chinese, en: English) | zh_cn |
❓ FAQ
-
Not Working?
- Ensure API Key is set correctly
- Restart Cursor
- Check Python environment
-
City Not Found?
- Try using English name
- Check spelling
- Use complete city name
👨💻 Author
- Mr.Car
- Email: 534192336car@gmail.com
🙏 Acknowledgments
📄 License
This project is licensed under the MIT License - see the LICENSE file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file weather_server1-1.0.0.tar.gz.
File metadata
- Download URL: weather_server1-1.0.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94acec98cdbbef8c69efb7b19f40eddd593b0bd8602e96f718b76cfd685c70cb
|
|
| MD5 |
9d246507082e21bce390a020cc433604
|
|
| BLAKE2b-256 |
8cae274da2098a820f8aa2b0997ae337f14178dfa83a2b0d28e09df0ba9767dd
|
File details
Details for the file weather_server1-1.0.0-py3-none-any.whl.
File metadata
- Download URL: weather_server1-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
021ded1499426e375ff008f7705517672d8ecd37b57c830d8e89429e49b8c9d7
|
|
| MD5 |
11c531d5ba7bc425c649b1f8bfe28c02
|
|
| BLAKE2b-256 |
c93ba735b6ef216c0d3e297ff8fe3226dae4929cdf8b48c15aafe20a79d4b1a2
|