这是一个基于 Model Context Protocol (MCP)的天气服务,提供天气预报功能。
- 获取天气预报: 根据经纬度获取详细的天气预报信息
npm install -g test-mcp
git clone https://github.com/zkluck/test-mcp.git
cd test-mcp
npm install
npm run build
npm link
无需安装,直接通过 npx 使用:
npx test-mcp
要在 Windsurf 中使用此 MCP 服务,您需要在 Windsurf 的 MCP 配置文件中添加以下配置:
- 打开 Windsurf 的 MCP 配置文件(通常位于
~/.codeium/windsurf/mcp_config.json
) - 根据您选择的安装方式,添加相应配置:
{
"mcpServers": {
"weather": {
"command": "node",
"args": ["路径/到/test-mcp/build/index.js"]
}
}
}
{
"mcpServers": {
"weather": {
"command": "npx",
"args": ["-y", "test-mcp"]
}
}
}
此 MCP 服务提供以下工具:
get-world-weather
参数:
-
latitude
: 纬度 (-90 到 90) -
longitude
: 经度 (-180 到 180)
# 安装依赖
npm install
# 构建项目
npm run build
# 运行服务
npm dev
ISC