Back to MCP directory
publicPublicdnsLocal runtime

mcp-server-test-1tw

创建一个名为weather的MCP服务项目,用于天气相关功能

article

README

🚀 创建项目

本项目将指导你完成一系列操作,包括创建项目目录、虚拟环境,安装依赖项以及创建服务器文件。

📦 安装步骤

1. 创建项目目录

使用以下命令创建一个名为 weather 的项目目录,并进入该目录:

uv init weather
cd weather

2. 创建并激活虚拟环境

使用 uv venv 命令创建虚拟环境,然后激活它:

uv venv
.venv\Scripts\activate

3. 安装依赖项

使用 uv add 命令安装所需的依赖项:

uv add mcp[cli] httpx

4. 创建服务器文件

使用 new-item 命令创建一个名为 weather.py 的服务器文件:

new-item weather.py

按照以上步骤操作,你就可以成功搭建项目环境并创建服务器文件。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client