{
  "markdown": "# SampleDotnetMcpServer\n\nThis project is a sample implementation of a Model Context Protocol (MCP) server in .NET, designed to demonstrate how to build, run, and publish an MCP server using C# and the [ModelContextProtocol SDK](https://www.nuget.org/packages/ModelContextProtocol).\n\nmcp-name: io.github.timheuer/sampledotnetmcpserver\n\n## What is this?\n\n\n**SampleDotnetMcpServer** is a reference MCP server for .NET, showing how to:\n\n- Implement MCP tools in C# (see `Tools/RandomNumberTools.cs`, `Tools/SayHelloName.cs`, `Tools/WeatherTools.cs`)\n- Register tools and configure the MCP server transport (see `Program.cs`)\n- Package and publish the server as a NuGet package for use in IDEs like VS Code and Visual Studio\n\nThe included tools demonstrate various MCP capabilities:\n- `get_random_number`: Generates random numbers within a specified range\n- `say_hello_name` and `say_goodbye_name`: Simple greeting tools\n- `get_weather_by_zip_code`: Gets current weather information for any US zip code\n- `get_weather_forecast`: Gets a multi-day weather forecast for any US zip code\n\n## Features\n\n- Implements the MCP protocol using stdio transport\n- Provides multiple sample tools:\n  - `get_random_number`: Returns a random integer in a specified range\n  - `say_hello_name` and `say_goodbye_name`: Simple greeting tools\n  - `get_weather_by_zip_code`: Gets current weather for any US zip code using wttr.in API\n  - `get_weather_forecast`: Gets multi-day weather forecast for any US zip code\n- Ready to be packed and published as a NuGet MCP server\n- Example configuration files and metadata included\n\n## How to use\n\n### Run locally\n\nYou can run the MCP server directly from source for development and testing:\n\n```shell\ndotnet run --project .\n```\n\nOr configure your IDE to use the following MCP server definition:\n\n```json\n{\n  \"servers\": {\n    \"SampleDotnetMcpServer\": {\n      \"type\": \"stdio\",\n      \"command\": \"dotnet\",\n      \"args\": [\n        \"run\",\n        \"--project\",\n        \"<PATH TO PROJECT DIRECTORY>\"\n      ]\n    }\n  }\n}\n```\n\n### Test the MCP server\n\nOnce running, you can use Copilot Chat or any MCP client to invoke the available tools:\n\n**Weather Tools:**\n- Ask: \"What's the weather like in 90210?\" to get current weather\n- Ask: \"Give me a 3-day forecast for 10001\" to get a weather forecast\n- Ask: \"Check the weather in 60601\" to test with Chicago's zip code\n\n**Other Tools:**\n- Ask: \"Give me 3 random numbers\" to use the random number generator\n- Ask: \"Say hello to John\" to use the greeting tools\n\n\n### Publish to NuGet.org\n\nCI handles publishing to NuGet, using NuGet Trusted Publishing for the key and automatic versioning using Nerdbank.GitVersioning.\n\n### Use from NuGet.org\n\nAfter publishing, configure your IDE to use the MCP server from NuGet.org. Example configuration (replace package id and version):\n\n```json\n{\n  \"servers\": {\n    \"SampleDotnetMcpServer\": {\n      \"type\": \"stdio\",\n      \"command\": \"dnx\",\n      \"args\": [\n        \"TimHeuer.SampleMcpServer\",\n        \"--version\",\n        \"0.1.0-beta\",\n        \"--yes\"\n      ]\n    }\n  }\n}\n```\n\n## Project structure\n\n- `Program.cs`: MCP server entry point and configuration\n- `Tools/RandomNumberTools.cs`: Example MCP tool for generating random numbers\n- `Tools/SayHelloName.cs`: Example MCP tools for greetings\n- `Tools/WeatherTools.cs`: Weather-related MCP tools for checking weather by zip code\n- `.mcp/server.json`: MCP server metadata and NuGet package info\n- `SampleDotnetMcpServer.csproj`: Project and NuGet packaging configuration\n\n## Learn more\n\n- [ModelContextProtocol SDK](https://www.nuget.org/packages/ModelContextProtocol)\n- [Model Context Protocol Documentation](https://modelcontextprotocol.io/)\n- [Protocol Specification](https://spec.modelcontextprotocol.io/)\n- [GitHub Organization](https://github.com/modelcontextprotocol)\n- [Use MCP servers in VS Code (Preview)](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)\n- [Use MCP servers in Visual Studio (Preview)](https://learn.microsoft.com/visualstudio/ide/mcp-servers)\n\n---\n\nThis project is for demonstration and reference purposes only. For feedback or contributions, see the [GitHub repository](https://github.com/timheuer/sampledotnetmcpserver).\n",
  "bytes": 4197,
  "sha": "44397b4d1bc4ecc763cb970352224be168b38a65e9d4be461ff171497044dd4c",
  "repo_slug": "timheuer/sampledotnetmcpserver",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_timheuer_sampledotnetmcpserver_27765291/readme"
}