๐ DotNetAnalyzer
A powerful MCP (Model Context Protocol) server tool that brings Roslyn's code analysis capabilities to Claude Code.
๐ Quick Start
Prerequisites
Installation
Method 1: Install from NuGet (Recommended) โจ
DotNetAnalyzer has been published to NuGet.org!
dotnet tool install --global DotNetAnalyzer
dotnet-analyzer --version
dotnet-tool list --global
NuGet package information:
Method 2: Build from source
git clone https://github.com/CartapenaBark/DotNetAnalyzer.git
cd DotNetAnalyzer
dotnet restore
dotnet pack -c Release
dotnet tool install --global DotNetAnalyzer --add-source ./nupkg
Update
dotnet tool update --global DotNetAnalyzer
Uninstall
dotnet tool uninstall --global DotNetAnalyzer
Configure Claude Code
Create a .mcp.json file in the project directory to configure the MCP server:
Configuration file location:
.mcp.json - Place it in the project root directory
- User-level configuration:
~/.claude/settings.json - Applicable to all projects
{
"mcpServers": {
"dotnet-analyzer": {
"command": "dotnet-analyzer",
"args": [
"mcp",
"serve"
],
"env": {
"DOTNET_ENVIRONMENT": "Production",
"DOTNET_ANALYZER_LOG_LEVEL": "Information"
}
}
}
}
Or use the project-level settings.json:
Create a .claude/settings.json file in the project root directory:
{
"enabledMcpjsonServers": ["dotnet-analyzer"]
}
Then create a .mcp.json file in the project root directory (same as above).
Configuration priority:
- Enterprise management policy (highest)
- Command-line arguments
.claude/settings.local.json (local project)
.claude/settings.json (shared project)
~/.claude/settings.json (user-level, lowest)
Supported solution formats
DotNetAnalyzer fully supports the following Visual Studio solution formats:
| Format |
Extension |
Status |
Description |
| Traditional format |
.sln |
โ
Fully supported |
Text format, Visual Studio 2010 - 2019 |
| New-generation format |
.slnx |
โ
Fully supported |
XML format, Visual Studio 2022 17.8+ |
Usage examples:
dotnet-analyzer mcp serve --solution MyProject.sln
dotnet-analyzer mcp serve --solution MyProject.slnx
Advantages of .slnx:
- ๐ฏ Human-readable XML structure
- ๐ฆ More concise syntax
- ๐ Default format for .NET CLI 9.0.200+
- โ
Fully backward-compatible with .sln
Usage examples
After configuration, you can naturally use these features in Claude Code:
You: "Analyze all diagnostics in this project."
Claude: [Call get_diagnostics] ...
"Found 3 errors and 15 warnings..."
You: "Who are the callers of this method?"
Claude: [Call get_caller_info] ...
"This method is called from 5 locations..."
You: "Help me extract this part of code into a method."
Claude: [Call extract_method] ...
"Successfully extracted into a new method CalculateTotal..."
โจ Features
DotNetAnalyzer is a .NET global tool developed using .NET 8.0/9.0/10.0. By encapsulating the powerful Roslyn (.NET Compiler Platform) API, it enables Claude Code to deeply analyze and understand C# code.
Why is DotNetAnalyzer needed?
Claude Code is a powerful AI programming assistant, but it has limitations in understanding .NET code. DotNetAnalyzer bridges this gap through the MCP protocol, offering:
- โ
Semantic-level code analysis - Not just syntax highlighting, but real type and symbol understanding
- โ
Intelligent code navigation - Jump to definitions, find references, and understand inheritance hierarchies
- โ
Project management - Solution analysis, dependencies, and build order
- โ
In-depth insights - Call graph analysis, code metrics, and complexity assessment
- โ
Performance optimization - LRU caching, incremental analysis, and quick response
Advantages as a .NET tool
- ๐ One-click installation - Quickly install via
dotnet tool install
- ๐ฆ Automatic updates - Supports automatic updates with
dotnet tool update
- ๐ง Cross-platform - Supports Windows, macOS, and Linux
- ๐ฏ Zero configuration - Ready to use out of the box, no manual builds required
Core features of the current version (v0.9.0)
The current version (v0.9.0) offers 74 MCP tools with strong naming support:
โจ New features in v0.9.0 (Coming soon)
Enhanced code quality analysis and visualization:
- โ
Test coverage analysis - Project-level test coverage statistics and analysis
- โ
Dead code detection - Automatically identify unused types and methods
- โ
Performance bottleneck analysis - Cyclomatic complexity, method length, and deep nesting detection
- โ
Documentation generator - Automatically generate project documentation from XML comments
- โ
Call graph visualization - Support for exporting in SVG, JSON, and Mermaid formats
- โ
Error message localization - Support for English and Chinese error messages
Supported frameworks:
- .NET 8.0 (C# 12)
- .NET 9.0 (C# 13)
- .NET 10.0 (C# 14)
โจ New features in v0.8.0
Framework extension and dependency optimization:
- โ
.NET 10.0 support - New support for the C# 14 language version
- โ
Unified Roslyn - All frameworks use Roslyn 5.0.0
- โ
Project simplification - Removed conditional compilation and unified dependency versions
- โ
0 warnings, 0 errors - Completely eliminated compilation warnings and errors
- โ
Tests passed - All framework tests passed (190/190)
- โ
Dependency cleanup - Removed unused packages and resolved version conflicts
Supported frameworks:
- .NET 8.0 (C# 12)
- .NET 9.0 (C# 13)
- .NET 10.0 (C# 14)
โจ New features in v0.7.0
Function extension (Phase 3/4/5 completed):
- โ
Code refactoring tools - Fully implemented 14 refactoring tools (extract method, rename, encapsulate field, extract interface, etc.)
- โ
Code generation tools - 11 generators (interface implementation, constructor, property generation, import management, etc.)
- โ
Advanced analysis tools - 7 analyzers (call graph, caller/callee analysis, syntax tree comparison, etc.)
- โ
Code operation tools - Full support for code fixes and quick fixes
- โ
Comprehensive documentation - All tools include XML documentation comments
โจ New features in v0.6.0/v0.6.1
Architecture optimization and CI/CD:
- Unified output directory - All build artifacts are centralized in the Bin directory
- Path validation and security - PathValidator prevents path traversal attacks
- Interface abstraction layer - IWorkspaceManager and dependency injection support
- Structured logging - Integrated ILogger with support for configurable log levels
- Concurrency and performance - LRU caching, memory monitoring, and System.Text.Json optimization
- CI/CD optimization - Multi-platform builds, NuGet package cache acceleration
โจ Features in v0.5.0
- .slnx solution format support - Fully supports the XML format solution files of Visual Studio 2022
- Roslyn 5.0 upgrade - Upgraded to the latest Roslyn version for improved stability and performance
- Concurrency test optimization - Improved test concurrency support for better CI/CD efficiency
- Performance benchmark testing - Added a complete performance test suite to ensure continuous high performance
โ
Implemented tools
Code diagnostics:
get_diagnostics - Get compiler diagnostics (errors, warnings, information) for C# code
- Supports project-level diagnostics
- Supports single-file diagnostics
- Provides error locations and repair suggestions
Project management (โจ Enhanced in v0.5.0):
list_projects - List all projects in the solution
- Project name, path, and assembly name
- Project type and number of documents
- โจ Dependency analysis - Automatically analyze project dependencies
- โจ Circular dependency detection - Identify circular references
- โ
.slnx support - Fully supports the new-generation XML format solution
get_project_info - Get detailed project information
- Project configuration information
- Project references and package references
- Compilation diagnostic statistics
- โจ Source file list - Complete source file paths
get_solution_info - Get detailed solution information
- Solution configuration
- Project list and total count
- โจ Build order - Calculate the optimal build sequence using topological sorting
- โจ Startup project - Automatically identify the executable entry point
- โ
.slnx support - Load and parse .slnx XML format
Code analysis (โจ Fully implemented):
analyze_code - Analyze the syntax and semantic structure of code
- โ
Syntax tree parsing and hierarchical structure
- โ
Namespace, type, and method extraction
- โ
Type information analysis (base class, interface, accessibility)
- โ
Using directives and dependencies
- โ
Semantic model integration
Symbol query (โจ Fully implemented):
find_references - Find all references to a symbol
- โ
Cross-file reference search
- โ
Distinguish between declaration and reference locations
- โ
Extract reference context
find_declarations - Find the declaration location of a symbol
- โ
Base class declarations of overridden methods
- โ
Declarations of interface implementations
- โ
Identification of extension methods
get_symbol_info - Get detailed information about a symbol
- โ
Symbol metadata (name, type, accessibility)
- โ
Method signatures and parameters
- โ
XML documentation comment extraction
- โ
Attribute information
Code refactoring (โ
Fully implemented - Phase 3):
extract_method - Extract a method
- โ
Intelligent parameter inference
- โ
Preview and apply modes
- โ
Complete validation and dependency analysis
rename_symbol - Rename a symbol
- โ
Cross-file renaming
- โ
Renaming in comments and strings
- โ
Preview mode
introduce_variable - Introduce a local variable
- โ
Automatic naming suggestions
- โ
Expression extraction
encapsulate_field - Encapsulate a field
- โ
Automatically generate properties
- โ
Update reference points
extract_interface - Extract an interface
- โ
Member selection
- โ
Interface naming
change_signature - Modify a signature
- โ
Add/remove/reorder parameters
add_parameter - Add a parameter
inline_temporary - Inline a temporary variable
safely_remove_as - Safely remove an as conversion
remove_unnecessary_code - Remove unnecessary code
convert_for_to_foreach - Convert a for loop to a foreach loop
convert_foreach_to_for - Convert a foreach loop to a for loop
convert_if_to_switch - Convert an if statement to a switch statement
reverse_for_statement - Reverse a for loop
list_refactorers - List all available refactoring tools
Code generation (โ
Fully implemented - Phase 4):
generate_interface_impl - Generate interface implementation
generate_constructor - Generate a constructor
generate_property - Generate a property
generate_deconstructor - Generate a deconstructor
generate_from_usage - Generate from usage
remove_unused_usings - Remove unused using directives
sort_usings - Sort using directives
add_missing_imports - Add missing imports
organize_imports - Organize imports (remove unused + sort)
format_document - Format a document
format_selection - Format a selected range
Advanced analysis (โ
Fully implemented - Phase 5/6):
get_caller_info - Get caller information
- โ
Call location analysis
- โ
Call type identification
- โ
Call context extraction
get_callee_info - Get callee information
- โ
Recursive depth analysis
- โ
Method call chain
get_call_graph - Generate a call graph
- โ
Export in DOT format
- โ
โจ SVG visualization - Vector graphics output
- โ
โจ JSON format - Structured data
- โ
โจ Mermaid format - Markdown integration
- โ
Node and edge analysis
- โ
Complexity metrics
compare_syntax_trees - Compare syntax trees
- โ
Structured differences
- โ
Statistical information
get_code_diff - Generate code differences
apply_code_change - Apply code modifications
- โ
Optional formatting
- โ
Return diagnostic information
Code quality analysis (โจ New - Phase 6):
get_test_coverage - Get test coverage
- โ
Project-level coverage statistics
- โ
File-level coverage analysis
- โ
Line coverage, branch coverage, method coverage
find_dead_code - Find dead code
- โ
Detection of unused types
- โ
Detection of unused methods
- โ
Deletion suggestions
analyze_performance - Analyze performance bottlenecks
- โ
Cyclomatic complexity analysis
- โ
Method length detection
- โ
Deep nesting detection
- โ
Optimization suggestions
generate_documentation - Generate project documentation
- โ
Generate documentation from XML comments
- โ
Support for Markdown format
- โ
Extraction of class and member documentation
Code operations (โ
Fully implemented):
get_code_actions - Get code actions
get_refactorings - Get refactoring actions
get_completion_list - Get a completion list
- Support for diagnostic fixes and quick fixes
โ
Completed features
Phase 1: MCP Server Foundation (โ
100% completed)
22 basic tools - Code diagnostics, project management, symbol query, code analysis
Phase 2: Navigation Enhancement (โ
100% completed)
7 navigation tools - Jump to definition, type hierarchy, member hierarchy, semantic model, syntax tree, code metrics
Phase 3: Code Refactoring (โ
100% completed)
15 refactoring tools - A complete refactoring framework and 14 specific refactoring tools
Phase 4: Code Generation and Fixing (โ
100% completed)
11 code generation tools - Interface implementation, constructor, import management, formatting, etc.
Phase 5: Advanced Features (โ
100% completed)
7 advanced analysis tools - Call analysis, syntax tree comparison, code differences
Code Actions and Completion (โ
100% completed)
3 code operation tools - Code actions, refactoring suggestions, completion list
Advanced Query Tools (โ
100% completed)
5 advanced query tools - Symbol resolution, definition and reference, document list
Phase 6: Code Quality and Visualization (โ
100% completed)
4 new tools + visualization enhancement - Test coverage, dead code detection, performance analysis, documentation generation, call graph visualization
๐ง Technical Details
System architecture diagram
graph TB
subgraph "User layer"
A[Claude Code]
end
subgraph "MCP protocol layer"
B[MCP Protocol<br/>stdio]
C[dotnet-analyzer<br/>.NET global tool]
end
subgraph "DotNetAnalyzer internal"
D[MCP server]
E[JSON-RPC message routing]
F[Tool registration and invocation]
G[Roslyn integration layer]
end
subgraph "Code analysis layer"
H[Roslyn APIs<br/>Compiler platform]
I[MSBuildWorkspace<br/>Workspace management]
J[CompilationCache<br/>Compilation cache]
end
subgraph "Project layer"
K[.NET solution/project]
L[.sln / .slnx<br/>/ .csproj]
end
A -->|MCP request| B
B --> C
C --> D
D --> E
E --> F
F --> G
G --> H
H --> I
I --> J
J --> K
K --> L
style A fill:#e1f5ff
style C fill:#c8e6c9
style D fill:#fff9c4
style H fill:#ffccbc
style K fill:#f3e5f5
Core component relationship diagram
classDiagram
class IWorkspaceManager {
<<interface>>
+GetProjectAsync(path)
+GetCurrentSolutionAsync()
+Dispose()
}
class WorkspaceManager {
-LRUCache~string, Project~ _cache
-SemaphoreSlim _semaphore
-ILogger _logger
+GetProjectAsync(path)
+GetCurrentSolutionAsync()
-LoadProjectAsync(path)
}
class ICompilationCache {
<<interface>>
+GetOrAddAsync(key, factory)
+InvalidateAsync(key)
+ClearAsync()
}
class CompilationCache {
-ConcurrentDictionary _cache
-ILogger _logger
+GetOrAddAsync(key, factory)
+InvalidateAsync(key)
}
class IMcpServer {
<<interface>>
+StartAsync(token)
+StopAsync()
}
class McpServer {
-IWorkspaceManager _workspaceManager
-ToolRegistry _registry
+StartAsync(token)
-InitializeToolsAsync()
}
class ToolRegistry {
-Dictionary~string, ToolDelegate~ _tools
+RegisterTool(name, handler)
+GetTool(name)
+ListTools()
}
class RoslynAnalyzer {
+AnalyzeCode(project, file)
+FindReferences(symbol)
+GetDiagnostics(project)
}
IWorkspaceManager <|.. WorkspaceManager : implements
ICompilationCache <|.. CompilationCache : implements
IMcpServer <|.. McpServer : implements
WorkspaceManager --> ICompilationCache : uses
WorkspaceManager --> CompilationCache : creates
McpServer --> IWorkspaceManager : uses
McpServer --> ToolRegistry : owns
ToolRegistry --> RoslynAnalyzer : invokes
Project structure
graph TB
subgraph "DotNetAnalyzer project"
A[src/]
subgraph "DotNetAnalyzer.Cli - CLI tool"
B[Program.cs<br/>Main program entry]
C[Tools/<br/>MCP tool implementation]
D[appsettings.json<br/>Configuration file]
end
subgraph "DotNetAnalyzer.Core - Core library"
E[McpServer/<br/>MCP server]
F[Abstractions/<br/>Interface abstraction layer]
G[Roslyn/<br/>Roslyn integration]
H[Refactoring/<br/>Refactoring framework]
I[Models/<br/>Data models]
J[Configuration/<br/>Configuration management]
K[Security/<br/>Security verification]
end
subgraph "Roslyn integration layer"
L[WorkspaceManager<br/>Workspace management]
M[CompilationCache<br/>Compilation cache]
N[Refactoring/<br/>Refactorers]
O[CodeGeneration/<br/>Code generation]
P[CallAnalysis/<br/>Call analysis]
Q[Navigation/<br/>Navigation tools]
end
A --> B
A --> E
B --> C
B --> D
E --> F
E --> G
E --> H
E --> I
E --> J
E --> K
G --> L
G --> M
G --> N
G --> O
G --> P
G --> Q
style B fill:#c8e6c9
style E fill:#fff9c4
style G fill:#ffccbc
end
MCP tool classification hierarchy diagram
graph TB
subgraph "DotNetAnalyzer MCP toolset (74 tools)"
A[Code diagnostics<br/>1 tool]
B[Project management<br/>3 tools]
C[Code analysis<br/>1 tool]
D[Symbol query<br/>3 tools]
E[Navigation tools<br/>7 tools]
F[Refactoring tools<br/>15 tools]
G[Code generation<br/>11 tools]
H[Advanced analysis<br/>7 tools]
I[Code quality<br/>4 tools]
J[Code operations<br/>3 tools]
K[Advanced query<br/>5 tools]
A1[get_diagnostics]
B1[list_projects]
B2[get_project_info]
B3[get_solution_info]
C1[analyze_code]
D1[find_references]
D2[find_declarations]
D3[get_symbol_info]
E1[go_to_definition]
E2[get_type_hierarchy]
E3[get_member_hierarchy]
E4[get_semantic_model]
E5[get_syntax_tree]
E6[get_code_metrics]
E7[get_document_list]
F1[extract_method]
F2[rename_symbol]
F3[introduce_variable]
F4[encapsulate_field]
F5[extract_interface]
F6[change_signature]
F7[add_parameter]
F8[inline_temporary]
F9[safely_remove_as]
F10[remove_unnecessary_code]
F11[convert_for_to_foreach]
F12[convert_foreach_to_for]
F13[convert_if_to_switch]
F14[reverse_for_statement]
F15[list_refactorers]
G1[generate_interface_impl]
G2[generate_constructor]
G3[generate_property]
G4[generate_deconstructor]
G5[generate_from_usage]
G6[remove_unused_usings]
G7[sort_usings]
G8[add_missing_imports]
G9[organize_imports]
G10[format_document]
G11[format_selection]
H1[get_caller_info]
H2[get_callee_info]
H3[get_call_graph]
H4[compare_syntax_trees]
H5[get_code_diff]
H6[apply_code_change]
H7[resolve_symbol]
I1[get_test_coverage]
I2[find_dead_code]
I3[analyze_performance]
I4[generate_documentation]
J1[get_code_actions]
J2[get_refactorings]
J3[get_completion_list]
K1[get_definition_and_references]
K2[resolve_symbol]
K3[get_document_list]
K4[get_completion_list]
K5[get_refactorings]
A --> A1
B --> B1
B --> B2
B --> B3
C --> C1
D --> D1
D --> D2
D --> D3
E --> E1
E --> E2
E --> E3
E --> E4
E --> E5
E --> E6
E --> E7
F --> F1
F --> F2
F --> F3
F --> F4
F --> F5
F --> F6
F --> F7
F --> F8
F --> F9
F --> F10
F --> F11
F --> F12
F --> F13
F --> F14
F --> F15
G --> G1
G --> G2
G --> G3
G --> G4
G --> G5
G --> G6
G --> G7
G --> G8
G --> G9
G --> G10
G --> G11
H --> H1
H --> H2
H --> H3
H --> H4
H --> H5
H --> H6
H --> H7
I --> I1
I --> I2
I --> I3
I --> I4
J --> J1
J --> J2
J --> J3
K --> K1
K --> K2
K --> K3
K --> K4
K --> K5
style A fill:#ffcdd2
style B fill:#f8bbd0
style C fill:#e1bee7
style D fill:#d1c4e9
style E fill:#c5cae9
style F fill:#bbdefb
style G fill:#b3e5fc
style H fill:#b2ebf2
style I fill:#b2dfdb
style J fill:#c8e6c9
style K fill:#dcedc8
end
๐ ๏ธ Technology Stack
Core technologies
- .NET 8.0 - A modern cross-platform development framework
- .NET CLI Tools - Global tool framework
- MCP SDK - Official implementation of the Model Context Protocol
- Roslyn - Microsoft's official C# compiler platform
Main dependencies
<PackageReference Include="ModelContextProtocol" Version="*" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="5.*" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="5.*" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="5.*" />
<PackageReference Include="System.CommandLine" Version="2.*" />
<PackageReference Include="xUnit" Version="2.*" />
<PackageReference Include="Moq" Version="4.*" />
<PackageReference Include="FluentAssertions" Version="6.*" />
Supported solution formats:
- โ
Traditional
.sln format (text format)
- โ
New-generation
.slnx format (XML format, Visual Studio 2022+)
๐ฆ Building and Publishing
Local build
dotnet build -c Release
dotnet test
dotnet test --filter "Category=Performance"
dotnet pack -c Release
GitHub Actions CI/CD
The project uses GitHub Actions for automated building and publishing:
- Trigger conditions: Push to the main branch, create a Release, manual trigger
- Build process:
- Restore dependencies
- Run tests (skip performance tests in the CI environment)
- Create a NuGet package
- Publish to NuGet.org (only for Releases)
- Create a GitHub Release
Note: Performance benchmark tests are sensitive to the running environment and will be automatically skipped in the CI environment. You can run performance tests locally using dotnet test --filter "Category=Performance".
๐ View the workflow configuration
Version strategy
- Semantic versioning: Follow SemVer 2.0
- Pre-release versions: Use
-beta, -rc, etc.
- Automatic publishing: Automatically publish when pushing a Git tag
๐บ๏ธ Development Roadmap
DotNetAnalyzer's development is divided into multiple phases to gradually build complete code analysis capabilities.
โ
Phase 1: MCP Server Foundation (Completed)
Status: โ
Completed | Progress: 275% (22/8 tools)
The MCP server infrastructure, implementing core code analysis capabilities.
Completed (22 tools):
- โ
MCP stdio protocol implementation (using the official SDK)
- โ
MSBuildWorkspace integration
- โ
Project loading and caching mechanism
- โ
Error handling and friendly error messages
- โ
22 tools such as code diagnostics, project management, symbol query, and document comparison
- โ
.NET CLI tool packaging configuration
- โ
190 unit tests, 100% pass rate
- โ
GitHub Actions CI/CD
๐ View the detailed proposal
โ
Phase 2: Navigation Enhancement (Completed)
Status: โ
Completed | Progress: 117% (7/6 tools)
Enhanced code navigation and semantic query capabilities.
Completed (7 tools):
- โ
go_to_definition - Jump to definition
- โ
get_type_hierarchy - Type inheritance hierarchy (including base types, derived types, interfaces)
- โ
get_member_hierarchy - Member hierarchy (overrides, hiding, interface implementations)
- โ
get_semantic_model - Semantic model access (symbols, types, constant values)
- โ
get_syntax_tree - Detailed syntax tree information (JSON format, supports range limits)
- โ
get_code_metrics - Code complexity metrics (cyclomatic complexity, maintainability index, etc.)
- โ
Complete data models and test coverage
๐ View the detailed proposal
โ
Phase 3: Code Refactoring (Completed)
Status: โ
Completed | Progress: 100% (15/15 tools) | Priority: Important
Implemented common code refactoring operations.
Completed (15 tools):
- โ
extract_method - Extract a method (fully implemented, including preview and application)
- โ
rename_symbol - Rename a symbol (cross-file, supports comments and strings)
- โ
introduce_variable - Introduce a variable
- โ
encapsulate_field - Encapsulate a field
- โ
extract_interface - Extract an interface
- โ
change_signature - Modify a signature
- โ
add_parameter - Add a parameter
- โ
inline_temporary - Inline a temporary variable
- โ
safely_remove_as - Safely remove an as conversion
- โ
remove_unnecessary_code - Remove unnecessary code
- โ
convert_for_to_foreach - Convert a for loop to a foreach loop
- โ
convert_foreach_to_for - Convert a foreach loop to a for loop
- โ
convert_if_to_switch - Convert an if statement to a switch statement
- โ
reverse_for_statement - Reverse a for loop
- โ
list_refactorers - List all refactoring tools
Framework status: โ
Complete - RefactoringEngine, Validator, and PreviewGenerator are ready
๐ View the detailed proposal
โ
Phase 4: Code Generation and Fixing (Completed)
Status: โ
Completed | Progress: 100% (11/11 tools) | Priority: Value-added feature
Automatically generate boilerplate code and fix common issues.
Completed (11 tools):
- โ
generate_interface_impl - Generate interface implementation
- โ
generate_constructor - Generate a constructor
- โ
generate_property - Generate a property
- โ
generate_deconstructor - Generate a deconstructor
- โ
generate_from_usage - Generate from usage
- โ
remove_unused_usings - Remove unused using directives
- โ
sort_usings - Sort using directives
- โ
add_missing_imports - Add missing imports
- โ
organize_imports - Organize imports (remove unused + sort)
- โ
format_document - Format a document
- โ
format_selection - Format a selected range
Code operations (3 tools):
- โ
get_code_actions - Get code actions
- โ
get_refactorings - Get refactoring actions
- โ
get_completion_list - Get a completion list
๐ View the detailed proposal
โ
Phase 5: Advanced Features (Completed)
Status: โ
Completed | Progress: 100% (7/7 tools) | Priority: Nice-to-have
Provide advanced code analysis and insight features.
Completed (7 tools):
- โ
get_caller_info - Caller analysis (call location, type, context)
- โ
get_callee_info - Callee analysis (recursive depth analysis)
- โ
get_call_graph - Call graph generation (DOT format, node analysis)
- โ
compare_syntax_trees - Compare syntax trees (structured differences)
- โ
get_code_diff - Generate code differences (unified diff)
- โ
apply_code_change - Apply code modifications (optional formatting)
- โ
get_document_list - Document list
- โ
resolve_symbol - Symbol resolution
- โ
get_definition_and_references - Get definition and references in one go
๐ View the detailed proposal
๐ Current Progress
Last updated: 2026-03-07
| Phase |
Name |
Status |
Progress |
Number of MCP tools |
| 1 |
MCP Server Foundation |
โ
Completed |
275% |
22/8 |
| 2 |
Navigation Enhancement |
โ
Completed |
117% |
7/6 |
| 3 |
Code Refactoring |
โ
Completed |
100% |
15/15 |
| 4 |
Code Generation and Fixing |
โ
Completed |
100% |
11/11 |
| 5 |
Advanced Features |
โ
Completed |
100% |
7/7 |
| - |
Code Actions |
โ
Completed |
100% |
3/3 |
| - |
Advanced Query |
โ
Completed |
100% |
5/5 |
| 6 |
Code Quality and Visualization |
โ
Completed |
100% |
4/4 |
Total: 74 MCP tools have been implemented and exposed.
Version milestones
v0.7.0 milestone (โ
Completed)
- โ
Fully implemented Phase 3 (15 refactoring tools)
- โ
Fully implemented Phase 4 (11 code generation tools)
- โ
Fully implemented Phase 5 (7 advanced analysis tools)
- โ
Improved code quality (complete XML documentation, code standards)
- โ
A total of 70 MCP tools
v0.6.1 milestone (โ
Completed)
- โ
Comprehensive CI/CD optimization (multi-platform builds, NuGet caching)
- โ
Fully implemented Phase 2 (7 navigation tools)
v0.6.0 milestone (โ
Completed)
- โ
Unified output directory optimization
- โ
Architecture improvement (interface abstraction, dependency injection, structured logging)
- โ
Concurrent project loading and memory monitoring
- โ
JSON serialization optimization (System.Text.Json)
- โ
190 unit tests, 100% pass rate
- โ
Complete API documentation and examples
- โ
Path security verification
- โ
Incremental analysis optimization
v0.5.0 milestone (โ
Completed)
- โ
Support for the .slnx XML format
- โ
Roslyn 5.0 upgrade
- โ
Concurrency test optimization
- โ
Performance benchmark test suite
v0.4.0 milestone (โ
Completed)
- โ
All 8 core MCP tools implemented
- โ
LRU caching and performance optimization
- โ
Project dependency analysis
- โ
Build order calculation
- โ
Startup project identification
- โ
Integration test framework
- โ
Performance benchmark testing
- โ
Complete documentation (README, CHANGELOG, CONFIGURATION, INTEGRATION_TESTING)
๐ค Contribution
Contributions are welcome! Please refer to CONTRIBUTING.md for details.
Development guide
- Fork and clone the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push the branch:
git push origin feature/amazing-feature
- Create a Pull Request
Coding standards
โ ๏ธ Important: All contributors must adhere to the project's coding standards.
Core requirements:
- Maintain unit test coverage > 80%
- Add XML documentation comments to public APIs
- Have 0 warnings and 0 errors at compilation
- Run
dotnet format to format the code
Local testing tools
You can install and test locally during development:
dotnet pack -c Release
dotnet tool install --global DotNetAnalyzer --add-source ./src/DotNetAnalyzer.Cli/bin/Release
dotnet-analyzer --version
dotnet-analyzer mcp serve
dotnet tool uninstall --global DotNetAnalyzer
๐ License
This project is licensed under the MIT license.
๐ Documentation
User guides
-
API usage guide - Complete MCP tool API reference documentation
- Detailed descriptions of all 8 core tools
- Parameters, return values, and usage examples
- Configuration options and best practices
- Troubleshooting guide
-
Usage examples - Real-world usage scenarios and code examples
- Basic examples (diagnostic checks, solution analysis)
- Code analysis examples (structure analysis, inheritance relationships)
- Symbol query examples (finding references, symbol information)
- Code diagnostic examples (error location, repair suggestions)
- Dependency analysis examples (dependency graphs, build order)
- Comprehensive workflows (code review, debugging)
-
Configuration guide - Detailed configuration option explanations
- Environment variable configuration
- MCP server configuration
- Advanced configuration options
- Performance optimization suggestions
Developer documentation
- Integration testing guide - How to run and write integration tests
- Tool testing guide - MCP tool testing guide
- Troubleshooting - Solutions to common problems
- CLAUDE.md - Project instructions for Claude Code
Project documentation
- CHANGELOG - Version update history
- CONTRIBUTING.md - Contribution guide
- CODE_OF_CONDUCT.md - Code of conduct
- SECURITY.md - Security policy
Community
๐ Acknowledgments
๐ Contact
๐ Project Status
- โ
v0.8.0 released - All 70 MCP tools have been implemented
- โ
0 warnings, 0 errors - Code quality meets production standards
- โ
190/190 tests passed - 100% pass rate for all frameworks
- โ
Published to NuGet - Can be installed via
dotnet tool install --global DotNetAnalyzer