Skip to main content

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

  1. 选择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方式。

  1. 修改pyproject.toml, 添加版本、依赖、构建配置
  2. uv build构建生成dist目录
dist/目录下生成两个文件:
.whl 文件(构建分发版)
.tar.gz 文件(源代码分发版)
  1. 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配置:

  1. 选择sse,配置mcp server服务器地址: http://{IP}:{PORT}/sse

Project details


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

weather_didi-0.1.3-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

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

Hashes for weather_didi-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0322dfdbdab6b9fdd2108cb700cd902dbf9e387efbaf32d080fd6edcdfe24165
MD5 e921d8b168bc04fd2d7c4171cb98c413
BLAKE2b-256 456edeea06dd1e7e07113cd5c0bb0b2aa7af7966bd8d0783d0e32ac0f4166f3b

See more details on using hashes here.

File details

Details for the file weather_didi-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for weather_didi-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bafa1e77d5224d32ad024e22ada10026fdddfff8f1cce1fb123dc90f56cdd79c
MD5 b340d1bd98aa0220b44a0c811808cf53
BLAKE2b-256 0c04f999abd19e9296b8f46d4c1a0d3ff6755f33f5a2ceed0c92d71cd9eae20a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page