# sampledotnetmcpserver [Health: Active]

**Category:** 🌳 Environment & Nature  
**Repository:** https://github.com/timheuer/sampledotnetmcpserver  
**GitHub Stars:** 4  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/sampledotnetmcpserver

## Description
Sample .NET MCP Server

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/timheuer/sampledotnetmcpserver), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Start the server:

```sh
dotnet run --project .
```

## Documentation

## What sampledotnetmcpserver MCP server does

sampledotnetmcpserver MCP server is a reference implementation for building an MCP server with C# and the ModelContextProtocol SDK. Its tools are intentionally small and demonstrate several common tool shapes rather than providing a production application.

The server exposes a random-number tool that returns integers within a requested range. It also includes separate greeting and goodbye tools that accept a name. Weather tools accept a US ZIP code: one returns current weather information and another returns a multi-day forecast. The current-weather tool uses the wttr.in API.

This makes the project useful for developers learning how tools are declared, registered, and made available to an MCP client. It is also suitable for testing client configuration and experimenting with a local .NET MCP process.

## How it works

The application starts from `Program.cs`, where the MCP server and its transport are configured. Tool implementations are organized under the `Tools` directory, with separate source files for random numbers, greetings, and weather operations.

Communication uses stdio. An MCP client starts the .NET process and exchanges protocol messages through the process input and output streams. The README provides a client definition that invokes `dotnet run` with the project path, so the server can be used directly from a checkout without first creating a package.

The project also includes MCP metadata and packaging configuration. Its `.mcp/server.json` file contains server metadata and NuGet package information, while the project file defines the application and its package configuration.

## Setup and configuration

For local development, run `dotnet run --project .` from the project directory, or point a client’s stdio configuration at the project and use `dotnet` as the command. The configuration needs the project path as an argument to `dotnet run`.

Replace the example package name and version with the published values for the package you intend to run.

No environment variables are documented as required. The repository states that CI publishes to NuGet.org using NuGet Trusted Publishing and automatic versioning through Nerdbank.GitVersioning.

## Tools and capabilities

Available tools include:

- `get_random_number` for an integer in a specified range.
- `say_hello_name` for a simple greeting.
- `say_goodbye_name` for a simple farewell.
- `get_weather_by_zip_code` for current weather at a US ZIP code.
- `get_weather_forecast` for a multi-day forecast at a US ZIP code.

The examples can be invoked through Copilot Chat or another MCP client after the stdio process is running. Weather requests use US ZIP codes, and the sample questions include ZIP codes for Los Angeles, New York, and Chicago.

## Limitations and notes

sampledotnetmcpserver MCP server is presented as demonstration and reference code, not as a production weather service or general-purpose application. Its weather coverage is described for US ZIP codes, and the current-weather implementation depends on wttr.in.

The example is designed around stdio rather than a network transport. Developers integrating it should therefore use an MCP client configuration that can launch a local command. The repository documents use with VS Code and Visual Studio previews, while the protocol can also be exercised by other MCP clients.

_Full upstream README: https://allmcps.com/mcp/sampledotnetmcpserver/readme_

