# dotnet-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/Skymly/dotnet-mcp  
**GitHub Stars:** 6  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/dotnet-mcp

## Description
.NET MCP server for C#/VB/F# symbols, Avalonia/MAUI XAML, source-generator attribution, and restricted workspace edits.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/Skymly/dotnet-mcp), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Start the server:

```sh
dotnet tool exec Skymly.DotNetMcp --yes -- --roots /path/to/repo
```

2. Install:

```sh
dotnet tool install -g Skymly.DotNetMcp
```

3. Start the server:

```sh
dotnet run --project src/DotNetMcp.Server -- --roots /path/to/repo
```

4. Start the server:

```sh
dotnet tool exec --source ./artifacts --yes Skymly.DotNetMcp -- --roots /path/to/repo
```

## Documentation

## 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:

```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.

_Full upstream README: https://allmcps.com/mcp/dotnet-mcp/readme_

