What problem does it solve? Building a Model Context Protocol server in .NET involves non-obvious SDK behaviors, transport wiring traps, and testing gaps that only surface at runtime, such as dropped tool registrations, stdout pollution on stdio transports, and DI failures invisible to unit tests. ## Core Features & Use Cases - Tool and prompt implementation patterns: Attribute-based tools with [McpServerTool], DI-injected typed HttpClients, Task<string> return contracts, and SDK 2.x specifics like McpException error signaling and tool-name derivation. - Transport and host wiring: stdio, Streamable HTTP, and dual-mode servers with case-insensitive transport selection, CLI argument handling that never corrupts the JSON-RPC stream, and dotnet tool packaging guidance. - Testing at every layer: MockHttpHandler unit tests, host-level tool-inventory tests that assert the registered surface, and E2E tests over HTTP with WebApplicationFactory plus a stdio handshake probe script. - Use Case: When adding a new MCP tool backed by a REST API, follow the TDD sequence to write mock-HTTP tests first, register the typed HttpClient and WithTools<T>() in Program.cs, and verify the shipped binary exposes the full tool set. ## Quick Start Ask the agent to scaffold a new .NET MCP server with one REST-backed tool, wired for stdio transport, including unit tests and a tool-registration inventory test.