Darylmcd.RoslynMcp
2.3.5
dotnet tool install --global Darylmcd.RoslynMcp --version 2.3.5
dotnet new tool-manifest
dotnet tool install --local Darylmcd.RoslynMcp --version 2.3.5
#tool dotnet:?package=Darylmcd.RoslynMcp&version=2.3.5
nuke :add-package Darylmcd.RoslynMcp --version 2.3.5
Darylmcd.RoslynMcp
A production-usable Model Context Protocol (MCP) server providing semantic C# analysis powered by Roslyn — designed for AI coding agents to navigate, analyze, and refactor real C# solutions without requiring Visual Studio.
This package installs roslynmcp, a global .NET tool that runs the MCP server over stdio.
Source code, contributing guide, deep-dive design notes, and the full audit-driven backlog live on GitHub: https://github.com/darylmcd/Roslyn-Backed-MCP
Install
Requires the .NET 10 SDK.
dotnet tool install -g Darylmcd.RoslynMcp
This puts roslynmcp on your PATH. The CLI command is intentionally roslynmcp (not darylmcd-roslyn-mcp) so existing MCP client config keeps working — only the package id is author-prefixed because the unprefixed RoslynMcp id is owned by another publisher on nuget.org.
To update later:
dotnet tool update -g Darylmcd.RoslynMcp
Use it with an MCP client
The server speaks MCP over stdio. Point any stdio-capable MCP client at the roslynmcp command.
Cursor
Add to .cursor/mcp.json (project) or your user MCP settings:
{
"mcpServers": {
"roslyn-mcp": {
"command": "roslynmcp"
}
}
}
Claude Code (manual MCP config)
Add to your Claude Code MCP settings:
{
"mcpServers": {
"roslyn-mcp": {
"command": "roslynmcp"
}
}
}
Claude Code (plugin — recommended)
Claude Code also supports installing this server as a plugin with curated skills and safety hooks. The plugin is a thin layer on top of the same roslynmcp global tool — install the global tool first, then add the plugin:
/plugin marketplace add darylmcd/Roslyn-Backed-MCP
/plugin install roslyn-mcp@roslyn-mcp-marketplace
No further configuration is required; the server starts with the defaults listed in Configuration. To tune any ROSLYNMCP_* value, drop a project-scope .mcp.json at your repo root with literal env values — see docs/mcp-json-examples/ for copy-ready templates.
The plugin adds 32 bundled agent skills — including /roslyn-mcp:analyze, /roslyn-mcp:refactor, /roslyn-mcp:review, /roslyn-mcp:security, /roslyn-mcp:dead-code, /roslyn-mcp:test-coverage, /roslyn-mcp:migrate-package, /roslyn-mcp:explain-error, /roslyn-mcp:complexity, /roslyn-mcp:document, /roslyn-mcp:impact-assessment, /roslyn-mcp:refactor-loop, /roslyn-mcp:modernize, /roslyn-mcp:trace-flow, /roslyn-mcp:inheritance-explorer, and more — plus pre-apply safety hooks that block *_apply calls without a matching *_preview. See the GitHub README for the full skill catalogue.
VS Code (and other stdio MCP clients)
Any stdio-capable MCP client uses the same command:
{
"mcpServers": {
"roslyn-mcp": {
"command": "roslynmcp"
}
}
}
What's in the box
Catalog 2026.04 ships 173 tools (113 stable / 60 experimental), 14 resources (9 stable / 5 experimental), and 20 prompts (all experimental). Use server_info and roslyn://server/catalog for the authoritative live surface; the categories below are a quick orientation.
| Family | Highlights |
|---|---|
| Workspace | workspace_load, workspace_status, workspace_readiness_report, workspace_support_bundle, workspace_list, project_graph, source-generated documents — workspace tools default to lean summary/readiness payloads and offer verbose=true opt-in on status/load for the full per-project tree. |
| Symbol navigation | find_references, find_implementations, find_overrides, goto_definition, symbol_search, find_consumers, find_type_usages, type_hierarchy, callers_callees, impact_analysis. Major semantic tools accept a symbolHandle from prior search/info calls — pass it instead of file/line to disambiguate overloads and partial classes. |
| Diagnostics | project_diagnostics, compile_check (in-memory, with optional emit validation), diagnostic_details, security_diagnostics, nuget_vulnerability_scan, list_analyzers. |
| Refactoring (preview / apply) | rename_*, extract_interface_*, extract_type_*, move_type_to_file_*, bulk_replace_type_*, code_fix_*, fix_all_*, format_document_*, organize_usings_*, split_class_*, dead-code removal. |
| Build / test | build_workspace, build_project, test_discover, test_run, test_related, test_related_files, test_coverage. |
| Cohesion / complexity | get_cohesion_metrics (LCOM4, source-gen aware), get_complexity_metrics, find_unused_symbols, find_type_mutations (with MutationScopes for IO/Network/Process/Database side effects; compound mutations report every applicable scope). |
| Flow analysis | analyze_data_flow, analyze_control_flow — supports both statement-bodied and => expr expression-bodied members. |
| Snippets / scripting | analyze_snippet, evaluate_csharp (with configurable script timeout). |
| Resources | roslyn://server/catalog, roslyn://workspaces, roslyn://workspace/{id}/status (lean summary defaults; /verbose siblings for full payloads), roslyn://workspace/{id}/projects, roslyn://workspace/{id}/diagnostics, roslyn://workspace/{id}/file/{filePath}. |
Every reader and writer response carries _meta.elapsedMs, _meta.queuedMs, and _meta.heldMs so concurrency audits can compute speedup ratios from inside the agent loop without external instrumentation.
Configuration
All variables below are optional. The server starts with the defaults listed when no value is set — no per-user or per-install configuration step is required. Override by adding an env block to a project-scope .mcp.json at your repo root (see docs/mcp-json-examples/with-overrides.mcp.json for a copy-ready template) or to your MCP client's server config.
| Variable | Default | Purpose |
|---|---|---|
ROSLYNMCP_MAX_WORKSPACES |
8 |
Maximum concurrent workspace sessions |
ROSLYNMCP_BUILD_TIMEOUT_SECONDS |
300 |
Build operation timeout |
ROSLYNMCP_TEST_TIMEOUT_SECONDS |
600 |
Test run timeout |
ROSLYNMCP_VULN_SCAN_TIMEOUT_SECONDS |
120 |
NuGet vulnerability scan timeout |
ROSLYNMCP_PREVIEW_MAX_ENTRIES |
20 |
Preview store entries per store |
ROSLYNMCP_PREVIEW_TTL_MINUTES |
5 |
Preview store entry lifetime |
ROSLYNMCP_RATE_LIMIT_MAX_REQUESTS |
120 |
Per-window request count |
ROSLYNMCP_RATE_LIMIT_WINDOW_SECONDS |
60 |
Rate limit window |
ROSLYNMCP_REQUEST_TIMEOUT_SECONDS |
120 |
Per-request timeout |
ROSLYNMCP_SCRIPT_TIMEOUT_SECONDS |
10 |
evaluate_csharp budget |
Example MCP client config with overrides:
{
"mcpServers": {
"roslyn-mcp": {
"command": "roslynmcp",
"env": {
"ROSLYNMCP_MAX_WORKSPACES": "4",
"ROSLYNMCP_BUILD_TIMEOUT_SECONDS": "120"
}
}
}
}
Security
This server executes MSBuild evaluation when loading .sln and .csproj files. MSBuild project files can contain arbitrary build targets, tasks, and imports that run native code during evaluation:
- Only load solutions you trust. A malicious
.csprojcan execute arbitrary code with the permissions of the server process. - Run in a sandbox for untrusted code. If you need to analyze untrusted repositories, run the server inside a container, VM, or other isolation boundary.
- Path validation is enforced against MCP client roots when available, including symlink/junction resolution — but this is defense-in-depth, not a substitute for trusting the workspace content.
See SECURITY.md for the vulnerability disclosure policy.
Privacy
This server runs entirely on your local machine and does not collect, transmit, or store any telemetry, analytics, or personal data.
- Data processed:
.sln,.csproj, and.csfiles from workspaces you explicitly load. All analysis happens in-process via Roslyn. - Network access: None from the server itself.
dotnet build/dotnet testchild processes may download NuGet packages as part of normal SDK behavior. - Data retention: Workspace state is in-memory only; preview tokens expire after 5 minutes. No data is persisted to disk beyond what
dotnet build/testproduce. - Logging: Diagnostic logs are emitted via MCP's logging notification channel to the connected client. No logs are written to disk or sent to external services.
- Third-party sharing: No data is shared with Anthropic, any third party, or any external service.
Cross-platform notes
Runs on Windows, macOS, and Linux wherever the .NET 10 SDK is available.
- MSBuild locator: Uses
Microsoft.Build.Locatorto find the SDK. On Linux/macOS, ensuredotnetis onPATHor setDOTNET_ROOT. - File watchers:
FileSystemWatcherreliability varies by OS and filesystem. NFS and some container-mounted volumes may not emit change events. - Process management:
dotnet buildanddotnet testchild processes useProcess.Kill(entireProcessTree: true)on cancellation, which requiresSIGKILLsupport on Unix (available on all modern distributions). - Symlinks: Path validation resolves symlinks and junctions before comparison; behavior varies between NTFS junctions on Windows and POSIX symlinks on Unix.
Links
- Source code, contributing, design notes: https://github.com/darylmcd/Roslyn-Backed-MCP
- Bug reports & feature requests: https://github.com/darylmcd/Roslyn-Backed-MCP/issues
- Changelog: https://github.com/darylmcd/Roslyn-Backed-MCP/blob/main/CHANGELOG.md
- Security disclosure: https://github.com/darylmcd/Roslyn-Backed-MCP/blob/main/SECURITY.md
License
MIT — see LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.3.5 | 34 | 6/19/2026 |
| 2.3.4 | 51 | 6/18/2026 |
| 2.3.3 | 101 | 6/8/2026 |
| 2.3.2 | 106 | 6/1/2026 |
| 2.3.1 | 94 | 5/30/2026 |
| 2.3.0 | 105 | 5/26/2026 |
| 2.2.2 | 99 | 5/21/2026 |
| 2.2.1 | 95 | 5/21/2026 |
| 2.2.0 | 91 | 5/20/2026 |
| 2.1.0 | 95 | 5/19/2026 |
| 2.0.0 | 96 | 5/19/2026 |
| 1.40.0 | 100 | 5/18/2026 |
| 1.39.0 | 100 | 5/17/2026 |
| 1.38.1 | 103 | 5/13/2026 |
| 1.36.0 | 98 | 5/12/2026 |
| 1.35.3 | 99 | 5/11/2026 |
| 1.35.2 | 115 | 5/10/2026 |
| 1.35.1 | 97 | 5/10/2026 |
| 1.35.0 | 108 | 5/9/2026 |
| 1.34.2 | 96 | 5/7/2026 |