dotnet-mcp-server-blueprint
<!-- mcp-name: io.github.RazvanM4/dotnet-mcp-server-blueprint -->
# .NET 10 MCP Server Blueprint
A production-ready reference implementation of a **Model Context Protocol (MCP)** server built on **.NET 10** and the official C# SDK (`ModelContextProtocol` & `ModelContextProtocol.AspNetCore`).
Designed as an end-to-end companion to:
- [Build a Production-Ready MCP Server in C#: Tools, Trust, and Transport](https://razvanmares.ro/en/blog/build-a-production-ready-mcp-server-in-c-tools-trust-and-transport)
- [Inside the Official MCP Registry: A Supply Chain for AI Tools](https://razvanmares.ro/en/blog/inside-the-official-mcp-registry-a-supply-chain-for-ai-tools)
---
## Architecture Highlights
- **Dual Transport Support**:
- **Standard I/O (`stdio`)** by default for local desktop/IDE hosts (`Claude Code`, `Antigravity`, `Cursor`, `VS Code`), with strict `stderr`-only diagnostics so `stdout` stays pure JSON-RPC.
- **Streamable HTTP (`--http` / `MCP_TRANSPORT=http`)** exposing `/mcp` alongside `/health` for containerized or remote deployments.
- **Typed Domain Logic & Tool Annotations**:
- Explicit `[McpServerTool(ReadOnly = true, Idempotent = true, Destructive = false, OpenWorld = false)]` capabilities.
- Three deterministic governance tools: `evaluate_mcp_trust_boundary`, `validate_server_manifest`, `generate_tool_policy_summary`.
- Built-in resource (`architecture://mcp/checklist`) and prompt (`mcp_security_review`).
- **Registry-Ready Supply Chain**:
- Packaged as a cross-platform .NET tool (`RazvanApps.McpServer.Blueprint`).
- Ships valid `server.json` for the **Official MCP Registry** and `glama.json` + multi-stage `Dockerfile` for **Glama.ai**.
---
## Quick Start
### Run via .NET Tool (`stdio`)
```bash
dotnet tool install --global RazvanApps.McpServer.Blueprint
razvanapps-mcp-blueprint
```
### Run locally over Streamable HTTP
```bash
dotnet run --project src/RazvanApps.McpServer.Blueprint -- --http
```
MCP endpoint: `http://localhost:5000/mcp`
Health endpoint: `http://localhost:5000/health`
### Client Configuration (`mcp.json`)
```json
{
"mcpServers": {
"razvanapps-mcp-blueprint": {
"command": "razvanapps-mcp-blueprint"
}
}
}
```
---
## Verification
```bash
dotnet test -c Release
dotnet pack src/RazvanApps.McpServer.Blueprint -c Release -o ./artifacts
```
## License
MIT — [Răzvan Mareș (RazvanApps)](https://razvanmares.ro)
TDQS
Scored across 3 tools
Each tool operates on a different artifact: a deployment configuration (trust boundary), a server.json manifest (registry validation), and an individual tool (capability/approval policy). The only mild overlap is the evaluate/validate verb pair, which an agent could briefly conflate, but the target objects are clearly distinguished in the descriptions.
All names are snake_case and verb-first (evaluate_, validate_, generate_), which is predictable. The third name, generate_tool_policy_summary, is a longer noun-phrase construction and its description says 'classifies' rather than 'generates a summary', a small mismatch with the pattern and stated action.
Three tools is thin for a server framed as a 'blueprint' covering trust, registry, and policy concerns. Each tool does earn its place, but the surface feels like a subset of a larger governance workflow rather than a well-scoped set.
The surface covers assessment (trust boundary), validation (manifest), and classification (tool policy), but there is no scaffolding/generation of a server.json or deployment config, no remediation or fix path after a failed validation, and no way to enumerate or look up registry entries. Agents can evaluate artifacts but cannot create or repair them, leaving a dead end in the lifecycle.