Enables AI assistants to create projects, manage NuGet packages, run builds, and execute .NET SDK commands through natural language.
Also known as jongalloway/dotnet-mcp, dotnet-mcp
- Stars
- 39
- Tools
- 9
- Downloads, 30 days
- —
- Latest version
- 1.1.2
- Last commit
- Nov 9, 2026
- License
- MIT
What is NET SDK MCP?
NET SDK enables AI assistants to create projects, manage NuGet packages, run builds, and execute .NET SDK commands through natural language. It exposes 9 tools, such as dotnet_sdk_query, dotnet_project_query, dotnet_server_metrics_query.
Summary generated from the project's README
About NET SDK MCP server
Developers working with the .NET ecosystem can use this server to connect AI assistants like Claude or GitHub Copilot directly to the .NET SDK. By translating natural language into structured commands, it allows an AI to manage the entire development lifecycle, from creating new projects to managing NuGet packages and running builds. It operates locally on your machine via the Model Context Protocol, requiring the .NET 10 or 11 SDK for quick installation through dnx.
Unlike standard CLI execution, this server provides the AI with deep environmental intelligence. It exposes structured resources such as sdk-info, runtime-info, and a complete catalog of installed templates. This prevents the AI from guessing parameters or suggesting incompatible framework versions. The server also includes enhanced diagnostics for 52 common error codes, providing plain English explanations and links to official documentation to help resolve build or package issues quickly.
What you can do with it
- 1Automated Project CreationAsk your AI assistant to scaffold a new web API or Blazor project using specific templates and parameters.
- 2NuGet Package ManagementHave the AI search for, add, or update specific libraries within your solution.
- 3Environment IntelligenceQuery the AI to find out which .NET versions and LTS frameworks are currently installed on your system.
- 4Error TroubleshootingUse the server to receive detailed explanations and suggested fixes when a build fails.
Written from the project's README. Every use case is checked against a quote from it.
NET SDK MCP tools 9
Detected from the READMEdotnet_sdk_querydotnet_project_querydotnet_server_metrics_querydotnet_helpdotnet_server_capabilitiesdotnet_projectdotnet_packagedotnet_solutiondotnet_sdk
| dotnet_sdk_query | — | |
| dotnet_project_query | — | |
| dotnet_server_metrics_query | — | |
| dotnet_help | — | |
| dotnet_server_capabilities | — | |
| dotnet_project | — | |
| dotnet_package | — | |
| dotnet_solution | — | |
| dotnet_sdk | — |
Configuration
DOTNET_NOLOGOSuppress .NET logo and startup messages
DOTNET_SKIP_FIRST_TIME_EXPERIENCESkip .NET CLI first-time setup experience
| Name | Description | |
|---|---|---|
| DOTNET_NOLOGO | Suppress .NET logo and startup messages | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE | Skip .NET CLI first-time setup experience |
Automated checks
Ran Nov 12, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablePass
- Open source license (OSI)Pass
- Commit or release in the last yearPass
- Package name not close to a popular packageNot checked
- Remote endpoint uses HTTPSNot checked
- Destructive tools are labelledPass
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesNot checked
README
View on GitHub.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 the .NET 10 or .NET 11 SDK. Source builds require .NET 11 RC3 or a compatible GA SDK in the 11.0.1xx feature band.
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
dnxordotnet 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: truereturns 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.0when you only havenet10.0installed, 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
- Runs locally on your machine
- No data sent to external servers
- You control what commands execute
- Standard .NET security model applies
- Automatic secret redaction to protect sensitive information in CLI output
- Connection strings, passwords, and API keys are automatically redacted
- Implemented using optimized regular expressions with <1% performance overhead
- References Microsoft.Extensions.Compliance.Redaction for future integration
- Opt-out available with
unsafeOutput=truefor advanced debugging - Patterns include: database credentials, cloud provider keys, tokens, certificates, and more
- Performance impact is minimal and tested to complete within 500ms for 10,000 lines
- Optional MCP governance controls (preview)
- Uses
Microsoft.AgentGovernance.Extensions.ModelContextProtocolwhen enabled via configuration - Disabled by default to preserve existing behavior and compatibility
- Does not ship with a default enforced policy; provide your own policy file(s) when needed
- See
doc/mcp-governance.mdfor a samplemcp.yamlpolicy template - Sources:
- Agent Governance Toolkit repository: https://github.com/microsoft/agent-governance-toolkit
- Agent Governance Toolkit for .NET: https://github.com/microsoft/agent-governance-toolkit/tree/main/agent-governance-dotnet
- Announcement: https://devblogs.microsoft.com/dotnet/announcing-agent-governance-toolkit-mcp-extensions-for-dotnet/
- Configuration for startup scanning, policy-based tool authorization, and response sanitization uses the following shape:
- Uses
Governance startup limitation: Setting
McpGovernance:Enabledtotruewith the full tool catalog currently fails startup because the toolkit scanner rejects the existingdotnet_dev_certs.passwordinput property. The example below is not a working full-catalog workaround, and an allow policy does not bypass startup scanning. See the startup restriction and operating guidance. Leaving governance disabled permits ordinary server use but provides no governance enforcement.
"McpGovernance": {
"Enabled": true,
"DefaultAgentId": "did:mcp:anonymous",
"ServerName": "dotnet-mcp",
"PolicyPaths": ["/path/to/your/policies/mcp.yaml"]
}
How It Works
sequenceDiagram
participant User
participant AI as AI Assistant
participant MCP as .NET MCP Server
participant SDK as .NET SDK
User->>AI: "Create a console app called MyApp"
AI->>MCP: dotnet_project(action: "New", template: "console", name: "MyApp")
MCP->>SDK: dotnet new console -n MyApp
SDK-->>MCP: Project created successfully
MCP-->>AI: Structured result with output
AI-->>User: "I've created a new console app called MyApp"
The .NET MCP Server acts as an intelligent middleware that:
- Translates natural language requests into structured .NET SDK operations
- Validates parameters using official SDK metadata (templates, frameworks, packages)
- Executes commands safely with proper error handling
- Returns structured results that AI assistants can understand and explain
🧩 MCP C# SDK Features Used
dotnet-mcp uses the official MCP C# SDK and exercises a broad set of MCP features beyond basic tool invocation:
The server uses SDK 2.3.0, supports protocol 2026-07-28, and retains older stdio clients, including 2025-11-25. Async execution requires the new Tasks extension and per-request opt-in; legacy clients continue to call tools inline. See SDK compatibility for wire-protocol differences and governance configuration for the existing fail-closed catalog limitation.
Use dotnet_server_capabilities to discover the negotiated protocol and feature availability for the active request. On 2026-07-28, logging needs a per-request log level, and Sampling/Elicitation depend on the request's client capability metadata. These flags do not carry over from earlier requests. A no-connection snapshot reports implementation support, not a guarantee that a client can use each feature; see the capability contract.
| Feature | How dotnet-mcp uses it | Why |
|---|---|---|
| Resources | Exposes dotnet://sdk-info, dotnet://runtime-info, dotnet://templates, dotnet://frameworks, and dotnet://workspace as read-only MCP resources. |
Lets clients answer environment and workspace topology questions quickly without shelling out, and reduces token churn from repeated CLI discovery. |
| Prompts | Publishes reusable prompts such as create_new_webapi, add_package_and_restore, and run_tests_with_coverage. |
Gives MCP clients guided, discoverable workflows instead of rebuilding common prompt scaffolding from scratch. |
| Roots | Retains deprecated stdio Roots discovery to auto-detect a single project or solution when the client advertises Roots and the user omits an explicit path. | Improves out-of-box behavior in compatible IDE clients while preserving explicit-path precedence. |
| Sampling | Retains deprecated client-mediated Sampling for build and test failure summaries when advertised and supported by the transport. Roots/Sampling MRTR replacement is deferred. | Keeps intelligent diagnostics inside the MCP flow without requiring separate server-side model credentials; successful commands and unsupported clients retain their original output. |
| Elicitation | Confirms project Clean, solution Remove, actual EF DatabaseDrop, CertificateClean, SecretsRemove, and SecretsClear when supported, using native MRTR, legacy elicitation, or task input. See the confirmation policy. | Only accepted, checked confirmation proceeds. EF drops still require force=true; dry runs do not prompt. Clients without elicitation retain unprompted behavior, so confirmation is not an authorization boundary. |
| Progress notifications | Reports start/completion progress for long-running restore, build, test, publish, pack, tool, and workload operations. | Gives clients a better UX for slow operations and makes orchestration easier for agents that surface progress. |
| Tasks | Uses WithTasks with a hosting-owned, process-local in-memory store; tool handlers do not depend on storage. |
Opted-in 2026-07-28 calls support task creation, polling via tasks/get, input updates via tasks/update, and cancellation via tasks/cancel; ordinary calls remain inline. |
| Tools and tool metadata | Uses consolidated tools with rich metadata such as titles, categories, priorities, and action lists. | Improves discoverability, routing, and client-side presentation, especially in MCP-aware IDE integrations. |
| Prompt and resource completion | Implements a completion handler so clients can autocomplete prompt and resource argument values. | Makes guided workflows faster and reduces invalid argument entry in clients that support completion UX. |
| Icons and server metadata | Configures server-level icons plus per-tool IconSource, title, and descriptive metadata across the consolidated surface. |
Helps clients present the server and tool catalog more clearly, especially in visual MCP management UIs. |
Installation
Requirements
- For package installation: .NET 10 SDK or .NET 11 SDK (RC3 or later)
- For source builds: .NET SDK
11.0.100-rc.3.26522.148or a GA/servicing SDK in the 11.0.1xx feature band;global.jsonselects the latest installed compatible patch. Install the .NET 10 SDK alongside it to run both test targets. - Visual Studio Code, Visual Studio 2022 (v17.13+), or Claude Desktop
Runtime and SDK compatibility
One package contains net10.0 and net11.0 builds with the same MCP tool surface. .NET 10-only machines remain supported. The .NET 11 build uses RC3 Template Engine and Hosting packages; this does not add new .NET 11-only tools or change the default .NET 10 LTS project recommendation.
| Environment | Fresh installation with the selected SDK | Project support |
|---|---|---|
| .NET 10 only | .NET 10 tool assets and runtime | .NET 10 projects |
| .NET 11 RC3 only | .NET 11 tool assets and RC3 runtime | .NET 11 projects |
| .NET 10 and 11 RC3 side by side, .NET 11 SDK selected | .NET 11 tool assets and runtime | .NET 10 projects with a project-local .NET 10 SDK pin, and .NET 11 projects |
| .NET 11 GA only | Intended to use the unchanged RC3-built .NET 11 assets | GA-only execution is pending verification |
Tool asset selection follows the SDK used to install or launch the tool, not simply the highest runtime installed. A global.json can select an older SDK. Installing .NET 11 later does not retarget an existing .NET 10 tool installation; reinstall or update it using the desired SDK. For an explicit tool installation target, dotnet tool install also supports --framework net11.0.
Both dnx and a tool-path install were exercised against the same package on isolated .NET 10, RC3, and side-by-side installations. Neither required --allow-roll-forward. For a specific package version, use:
dnx Community.Mcp.DotNet@<exact-version> --yes
dotnet tool install Community.Mcp.DotNet@<exact-version> --tool-path ./tools
Replace <exact-version> with the desired published version. An exact prerelease version does not require --prerelease; floating prerelease selection does. Point MCP clients at the installed dotnet-mcp executable when using a tool-path install.
The package explicitly uses RollForward=Minor, keeping runtime resolution within the target major version. The RC3-built package's .NET 11 runtime floor is 11.0.0-rc.3.26522.148. RC3-to-GA is a same-major runtime transition, not a reason to require Major roll-forward. A compatible runtime must already be installed; roll-forward does not download one. CI automatically installs the GA SDK when published and verifies an unchanged RC3-built package on GA, while retaining exact-RC3 coverage. GA execution is pending until GA is available. A .NET 11-only build cannot run backward on .NET 10; the separate .NET 10 assets provide that support.
The server runtime and the SDK used for project commands are separate choices. Future SDK-specific CLI features should be checked against the selected project's SDK; only features using .NET 11-only in-process APIs need the .NET 11 server build.
Opt-in NativeAOT publishing (Windows x64)
The managed NuGet/dnx package remains the default distribution, with both net10.0 and net11.0 assets. To publish the MCP server itself as a native executable, use an x64 Windows machine with the source-build SDKs above and Visual Studio's Desktop development with C++ workload, including its Windows SDK:
pwsh -File .\scripts\publish-native.ps1
pwsh -File .\scripts\test-native.ps1
Configure an MCP client's stdio command as the absolute path to artifacts\native\win-x64\DotNetMcp.exe, with no dotnet run arguments. Copy the entire output directory, including sdk-helper, when deploying it. Native publishing is opt-in and currently supports only net11.0 / win-x64; it does not change ordinary builds or tool packaging.
The native process owns the complete MCP session: tools, resources, prompts, MCP Apps, Tasks, cancellation, and existing governance behavior. Template Engine loading and the nine MSBuild project-analysis/editing operations run in a narrow managed SDK helper, not a second MCP server. This is not an SDK-free or single-file distribution: a .NET 11 runtime is required for the helper, and installed .NET SDKs remain necessary for project commands. Projects can still select their SDK through global.json.
The validation script relocates the bundle and checks native PE/runtime identity, managed/native contract and SDK-operation parity, real stdio conformance, SDK 11 scenarios, and release gates. Transitive AOT analysis warnings, including governance's YamlDotNet dependency, remain visible; publishing is not a claim that arbitrary transitive reflection paths are AOT-safe. The existing fail-closed full-catalog governance restriction is unchanged. See native validation details.
Option 1: Quick Install (Recommended)
Use the install badges at the top of this page to automatically configure the MCP server in your environment. The server will be downloaded from NuGet.org on first use.
Option 2: Manual Configuration
Follow the instructions below for your specific development environment:
Visual Studio Code
Using Quick Install (recommended - .NET 10 required):
- Click the VS Code Install badge at the top of this page
- Or manually add via Command Palette: press
Ctrl+Shift+P(orCmd+Shift+Pon macOS), run "GitHub Copilot: Add MCP Server", then enter Namedotnet, Typestdio, Commanddnx, and ArgumentsCommunity.Mcp.DotNet@1.* --yes.
Manual Configuration (for source builds or custom setups):
Edit your VS Code settings (Ctrl+, or Cmd+,, search for "mcp"):
{
"github.copilot.chat.mcp.servers": {
"dotnet": {
"type": "stdio",
"command": "dotnet",
"args": ["run", "--framework", "net11.0", "--project", "/path/to/dotnet-mcp/DotNetMcp/DotNetMcp.csproj"]
}
}
}
NET SDK MCP questions
What tools does NET SDK MCP provide?
It exposes 9 tools, including dotnet_sdk_query, dotnet_project_query, dotnet_server_metrics_query, dotnet_help, dotnet_server_capabilities.
What can the AI assistant do with this server?
The AI can create new projects, manage NuGet packages, run builds, update packages, and search for templates and framework information.
Is my sensitive data safe when using this server?
Yes, the server includes automatic secret redaction for connection strings, passwords, and API keys in CLI output.
Can I use this as a library in my own .NET applications?
No, this package is designed exclusively as an MCP server for AI assistants and is not intended for programmatic consumption in other applications.
What version of the .NET SDK is required for quick install?
Quick installation requires the .NET 10 or .NET 11 SDK.