Weather MCP 7395daa2

MCP地图位置

提供方 Geertvdc · 包名 @modelcontextprotocol/inspector

地图位置 stdio · 本地进程 无需鉴权 社区 / 第三方 Claude DesktopClaudeVS Code
查看接入方式

一个增强版的天气API服务,通过Model Context Protocol (MCP)服务器功能,将现有的Web API转换为MCP服务器,使AI代理和其他客户端能够通过标准化的MCP协议与天气数据交互。

一句话选型结论

按资料字段整理

Weather MCP 7395daa2 属于地图位置类 MCP 服务器,stdio · 本地进程,无需鉴权,可直接接入 Claude Desktop、Claude、VS Code,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类地图位置 传输方式stdio · 本地进程 鉴权无需鉴权 部署方式本地部署
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 2 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

地图位置
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量2暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

天气APIC#本地部署MCP服务器AI集成数据交互标准化协议

安装与配置

stdio · 本地进程 无需鉴权
客户端在本机拉起子进程,数据不出本机
npx @modelcontextprotocol/inspector

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 2 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
地址与路线

查地址、算路线、找附近地点。

位置检索

按区域筛门店、站点与设施。

地理数据

拉取经纬度、行政区等地理信息。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 2 个工具,职责相对集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、VS Code,换客户端不用重新研究配置。
  • 资料标注无需鉴权,装好就能连。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在地图位置场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Weather MCP 7395daa2当前 2 stdio · 本地进程 本地部署 有 2026-05-17
MCP Server C2f246e3 20 stdio · 本地进程 本地部署 有 2026-05-17
OpenStreetMap MCP Server 12 stdio · 本地进程 本地部署 有 2026-05-18
Baidu Maps 10 stdio · 本地进程 本地部署 有 2026-05-17
Google Maps (google-maps-aa2563d3) 7 未标注 未标注 无 2026-05-17
generative-ai 未标注 stdio · 本地进程 本地部署 有 2026-04-17

服务器档案

地图位置
字段来自项目仓库与公开索引,中文说明由本站标注
提供方Geertvdc上游标注的维护方 Geertvdc
分类地图位置本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式无需鉴权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时@modelcontextprotocol/inspector · Node.js本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

6.5 KB
来自项目仓库与上游目录的原文,未做删改

Weather MCP Server

A sample weather API that has been enhanced with Model Context Protocol (MCP) server capabilities, demonstrating how to convert an existing web API into an MCP server.

Project Overview

This project serves as a practical example of integrating MCP (Model Context Protocol) functionality into an existing .NET web API. It started as a simple weather forecast API and has been enhanced to serve as an MCP server, allowing AI agents and other clients to interact with weather data through the standardized MCP protocol.

What is MCP (Model Context Protocol)?

The Model Context Protocol (MCP) is an open standard that enables seamless integration between AI applications and external data sources. MCP allows AI models to securely connect to and interact with various tools, databases, and services through a standardized interface.

Key benefits of MCP:
- Standardized Communication: Provides a consistent way for AI agents to interact with tools and data sources
- Security: Ensures secure and controlled access to external resources
- Flexibility: Supports various transport mechanisms (HTTP, WebSocket, etc.)
- Tool Integration: Enables AI agents to call functions and access data from external services

Converting a Web API to MCP Server

This project demonstrates the minimal changes needed to add MCP capabilities to an existing ASP.NET Core web API:

1. Package Dependencies

Added the MCP server package to WeatherMcp.csproj:```xml
<PackageReference Include="ModelContextProtocol.AspNetCore" Version="0.2.0-preview.3" />


### 2. MCP Tools Implementation
Created `Tools/WeatherTools.cs` with MCP-decorated methods:
- `[McpServerToolType]` attribute on the class
- `[McpServerTool]` attribute on public methods
- `[Description]` attributes for documentation

### 3. Service Registration
In `Program.cs`, added MCP server services:```csharp
// Add MCP server with HTTP transport
builder.Services.AddMcpServer()
    .WithHttpTransport()
    .WithToolsFromAssembly();

// Map MCP endpoints
app.MapMcp();

4. Tool Classes

The weather tools wrap the existing weather service, making it accessible via MCP:
- GetWeatherForecast() - Get forecast for default city
- GetWeatherForecastForCity(string city) - Get forecast for specific city

Running the Application

Prerequisites

  • .NET 9 SDK
  • Visual Studio Code (recommended) or Visual Studio

Build and Run```bash

Build the solution

dotnet build

Run the application

dotnet run --project WeatherMcp

Or run with watch for development

dotnet watch --project WeatherMcp


The application will start on `http://localhost:5260` (or similar port).

