roslyn-mcp-overview

roslyn-mcp-overview is a cursor rule for Cursor from VuDZ/RoslynMcpServer. It costs 1,205 tokens per session, scanned A, original, MIT.

An architecture guide for a C# MCP server that analyses code with Roslyn and can decompile .NET assemblies. Roslyn is Microsoft's C# compiler and code-analysis platform; decompiling means turning compiled code back into readable code.

In plain words
What is it for?
Use it when locating tools, services, diagnostics, tests, dependency-injection setup, logs, package details, or the server's supported runtime and deployment layout.
Why use it?
It gives contributors a map of the project and its service-registration rules, so they do not create duplicate workspaces, hard-code machine paths, or place tools in the wrong layer.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions AGENTS.md.

Good fit Use it when locating tools, services, diagnostics, tests, dependency-injection setup, logs, package details, or the server's supported runtime and deployment layout.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/vudz/roslynmcpserver/roslyn-mcp-overview
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/VuDZ/RoslynMcpServer

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for roslyn-mcp-overview

README.md
[![agentmods](https://agentmods.dev/badge/rules/vudz/roslynmcpserver/roslyn-mcp-overview/github.svg)](https://agentmods.dev/rules/vudz/roslynmcpserver/roslyn-mcp-overview)
Your own site
<a href="https://agentmods.dev/rules/vudz/roslynmcpserver/roslyn-mcp-overview"><img src="https://agentmods.dev/badge/rules/vudz/roslynmcpserver/roslyn-mcp-overview/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for roslyn-mcp-overview

Your own site · 80×15
<a href="https://agentmods.dev/rules/vudz/roslynmcpserver/roslyn-mcp-overview"><img src="https://agentmods.dev/badge/rules/vudz/roslynmcpserver/roslyn-mcp-overview.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,205 This file is loaded in full into every session.
When invoked 1,205 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01205 $0.01205
Opus 5 $0.00602 $0.00602
Sonnet 5 $0.00241 $0.00241
Haiku 4.5 $0.00120 $0.00120

Measured 2d ago against content hash e4172684c8e5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-16, from the pricing page.

Security

Grade A, and why

roslyn-mcp-overview scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/roslyn-mcp-overview.mdc · 52 lines

How it starts

The opening of the file, as written. The whole thing — 52 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RoslynMcpServer overview

MCP server (stdio) for C# analysis: Roslyn workspaces + ILSpy decompile. TFM net10.0, version in RoslynMcpServer.csproj (currently 1.1.0). Package id SampleMcpServer. Self-contained publish for win/osx/linux RIDs.

Layout

  • Program.cs — MSBuild bootstrap, optional ROSLYN_MCP_WORKSPACE → cwd, Serilog to logs/mcp-*.log under AppContext.BaseDirectory
  • Hosting/ — DI (AddRoslynMcpServerTools), McpToolRegistry
  • Tools/ — MCP tool classes (Workspace, CodeAnalysis, Skeleton, Build, Run, Test, NuGet, Utility, …)
  • Services/SolutionManager, decompile/resolve, DotNet CLI, health
  • Diagnostics/ — parsers (build, VSTest, NuGet audit), SDK mismatch, MSBuild locator
  • RoslynMcpServer.Tests/ — xUnit; InternalsVisibleTo
  • Docs: README.md (EN+RU), AGENTS.md.sample (copy to app repos as AGENTS.md)

DI / tools

Tools are singletons registered in RoslynMcpServiceCollectionExtensions. Inject SolutionManager — do not new workspaces/HTTP. Heavy services via constructor.

Real-world validation often uses BrqMover (c:\Devel\BrqMover) — app repo with its own AGENTS.md; do not hardcode that path into this repo’s docs/rules.

Version history (agent-relevant)

  • 1.1.0 — disk watcher: saved .cs (IDE/git) sync into MSBuildWorkspace before symbol search; no keystroke/unsaved buffers; .csproj changes skip load cache, not OpenSolutionAsync from the watcher
  • 1.0.35 — Roslyn 5.9.0; dedicated VS 2026 / MSBuild 18 BuildHost (XMakeElements) load/symbol failure (not SDK mismatch)
  • 1.0.34load_workspace: wrapped design-time MSBuild warnings (ASPDEPR007 / IncludeOpenAPIAnalyzers, MSB3270, analyzer metadata refs) are warnings, not hard Failure
  • 1.0.33load_workspace optional targetFramework (inner TFM for CrossTargeting / TargetFrameworks); dedicated missing-Compile load report
  • 1.0.32run_specific_test: VSTest Passed/Failed lines accept [1 s] / [1 m 28 s] durations (not only ms)
  • 1.0.31run_dotnet_test / run_specific_test: separate incremental dotnet build then dotnet test --no-build (parser sees test output only)
  • 1.0.30apply_patch replaceAll: advance past inserted text (hang when newString contains oldString)
  • 1.0.29load_workspace optional Configuration/Platform (cached for build/test); empty-TFM ResolvePackageAssets dedicated fail
  • 1.0.28run_dotnet_test: infer Passed when .slnx VSTest omits the Passed: line
  • 1.0.27load_workspace: NU1701 / TFM-compat restore warnings soft (not fatal); Msbuild failed wrapper word failed is not blocking by itself
  • 1.0.26 — agent diagnostics: client-abort load_workspace, empty get_test_list, run_specific_test path/filter mismatch hints
  • 1.0.25run_dotnet_build: default --no-incremental; effective exit = last build step (restore cannot mask)
  • 1.0.22run_specific_test: VSTest-safe method filters (~, no (), no bogus leading . on dotted FQNs)
  • 1.0.21load_workspace: NuGet prune / unused PackageReference advisories soft (warnings), not hard Failure
  • 1.0.20 — optional configuration (-c) on run_dotnet_build / run_dotnet_test / run_specific_test
  • 1.0.19.slnx accepted by load_workspace / build / test / discovery (prefer solution files for multi-config)
  • 1.0.18 — tool [Description] accuracy pass (build probe, decompile resolve, NuGet timeouts, AST params)
  • 1.0.17run_dotnet_test / run_specific_test optional noBuild / noRestore
  • 1.0.15search_code caseSensitive; no-workspace candidate paths; rename_project; branding recipe in AGENTS
  • 1.0.14run_dotnet_run, run_nuget_audit, get_changed_files, workspace health on load_workspace
  • 1.0.13 — exact assembly resolve (deps.json + NuGet), no fuzzy Contains
  • 1.0.10+ — SDK pin from global.json, build probe, VSTest parser, MCP_MSBUILD_SDK_MISMATCH

Read the full file on GitHub · 52 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 52 lines · 1,205 tokens per session scan A e4172684c8e5

Subscribe to this mod's changes

roslyn-mcp-overview is a cursor rule published in the GitHub repository VuDZ/RoslynMcpServer (7 stars, last pushed yesterday), licensed MIT. It adds 1,205 tokens to every session, about $0.0060 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-14.