Add your description here
Project description
天气MCP SERVER
安装uv
curl -LsSf https://astral.sh/uv/install.sh | sh
重启命令行生效
创建并设置项目
# Create a new directory for our project
uv init weather-didi
cd weather-didi
# Create virtual environment and activate it
uv venv
source .venv/bin/activate
# Install dependencies
uv add "mcp[cli]" httpx
# Create our server file
touch weather.py
Cherry Studio MCP CONFIG
- 选择stdio,配置命令 uv --directory /ABSOLUTE/PATH/TO/PARENT/FOLDER/weather-didi run weather.py
提问
What’s the weather in Sacramento? What are the active weather alerts in Texas?
打包发布pypi共享
此方法只能使用stdio方式。
- 修改pyproject.toml, 添加版本、依赖、构建配置
- uv build构建生成dist目录
dist/目录下生成两个文件:
.whl 文件(构建分发版)
.tar.gz 文件(源代码分发版)
- uv push发布
# 发布测试
uv publish --token 你的PyPI令牌
uv add -i https://test.pypi.org/simple/ --no-deps 你的包名
uvx 包名(自动创建虚拟环境,适合单次运行)
# 发布生产
uv publish --token 你的PyPI令牌
uv add 你的包名
uvx 包名(自动创建虚拟环境,适合单次运行)
切换协议
weather.py:main方法:stdio->sse
mcp.settings.host = '0.0.0.0'
mcp.settings.port = 8000
mcp.run(transport='sse')
并启动,获取服务器地址:http://{IP}:{PORT}/sse
Cherry Studio配置:
- 选择sse,配置mcp server服务器地址: http://{IP}:{PORT}/sse
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
weather_didi-0.1.3.tar.gz
(18.4 kB
view details)
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_didi-0.1.3.tar.gz.
File metadata
- Download URL: weather_didi-0.1.3.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0322dfdbdab6b9fdd2108cb700cd902dbf9e387efbaf32d080fd6edcdfe24165
|
|
| MD5 |
e921d8b168bc04fd2d7c4171cb98c413
|
|
| BLAKE2b-256 |
456edeea06dd1e7e07113cd5c0bb0b2aa7af7966bd8d0783d0e32ac0f4166f3b
|
File details
Details for the file weather_didi-0.1.3-py3-none-any.whl.
File metadata
- Download URL: weather_didi-0.1.3-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bafa1e77d5224d32ad024e22ada10026fdddfff8f1cce1fb123dc90f56cdd79c
|
|
| MD5 |
b340d1bd98aa0220b44a0c811808cf53
|
|
| BLAKE2b-256 |
0c04f999abd19e9296b8f46d4c1a0d3ff6755f33f5a2ceed0c92d71cd9eae20a
|