{"id":47188010,"url":"https://github.com/marcelroozekrans/roslyn-codelens-mcp","last_synced_at":"2026-04-30T21:00:37.725Z","repository":{"id":342567686,"uuid":"1174291587","full_name":"MarcelRoozekrans/roslyn-codelens-mcp","owner":"MarcelRoozekrans","description":"Roslyn-based MCP server providing semantic code intelligence for .NET codebases — type hierarchies, call sites, DI registrations, and reflection usage for Claude Code","archived":false,"fork":false,"pushed_at":"2026-04-30T17:58:12.000Z","size":1124,"stargazers_count":8,"open_issues_count":3,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-30T18:17:10.571Z","etag":null,"topics":["claude-code","code-analysis","dotnet","mcp","roslyn"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarcelRoozekrans.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-06T09:23:01.000Z","updated_at":"2026-04-30T17:57:58.000Z","dependencies_parsed_at":"2026-04-02T18:02:23.806Z","dependency_job_id":null,"html_url":"https://github.com/MarcelRoozekrans/roslyn-codelens-mcp","commit_stats":null,"previous_names":["marcelroozekrans/roslyn-codegraph-mcp","marcelroozekrans/roslyn-codelens-mcp"],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/MarcelRoozekrans/roslyn-codelens-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelRoozekrans%2Froslyn-codelens-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelRoozekrans%2Froslyn-codelens-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelRoozekrans%2Froslyn-codelens-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelRoozekrans%2Froslyn-codelens-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcelRoozekrans","download_url":"https://codeload.github.com/MarcelRoozekrans/roslyn-codelens-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelRoozekrans%2Froslyn-codelens-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32476682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","code-analysis","dotnet","mcp","roslyn"],"created_at":"2026-03-13T10:07:09.162Z","updated_at":"2026-04-30T21:00:37.718Z","avatar_url":"https://github.com/MarcelRoozekrans.png","language":"C#","funding_links":["https://github.com/sponsors/MarcelRoozekrans"],"categories":[],"sub_categories":[],"readme":"# Roslyn CodeLens MCP Server\n\n[![NuGet](https://img.shields.io/nuget/v/RoslynCodeLens.Mcp?style=flat-square\u0026logo=nuget\u0026color=blue)](https://www.nuget.org/packages/RoslynCodeLens.Mcp)\n[![NuGet Downloads](https://img.shields.io/nuget/dt/RoslynCodeLens.Mcp?style=flat-square\u0026color=green)](https://www.nuget.org/packages/RoslynCodeLens.Mcp)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/MarcelRoozekrans/roslyn-codelens-mcp/ci.yml?branch=main\u0026style=flat-square\u0026logo=github)](https://github.com/MarcelRoozekrans/roslyn-codelens-mcp/actions)\n[![License](https://img.shields.io/github/license/MarcelRoozekrans/roslyn-codelens-mcp?style=flat-square)](https://github.com/MarcelRoozekrans/roslyn-codelens-mcp/blob/main/LICENSE)\n[![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue?style=flat-square)](https://marcelroozekrans.github.io/roslyn-codelens-mcp/)\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/MarcelRoozekrans?style=flat\u0026logo=githubsponsors\u0026color=ea4aaa\u0026label=Sponsor)](https://github.com/sponsors/MarcelRoozekrans)\n\nA Roslyn-based MCP server that gives AI agents deep semantic understanding of .NET codebases — type hierarchies, call graphs, DI registrations, diagnostics, refactoring, and more.\n\n\u003ca href=\"https://glama.ai/mcp/servers/MarcelRoozekrans/roslyn-codelens-mcp\"\u003e\n  \u003cimg width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/MarcelRoozekrans/roslyn-codelens-mcp/badge\" alt=\"roslyn-codelens-mcp MCP server\" /\u003e\n\u003c/a\u003e\n\n\u003c!-- mcp-name: io.github.MarcelRoozekrans/roslyn-codelens --\u003e\n\n---\n\n## Hosted deployment\n\nA hosted deployment is available on [Fronteir AI](https://fronteir.ai/mcp/marcelroozekrans-roslyn-codelens-mcp).\n\n## Features\n\n- **find_implementations** — Find all classes/structs implementing an interface or extending a class\n- **find_callers** — Find every call site for a method, property, or constructor\n- **find_event_subscribers** — Every += / -= site for an event symbol, with resolved handler and subscribe/unsubscribe tag\n- **find_tests_for_symbol** — List xUnit/NUnit/MSTest methods that exercise a production symbol; opt-in transitive walk through helpers\n- **find_uncovered_symbols** — Public methods and properties no test transitively reaches; sorted by cyclomatic complexity for prioritization\n- **get_type_hierarchy** — Walk base classes, interfaces, and derived types\n- **get_di_registrations** — Scan for DI service registrations\n- **get_project_dependencies** — Get the project reference graph\n- **get_symbol_context** — One-shot context dump for any type\n- **get_public_api_surface** — Enumerate every public/protected type and member in production projects; flat, deterministically-sorted list suitable for API review or breaking-change baselines.\n- **find_breaking_changes** — Diff the current API against a baseline JSON or DLL; report removed members, kind changes, and accessibility changes with Breaking/NonBreaking severity.\n- **find_reflection_usage** — Detect dynamic/reflection-based usage\n- **find_references** — Find all references to any symbol (types, methods, properties, fields, events)\n- **go_to_definition** — Find the source file and line where a symbol is defined\n- **get_diagnostics** — List compiler errors, warnings, and Roslyn analyzer diagnostics\n- **get_code_fixes** — Get available code fixes with structured text edits for any diagnostic\n- **search_symbols** — Fuzzy workspace symbol search by name\n- **get_nuget_dependencies** — List NuGet package references per project\n- **find_attribute_usages** — Find types and members decorated with a specific attribute\n- **find_circular_dependencies** — Detect cycles in project or namespace dependency graphs\n- **get_complexity_metrics** — Cyclomatic complexity analysis per method\n- **find_naming_violations** — Check .NET naming convention compliance\n- **find_async_violations** — Sync-over-async, `async void` misuse, missing awaits, fire-and-forget tasks; per-violation report with severity\n- **find_disposable_misuse** — `IDisposable`/`IAsyncDisposable` instances not wrapped in `using`/`await using`/returned/assigned to field; severity error/warning per violation.\n- **find_large_classes** — Find oversized types by member or line count\n- **find_god_objects** — Types combining high size with high cross-namespace coupling; sharper signal than raw size for SRP violations\n- **find_unused_symbols** — Dead code detection via reference analysis\n- **get_project_health** — Composite audit aggregating 7 quality dimensions per project (complexity, large classes, naming, unused symbols, reflection, async violations, disposable misuse) with counts and top-N hotspots inline\n- **get_source_generators** — List source generators and their output per project\n- **get_generated_code** — Inspect generated source code from source generators\n- **inspect_external_assembly** — Browse types, members, and XML docs from closed-source NuGet packages and referenced assemblies\n- **peek_il** — Decompile any method to ilasm-style IL bytecode from closed-source or generated assemblies\n- **get_code_actions** — Discover available refactorings and fixes at any position (extract method, rename, inline variable, and more)\n- **apply_code_action** — Execute any Roslyn refactoring by title, with preview mode (returns a diff before writing to disk)\n- **list_solutions** — List all loaded solutions and which one is currently active\n- **set_active_solution** — Switch the active solution by partial name (all subsequent tools operate on it)\n- **load_solution** — Load an additional .sln/.slnx at runtime and make it the active solution\n- **unload_solution** — Unload a loaded solution to free memory\n- **rebuild_solution** — Force a full reload of the analyzed solution\n- **analyze_data_flow** — Variable read/write/capture analysis within a statement range (declared, read, written, always assigned, captured, flows in/out)\n- **analyze_control_flow** — Branch/loop reachability analysis within a statement range (start/end reachability, return statements, exit points)\n- **analyze_change_impact** — Show all files, projects, and call sites affected by changing a symbol — combines find_references and find_callers\n- **get_type_overview** — Compound tool: type context + hierarchy + file diagnostics in one call\n- **analyze_method** — Compound tool: method signature + callers + outgoing calls in one call\n- **get_call_graph** — Transitive caller/callee graph for a method, depth-bounded with cycle detection\n- **get_file_overview** — Compound tool: types defined in a file + file-scoped diagnostics in one call\n\n## External Assemblies\n\nMetadata-origin symbols (from NuGet packages and referenced assemblies) are first-class citizens:\n\n- **Tier 1 — Navigation** (`find_references`, `find_callers`, `find_implementations`): Accepts closed-source type and member names. Resolves them from assembly metadata and reports all source-level usage sites.\n- **Tier 2 — Inspection** (`inspect_external_assembly`): Browse namespaces, types, members, and XML doc comments from any referenced assembly without decompiling.\n- **Tier 3 — IL** (`peek_il`): Decompile a specific method to annotated ilasm-style IL using ICSharpCode.Decompiler — useful for understanding the internals of NuGet libraries.\n\nLocation-returning results include an `Origin` field (`source` or `metadata`) and an `IsGenerated` flag to distinguish hand-written code from closed-source or generated output.\n\n## Quick Start\n\n### VS Code / Visual Studio (via dnx)\n\nAdd to your MCP settings (`.vscode/mcp.json` or VS settings):\n\n```json\n{\n  \"servers\": {\n    \"roslyn-codelens\": {\n      \"type\": \"stdio\",\n      \"command\": \"dnx\",\n      \"args\": [\"RoslynCodeLens.Mcp\", \"--yes\"]\n    }\n  }\n}\n```\n\n### Claude Code Plugin\n\n```bash\nclaude install gh:MarcelRoozekrans/roslyn-codelens-mcp\n```\n\n### .NET Global Tool\n\n```bash\ndotnet tool install -g RoslynCodeLens.Mcp\n```\n\nThen add to your MCP client config:\n\n```json\n{\n  \"mcpServers\": {\n    \"roslyn-codelens\": {\n      \"command\": \"roslyn-codelens-mcp\",\n      \"args\": [],\n      \"transport\": \"stdio\"\n    }\n  }\n}\n```\n\n## Usage\n\nThe server automatically discovers `.sln` files by walking up from the current directory. You can also pass one or more solution paths directly:\n\n```bash\n# Single solution\nroslyn-codelens-mcp /path/to/MySolution.sln\n\n# Multiple solutions — switch between them with set_active_solution\nroslyn-codelens-mcp /path/to/A.sln /path/to/B.sln\n```\n\nWhen multiple solutions are loaded, use `list_solutions` to see what's available and `set_active_solution(\"B\")` to switch context. The first path is active by default.\n\n## Performance\n\nAll type lookups use pre-built reverse inheritance maps, member indexes, and attribute indexes for O(1) access. Benchmarked on an i9-12900HK with .NET 10.0.7:\n\n| Tool | Latency | Memory |\n|------|--------:|-------:|\n| `go_to_definition` | 2.1 µs | 576 B |\n| `find_implementations` | 2.5 µs | 720 B |\n| `get_project_dependencies` | 2.8 µs | 1.5 KB |\n| `get_type_hierarchy` | 3.5 µs | 1.3 KB |\n| `find_circular_dependencies` | 3.7 µs | 2.7 KB |\n| `get_symbol_context` | 4.1 µs | 1.0 KB |\n| `get_source_generators` | 16 µs | 23 KB |\n| `analyze_data_flow` | 19 µs | 1.6 KB |\n| `find_attribute_usages` | 72 µs | 904 B |\n| `get_generated_code` | 78 µs | 24 KB |\n| `analyze_control_flow` | 115 µs | 14 KB |\n| `inspect_external_assembly` (summary) | 159 µs | 35 KB |\n| `find_large_classes` | 265 µs | 3.5 KB |\n| `get_di_registrations` | 478 µs | 16 KB |\n| `inspect_external_assembly` (namespace) | 564 µs | 259 KB |\n| `find_reflection_usage` | 705 µs | 19 KB |\n| `get_complexity_metrics` | 781 µs | 25 KB |\n| `get_code_actions` | 792 µs | 54 KB |\n| `get_file_overview` | 797 µs | 101 KB |\n| `get_diagnostics` | 822 µs | 99 KB |\n| `get_nuget_dependencies` | 849 µs | 48 KB |\n| `get_public_api_surface` | 885 µs | 247 KB |\n| `get_type_overview` | 1.1 ms | 104 KB |\n| `peek_il` | 1.1 ms | 34 KB |\n| `find_disposable_misuse` | 3.5 ms | 286 KB |\n| `find_uncovered_symbols` | 3.8 ms | 224 KB |\n| `search_symbols` | 3.9 ms | 557 KB |\n| `analyze_method` | 5.8 ms | 333 KB |\n| `find_async_violations` | 7.0 ms | 335 KB |\n| `find_tests_for_symbol` (direct) | 8.4 ms | 396 KB |\n| `find_callers` | 10 ms | 337 KB |\n| `find_tests_for_symbol` (transitive) | 12 ms | 399 KB |\n| `find_naming_violations` | 15 ms | 788 KB |\n| `find_unused_symbols` | 23 ms | 1.0 MB |\n| `find_references` | 28 ms | 1013 KB |\n| `analyze_change_impact` | 33 ms | 1.3 MB |\n| Solution loading (one-time) | ~4.1 s | 16 MB |\n\n## Hot Reload\n\nThe server watches `.cs`, `.csproj`, `.props`, and `.targets` files for changes. When a change is detected, affected projects are lazily re-compiled on the next tool query — only stale projects and their downstream dependents are re-compiled, not the full solution.\n\nLocation-returning tools include an `IsGenerated` flag to distinguish source-generator output from hand-written code.\n\n## Requirements\n\n- .NET 10 SDK\n- A .NET solution with compilable projects\n\n## Development\n\n```bash\ndotnet build\ndotnet test\ndotnet run --project benchmarks/RoslynCodeLens.Benchmarks -c Release\n```\n\n## Third-party licenses\n\n- [ICSharpCode.Decompiler](https://github.com/icsharpcode/ILSpy) — MIT license (v8+). Used for IL disassembly in the `peek_il` tool.\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelroozekrans%2Froslyn-codelens-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcelroozekrans%2Froslyn-codelens-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelroozekrans%2Froslyn-codelens-mcp/lists"}