
Knapcode.SampleMcpServer
Learn MCP on .NET with a minimal NuGet stdio server that returns random numbers and configurable random weather.
Overview
com.joelverhagen.mcp/Knapcode.SampleMcpServer is a MCP server for the Build phase that demos the MCP C# SDK with random number and random weather tools over stdio.
What is this MCP server?
- Reference MCP server using the official MCP C# SDK (0.7.0-beta)
- NuGet package Knapcode.SampleMcpServer with positional args mcp start
- WEATHER_CHOICES env: comma-separated descriptions for random weather tool
- Random number generation demo tool for agent integration tests
- Open source: github.com/joelverhagen/Knapcode.SampleMcpServer
- Version 0.7.0-beta
- Registry: nuget.org (Knapcode.SampleMcpServer)
- 2 demo capability areas: random numbers and random weather
What problem does it solve?
You need a safe, local MCP target to learn C# SDK patterns without risking production credentials or flaky external APIs.
Who is it for?
.NET-curious solo developers prototyping MCP servers or testing agent MCP config with deterministic randomness.
Skip if: Production IoT, analytics, or any workflow requiring real business data or SLAs.
What do I get? / Deliverables
You can run a NuGet-based stdio MCP server and verify your agent discovers and calls sample tools end to end.
- Working local MCP tools for random numbers and weather strings
- Template patterns for MCP C# SDK server startup (mcp start)
- Low-risk sandbox for agent MCP integration checks
Recommended MCP Servers
Journey fit
Sample servers belong in Build when you are wiring agent tooling and validating MCP transport before production APIs. Agent-tooling is the shelf for reference MCP implementations and SDK exercises, not live product analytics.
How it compares
Educational C# MCP sample, not a hosted SaaS connector or security audit tool.
Common Questions / FAQ
Who is Knapcode.SampleMcpServer for?
Developers learning MCP on .NET who want a small stdio server with random number and weather tools for demos and tests.
When should I use Knapcode.SampleMcpServer?
During Build when configuring agent-tooling, validating MCP discovery, or following the MCP C# SDK before shipping a real server.
How do I add Knapcode.SampleMcpServer to my agent?
Register the NuGet package Knapcode.SampleMcpServer with positional arguments mcp start and set WEATHER_CHOICES to your comma-separated weather strings.