天气 MCP 服务器
该项目是一个提供天气信息的模型上下文协议(MCP)服务器。
特征
获取特定纬度和经度的当前天气预报。
获取美国某个州的天气预警。
设置
安装依赖项:
pnpm install构建服务器:
pnpm run build
运行服务器
该服务器设计为由 MCP 客户端(例如 Claude for Desktop)运行。
要配置 Claude for Desktop(或类似的 MCP 客户端)使用此服务器,您需要将其指向已构建的服务器。典型的配置包括:
命令:
node
参数:
["/ABSOLUTE/PATH/TO/YOUR/PROJECT/mcptest/build/index.js"]
将/ABSOLUTE/PATH/TO/YOUR/PROJECT/
替换为系统上mcptest
目录的实际绝对路径。
例如,如果您的项目位于/Users/bohe/Desktop/mcptest
,则参数将是["/Users/bohe/Desktop/mcptest/build/index.js"]
。
有关如何添加和配置 MCP 服务器的具体说明,请参阅 MCP 客户端的文档。
发展
源代码位于
src
目录中。主要的服务器逻辑位于
src/index.ts
中。构建输出位于
build
目录中。
MCP 配置
.vscode/mcp.json
文件可供 VS Code 识别并可能调试此 MCP 服务器。
模型上下文协议服务器提供特定位置的当前天气预报和美国各州的有效天气警报。
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides tools to fetch weather alerts for US states and forecasts based on latitude/longitude coordinates using the US National Weather Service API.Last updated -288MIT License
- -securityFlicense-qualityA Model Context Protocol server that enables AI models to fetch weather alerts and detailed forecasts for US locations using the National Weather Service API.Last updated -88
- AsecurityAlicenseAqualityA Model Context Protocol server that provides weather information and forecasts based on user location or address input.Last updated -634MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides real-time weather data and forecasts for any city.Last updated -111ISC License