Dotnet MCP logo

Dotnet MCP

Compiler-aware .NET workspace navigation, XAML queries, generator attribution, diagnostics, and constrained code edits over MCP.

Install Dotnet MCP

Run the project’s own setup commands, in order.

Setup steps from the project

dotnet-mcp installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Start the server
    dotnet tool exec Skymly.DotNetMcp --yes -- --roots /path/to/repo
    
  2. 2. Install
    dotnet tool install -g Skymly.DotNetMcp
    
  3. 3. Start the server
    dotnet run --project src/DotNetMcp.Server -- --roots /path/to/repo
    
  4. 4. Start the server
    dotnet tool exec --source ./artifacts --yes Skymly.DotNetMcp -- --roots /path/to/repo
    

Overview

dotnet-mcp MCP server gives coding agents compiler-accurate access to .NET workspaces through Roslyn and F# tooling. It loads solutions or SDK-style projects, resolves symbols, traces references and callers, inspects source generators, queries Avalonia and MAUI XAML, and reports diagnostics. Rename, diagnostic fixes, and refactorings use a preview-then-apply workflow rather than unrestricted file writes. Reach for it when an agent needs structured understanding of a C#, VB.NET, F#, Avalonia, or MAUI codebase over stdio.

Use cases

  • Navigate symbols across a C# or VB.NET solution
  • Trace callers, references, implementations, and type hierarchies
  • Inspect source-generator output and attribution
  • Query Avalonia or MAUI XAML bindings and names
  • Preview and apply constrained renames or diagnostic fixes

Key features

  • Compiler-aware C#, VB.NET, and F# symbol navigation
  • Source-generator attribution and generated-source inspection
  • Avalonia and MAUI XAML resolution and diagnostics
  • Project diagnostics and dynamic-invocation queries
  • Preview-then-apply renames, fixes, and refactorings
  • Trusted-root workspace loading over stdio

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars6Stargazers on the source repository.
Last commit3d agoMost recent push to the default branch.

How Dotnet MCP works

What dotnet-mcp does

dotnet-mcp exposes .NET workspace analysis through the Model Context Protocol. It can load .sln, .slnx, .slnf, and SDK-style C#, VB.NET, or F# projects, then provide compiler-aware symbol operations instead of relying on text matching. Symbol handles are checksummed and can be used to locate definitions, members, references, implementations, callers, and type hierarchies.

The server also distinguishes handwritten members from source-generated members and reports generator assembly, type, and version details where supported. Project-level operations cover diagnostics, generator inventories, generated sources, generator diagnostics, and dynamic invocations. Avalonia .axaml and MAUI .xaml documents can be queried for classes, namespaces, names, compiled-binding paths, and diagnostics.

How it works

A typical session opens a workspace with workspace_open, checks workspace_status until the workspace is ready, and then resolves symbols before performing navigation or attribution. For large solutions, using an .slnf file or a single project can reduce the loading scope. The server reports warnings when solution-filter entries are duplicates or were already included transitively.

Write operations are deliberately staged. An agent lists available fixes or refactorings, previews the selected operation, and applies it only after reviewing the preview. Rename previews can include exact XAML usages for supported C# and VB symbols. Diagnostic and refactoring selections use an epoch, so an outdated index cannot silently select a different action.

The process communicates over stdio. Workspace roots must be supplied explicitly; the process working directory is not trusted automatically. --roots path and --roots=path are accepted, and multiple Windows roots use semicolon separation.

Setup and configuration

The NuGet package is Skymly.DotNetMcp, with the CLI command dnmcp. .NET 10 or newer is required. The preferred setup uses dnx:

bash
dnx Skymly.DotNetMcp --yes -- --roots /path/to/repo

A stdio MCP configuration can invoke the same package:

config.json
{
  "mcpServers": {
    "dnmcp": {
      "command": "dnx",
      "args": ["Skymly.DotNetMcp", "--yes", "--", "--roots", "/path/to/repo"]
    }
  }
}

dotnet tool exec or a global tool installation are alternatives. Developers working from a checkout can run the server project with dotnet run; local packages can be created with dotnet pack and executed from the resulting artifacts. DOTNET_MCP_TRUSTED_ROOTS can provide trusted roots in addition to command-line roots. If no roots are configured, startup exits with code 1 and emits a structured JSON error on stderr.

Tools and capabilities

The workspace group opens, monitors, lists, and checks project state. Symbol tools resolve names or source positions, summarize symbols, navigate definitions, return source, inspect members, find references and implementations, identify callers, build type hierarchies, attribute generators, and stage renames or refactorings.

Project tools expose diagnostics and source-generator information. Diagnostic tools list available fixes, preview them, and apply them, including project-level “Fix all” operations. XAML tools resolve classes, XML namespaces, names, binding paths, and diagnostics. Reference searches for C# and VB can merge exact XAML usages such as bindings, x:Class, element types, x:Name, and event handlers into the paged result stream.

Limitations and notes

The server is not a general file editor, shell, process runner, HTTP client, package downloader, or LSP proxy. It does not provide WPF or WinUI XAML support, extract-method or change-signature interfaces, or unrestricted create, delete, patch, or write operations.

F# support has narrower coverage. F# symbol searches include the defining project and F# dependents, or all F# projects when entireSolution is used. C# and VB consumers are named rather than searched. F# generator attribution, generator queries, dynamic-invocation queries, diagnostic fixes, code refactorings, and cross-language F# writes are unsupported.

Opening a repository evaluates MSBuild and runs project analyzers and generators, so untrusted repositories should not be opened without considering that execution behavior. Project diagnostics can be marked degraded when metadata references such as CS0006 or CS0012 fail to resolve; in that case, verify results with dotnet build before trusting fix previews.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Dotnet MCP

dotnet-mcp is an MCP server that connects coding agents to .NET workspaces containing C#, VB.NET, F#, Avalonia XAML, or MAUI XAML. Its main tools load projects, resolve and navigate compiler-accurate symbols, inspect generators and diagnostics, query XAML, and preview or apply restricted renames, fixes, and refactorings.

Install it from NuGet with `dnx Skymly.DotNetMcp --yes -- --roots /path/to/repo`. The package requires .NET 10 or newer. You can also use `dotnet tool exec`, install the tool globally, build it from source, or run a locally packed artifact.

Pass one or more roots with `--roots path`, or set `DOTNET_MCP_TRUSTED_ROOTS`. Command-line and environment roots are combined, and the process working directory is not trusted automatically. On Windows, separate multiple roots with semicolons.

Yes, dotnet-mcp supports F# project loading and symbol operations through an FCS-based stack. F# handles search the defining project and F# dependents, or every F# project with `entireSolution`; generator attribution, generator queries, dynamic invocation queries, diagnostic fixes, refactorings, and cross-language F# writes are not supported.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewDotnet MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/dotnet-mcp?style=directory)](https://allmcps.com/mcp/dotnet-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/dotnet-mcp"><img src="https://allmcps.com/api/badge/dotnet-mcp?style=directory" alt="Dotnet MCP on AllMCPs" /></a>