.NET MCP Server

Give your AI assistant superpowers for .NET development! This MCP server connects GitHub Copilot, Claude, and other AI assistants directly to the .NET SDK, enabling them to create projects, manage packages, run builds, and moreβall through natural language.
Quick Install
Click to install in your preferred environment:

Note: Quick install requires .NET 10 SDK.
What is This?
The .NET MCP Server is a Model Context Protocol (MCP) server that connects AI assistants to the .NET SDK using the Model Context Protocol. Think of it as giving your AI assistant a direct line to dotnet commands, but with intelligence and context.
Important: This package is designed exclusively as an MCP server for AI assistants. It is not intended for use as a library or for programmatic consumption in other .NET applications. The only supported use case is running it as an MCP server via dnx or dotnet run.
graph LR
A[AI Assistant<br/>Copilot/Claude] -->|Natural Language| B[.NET MCP Server]
B -->|dotnet commands| C[.NET SDK]
C -->|Results| B
B -->|Structured Response| A
style A fill:#e1f5ff
style B fill:#fff4e6
style C fill:#e8f5e9
Why Use It?
π Faster Development
Instead of remembering exact dotnet commands and syntax, just ask:
- "Create a new web API project with Entity Framework"
- "Add the Serilog package and configure structured logging"
- "Update all my NuGet packages to the latest versions"
π§ Smarter AI Assistance
Your AI assistant gets direct access to:
- All installed .NET templates and their parameters
- NuGet package search and metadata
- Framework version information (including LTS status)
- Your solution and project structure
β‘ Token-Efficient by Design
Instead of relying on the LLM to infer state by reading and re-reading console output, the server exposes purpose-built .NET tools with structured inputs and outputs. In practice, this typically means fewer tokens per task and less back-and-forth.
- Deterministic tool schemas reduce prompt/response overhead
machineReadable: true returns structured JSON (no log scraping)
- MCP Resources provide lightweight metadata without running commands
π― Why Not Just Let the AI Call dotnet Directly?
The .NET MCP Server provides context and intelligence that raw CLI execution cannot:
1. Template Discovery & Validation
- With MCP: AI knows exactly which templates are installed (
console, webapi, blazor, etc.) and their parameters
- Without MCP: AI guesses template names and parameters, often getting them wrong
2. Framework Intelligence
- With MCP: AI knows which .NET versions are installed, which are LTS, and can recommend appropriately
- Without MCP: AI suggests
net8.0 when you only have net10.0 installed, leading to errors
3. Rich Tool Descriptions
- With MCP: Each tool has detailed parameter descriptions and constraints (e.g., "configuration must be Debug or Release")
- Without MCP: AI constructs commands from general knowledge, missing version-specific changes
4. Parameter Information
- With MCP: AI sees template parameters like
--use-controllers, --auth, framework options
- Without MCP: AI doesn't know what optional parameters exist for each template
5. Package Search Integration
- With MCP: AI can search NuGet.org to find exact package names and versions
- Without MCP: AI guesses package names, often suggesting outdated or incorrect ones
6. Structured Error Handling with Enhanced Diagnostics
- With MCP: Errors are parsed and enriched with explanations, documentation links, and suggested fixes
- Without MCP: AI gets raw stderr output and may misinterpret errors
The server provides enhanced error diagnostics for 52 common error codes:
- Plain English explanations of what went wrong
- Direct links to official Microsoft documentation
- Specific suggested fixes with commands to resolve issues
- Support for CS####, MSB####, NU####, and NETSDK#### error codes
See Error Diagnostics Documentation for details.
7. MCP Resources
MCP Resources provide read-only access to structured metadata about your .NET environment:
- dotnet://sdk-info - Information about installed .NET SDKs (versions and paths)
- dotnet://runtime-info - Information about installed .NET runtimes (versions and types)
- dotnet://templates - Complete catalog of installed .NET templates with metadata
- dotnet://frameworks - Information about supported .NET frameworks (TFMs) including LTS status
- dotnet://workspace - Workspace snapshot with solution, projects, target frameworks, and package counts
This enables AI assistants to:
- Answer questions without executing commands ("What .NET versions do I have installed?")
- Provide context-aware suggestions based on your actual environment
- Access structured JSON data more efficiently than parsing CLI output
- Reference official .NET metadata for accurate recommendations
Example: Using resources for context-aware assistance
β Without Resources:
User: "What .NET versions do I have?"
AI: Executes dotnet --list-sdks and parses output
User: "Which is LTS?"
AI: Executes dotnet --info and tries to parse support info
β
With Resources:
User: "What .NET versions do I have?"
AI: Reads dotnet://sdk-info resource (no execution needed)
Returns: .NET 8.0 (LTS), .NET 9.0 (STS), .NET 10.0 (LTS)
User: "Which is LTS?"
AI: Already knows from resource metadata - .NET 8.0, .NET 10.0
Example: Creating a Blazor project with authentication
β Without MCP:
AI: "I'll run: dotnet new blazor --auth Individual"
Result: Error - template 'blazor' doesn't support --auth parameter
β
With MCP:
AI: Uses dotnet_sdk with action: "TemplateInfo" for 'blazor'
Sees available parameters: --interactivity, --use-program-main, --empty
Uses dotnet_sdk with action: "SearchTemplates" to find authentication templates
AI: "I'll create a Blazor Web App with authentication using the correct template..."
Result: Success - uses 'blazor' template with proper authentication configuration
β¨ Consistent Results
The MCP server uses official .NET SDK APIs and CLI commands, ensuring:
- Accurate template information from the Template Engine
- Reliable command execution
- Proper error handling and validation
π Secure by Design