.NET MCP Server — Claude Code MCP server: setup guide
Connects AI assistants directly to the .NET SDK to scaffold solutions, install NuGet packages, and inspect build diagnostics via structured MCP tools.
Open on GitHubWhat .NET MCP Server does
The server links AI coding assistants to the .NET SDK using predefined tool schemas. Instead of scraping console text, the assistant receives structured JSON payloads. This cuts down token usage.
Built-in resources expose environment details like dotnet://sdk-info, dotnet://templates, and dotnet://workspace. It includes enriched diagnostics for 52 compiler and tooling error codes across CS, MSB, NU, and NETSDK categories, providing direct links to Microsoft documentation.
The package works only as an MCP server, not as a general library. Launching it via dnx requires the .NET 10 SDK.
What it helps with
- Scaffold new .NET projects using local templates without typing CLI arguments
- Search and add NuGet packages directly from the assistant chat
- Diagnose 52 build and project error codes with suggested resolutions
- Inspect local SDK versions and workspace layout through structured resources
Example prompts for the agent
- Create a new ASP.NET Core Web API project configured with EF Core
- Search NuGet for Serilog and install it into the current project
- List all installed .NET SDKs and active workspace projects
How to install .NET MCP Server
Install
The MCP registry has no launch command for it: see the repository README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about .NET MCP Server
How to install .NET MCP Server in Claude Code?
Configure your client to run the dnx command with Community.Mcp.DotNet@1.* and --yes as arguments. This quick setup requires the .NET 10 SDK on your system.
What does .NET MCP Server do?
It gives AI assistants direct access to the .NET SDK, project templates, and NuGet package search over the Model Context Protocol. Tool outputs return structured JSON instead of raw terminal text.
Can this package be referenced as a regular C# library?
No, the package is built solely to run as an MCP server via dnx or dotnet run. It is not designed to be imported as an application library.