mcp 0.0.1
dotnet tool install --global mcp --version 0.0.1
dotnet new tool-manifest
dotnet tool install --local mcp --version 0.0.1
#tool dotnet:?package=mcp&version=0.0.1
nuke :add-package mcp --version 0.0.1
MCP Weather Server
A Model Context Protocol (MCP) server to try NuGet MCP support that provides weather information tools for AI assistants. This server is built using C# and the official ModelContextProtocol SDK.
Overview
This MCP server exposes weather-related tools that can be used by AI assistants like Claude, GitHub Copilot, and other MCP-compatible clients. The server provides random weather information for cities based on configurable weather conditions.
Features
- Weather Information Tool: Get random weather descriptions for any city
- Configurable Weather Options: Customize available weather conditions via environment variables
- Cross-Platform: Built on .NET 9.0 with cross-platform support
- Easy Integration: Works with VS Code, Visual Studio, and other MCP-compatible environments
Installation
From NuGet (Recommended)
The server is available as a NuGet package at nuget.org/packages/mcp.
Global Installation
dotnet tool install --global mcp
Local Installation
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local mcp
From Source
Clone the repository:
git clone https://github.com/sanamhub/mcp-nuget.git cd mcp-nugetBuild and run:
dotnet build dotnet run
Configuration
VS Code Setup
Create a .vscode/mcp.json file in your workspace:
{
"servers": {
"mcp-weather": {
"type": "stdio",
"command": "dnx",
"args": ["mcp@0.0.1", "--yes"],
"env": {
"WEATHER_CHOICES": "sunny,cloudy,rainy,snowy,stormy"
}
}
}
}
Visual Studio Setup
Create a .mcp.json file in your solution directory:
{
"servers": {
"mcp-weather": {
"type": "stdio",
"command": "dnx",
"args": ["mcp@0.0.1", "--yes"],
"env": {
"WEATHER_CHOICES": "sunny,cloudy,rainy,snowy,stormy"
}
}
}
}
Local Development Setup
For testing from source code:
{
"servers": {
"mcp-weather": {
"type": "stdio",
"command": "dotnet",
"args": ["run", "--project", "."],
"env": {
"WEATHER_CHOICES": "sunny,humid,freezing,perfect,stormy"
}
}
}
}
Environment Variables
| Variable | Description | Required | Default |
|---|---|---|---|
WEATHER_CHOICES |
Comma-separated list of weather descriptions | No | "balmy,rainy,stormy" |
Available Tools
get_city_weather
Returns random weather information for a specified city.
Parameters:
city(string): Name of the city to get weather for
Example:
User: What's the weather like in New York?
Assistant: The weather in New York is sunny.
Development
Prerequisites
- .NET 9.0 SDK or later
- Visual Studio 2022 or VS Code
Building
dotnet build
Testing
dotnet test
Packaging
dotnet pack -c Release
The package will be created in bin/Release/mcp.{version}.nupkg.
Publishing
To publish a new version to NuGet:
Update the version in
mcp.csprojUpdate the version in
.mcp/server.jsonBuild and pack:
dotnet pack -c ReleasePublish:
dotnet nuget push bin/Release/*.nupkg --api-key <your-api-key> --source https://api.nuget.org/v3/index.json
Dependencies
- ModelContextProtocol - Official MCP C# SDK
- Microsoft.Extensions.Hosting - .NET hosting infrastructure
Resources
- Model Context Protocol Documentation
- MCP Protocol Specification
- VS Code MCP Integration
- Visual Studio MCP Integration
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.1 | 648 | 7/20/2025 |
| 0.0.1-preview | 162 | 7/18/2025 |