### Available Endpoints

**REST API Endpoints:**
- `GET /weatherforecast` - Get 5-day forecast for default city
- `GET /weatherforecast/{city}` - Get 5-day forecast for specific city
- `GET /swagger` - Swagger UI documentation

You can test these endpoints using the WeatherMcp.http file. Example:```http
### Get weather forecast for London
GET http://localhost:5260/weatherforecast/London
Accept: application/json

MCP Endpoints:
- POST / - MCP JSON-RPC endpoint for all MCP communication

Test MCP endpoints using WeatherMcp.mcp.http. Example:```http

Call GetWeatherForecastForCity Tool

POST http://localhost:5260/
Content-Type: application/json

{
"jsonrpc": "2.0",
"id": 5,
"method": "tools/call",
"params": {
"name": "GetWeatherForecastForCity",
"arguments": {
"city": "Amsterdam"
}
}
}


### MCP Inspector Integration

You can use the MCP Inspector to interact with your MCP server:```bash
npx @modelcontextprotocol/inspector

This provides a web-based interface to test MCP tools and explore the server capabilities.

Claude Desktop Integration

To connect this MCP server to Claude Desktop, add the following to your claude_desktop_config.json file:```json
{
"mcpServers": {
"weather": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:5260"
]
}
}
}


## Testing the Application

### Unit Tests
Run the comprehensive test suite:```bash
# Run all tests
dotnet test

# Run tests with verbose output
dotnet test --verbosity normal

# Run specific test project
dotnet test WeatherMcp.Tests

The project includes 22 tests covering:
- Weather service functionality
- REST API endpoints
- MCP server configuration
- Weather tools integration

REST API Testing

Use the provided HTTP file to test REST endpoints:```bash

Using VS Code REST Client extension or similar tools

Open and run requests from: WeatherMcp/WeatherMcp.http


Example requests:
- Get default weather forecast
- Get weather for London, New York, Tokyo
- Access Swagger documentation

### MCP Protocol Testing
Test MCP functionality using the MCP HTTP file:```bash
# Open and run requests from: WeatherMcp/WeatherMcp.mcp.http

MCP test scenarios:
- Initialize MCP session
- List available tools
- Call GetWeatherForecast tool
- Call GetWeatherForecastForCity tool with parameters

Development Environment

This repository includes a Dev Container configuration that provides a consistent development environment with .NET 9 pre-installed. This is particularly useful for GitHub Copilot coding agents and ensures a smooth development experience.

Quick Start with Dev Container

  1. Open this repository in VS Code
  2. Install the "Dev Containers" extension
  3. Press Ctrl+Shift+P and select "Dev Containers: Reopen in Container"
  4. The container will automatically set up .NET 9 and all necessary tools

For more details about the dev container setup, see .devcontainer/README.md.

Making Changes

Development Workflow

  1. Setup: Use the dev container for consistent environment
  2. Build: dotnet build to compile the solution
  3. Test: dotnet test to run unit tests
  4. Run: dotnet watch --project WeatherMcp for development with hot reload
  5. HTTP Testing: Use the .http files to test both REST and MCP endpoints

Project Structure```

WeatherMcp/
├── Models/ # Data models (WeatherForecast)
├── Services/ # Business logic (WeatherService)
├── Tools/ # MCP tools (WeatherTools)
├── Program.cs # Application startup and configuration
├── WeatherMcp.http # REST API test requests
└── WeatherMcp.mcp.http # MCP protocol test requests

WeatherMcp.Tests/ # Unit tests for all components
```

This example demonstrates how straightforward it can be to add MCP capabilities to existing APIs, enabling them to be consumed by AI agents and other MCP-compatible clients.

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Weather MCP 7395daa2 怎么安装?

在客户端按下面的安装命令接入:npx @modelcontextprotocol/inspector。对应的包名是 @modelcontextprotocol/inspector。装完在客户端配置里引用同一个包或端点。

Weather MCP 7395daa2 怎么在 Claude Desktop、Claude、VS Code 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Weather MCP 7395daa2 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Weather MCP 7395daa2 需要 API Key 吗?

资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

Weather MCP 7395daa2 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、VS Code;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Weather MCP 7395daa2 能提供哪些能力?

资料显示约 2 个工具;能力标签包括 标准化协议、C#、Claude、数据交互。具体工具清单以官方文档为准。

Weather MCP 7395daa2 需要什么运行环境?

运行时为 Node.js;属于本地进程,需要在本机装好运行环境。

Weather MCP 7395daa2 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。