Back to MCP directory
publicPublicdnsLocal runtime

mcp-weather

一个用于学习目的的MCP服务器,提供天气信息,运行在SSE模式下。

article

README

🚀 MCP 天气服务

MCP 天气服务是一个提供天气信息的 MCP 服务器,其开发初衷是用于学习。它以 SSE 模式运行,你可以使用此模板仓库进行搭建:ts-koa-starter

🚀 快速开始

运行服务器

在项目根目录下,执行以下命令启动服务器:

pnpm start

客户端配置

在 MCP 客户端(例如 Cherry Studio)中,添加一个指向以下地址的 MCP 服务器:

http://localhost:3000/sse

完成上述操作后,你应该能够正确获取工具列表。

💻 使用示例

基础用法

以下是启动服务器的命令示例:

pnpm start

高级用法

在实际部署中,你可能需要修改服务器的端口号。假设你要将端口号修改为 8080,可在项目配置文件中进行相应修改,然后再启动服务器。启动命令依旧是:

pnpm start
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