Skip to main content

Rentaoshu's test MCP weather server.

Project description

MCP服务开发、测试、发布全流程

1、在某个conda环境中(比如llm-mcp),安装好uv:

pip install uv

2、PyCharm项目初始化为uv项目:

uv init .

3、创建、激活虚拟环境

uv venv source .venv/bin/activate

4、安装 MCP SDK

uv add openai dotenv mcp

5、创建项目源代码

创建src/weather 文件夹

添加 server.py 文件

6、本地测试(使用Inspector进行)

安装nodejs

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash - sudo apt install -y nodejs

运行Inspector

npx -y @modelcontextprotocol/inspector uv run ./src/weather/server.py --api_key apikey123abc

7、打包

添加__init__.py、main.py

修改pyproject.toml文件

填写内容,注意[project.scripts]中的rents-mcp-weather2名称:

[build-system] requires = ["setuptools>=61.0", "wheel"] build-backend = "setuptools.build_meta"

[project.scripts] rents-mcp-weather2 = "weather:main" [tool.setuptools] package-dir = {"" = "src"} [tool.setuptools.packages.find] where = ["src"]

安装打包/发布(上传)工具包

uv pip install build twine

打包(回到项⽬主⽬录)

cd /Users/rents/PycharmProjects/rents-mcp-weather python -m build

8、发布

python -m twine upload dist/*

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

rents_mcp_weather-0.1.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

rents_mcp_weather-0.1.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file rents_mcp_weather-0.1.1.tar.gz.

File metadata

  • Download URL: rents_mcp_weather-0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for rents_mcp_weather-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5cf50e098f5f494ce1ba46ae643930c8b5e23c1f60c37d85f6e8622fdb00a161
MD5 9ae6df09640801215527c5574fbabfd0
BLAKE2b-256 efb898a64cd81af767172285475b332a545e7f47ce001945fdf7cc520b69b54f

See more details on using hashes here.

File details

Details for the file rents_mcp_weather-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rents_mcp_weather-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e9a9ccca04244734275eb73f556e742604c4ce7e96f604d025dd628c7522e50
MD5 7a2a896caecaa92a18ae7f046e6328aa
BLAKE2b-256 c0e9a4b8a408719f31b3f48f5b7b7d5d5877150da9f2ad8f8f3666b6c0e14c5a

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