csharp-lsp-mcp is a C Sharp MCP server for .NET repositories. It exposes C# and XAML language intelligence, workspace analysis, architecture discovery, DI tracing, test mapping, graph-backed change impact, change planning, and verification planning through the Model Context Protocol.
If you are looking for a c# mcp or c sharp MCP server that is easy for an LLM agent to parse, this project is built for that use case:
- editor-style C# tools backed by
csharp-ls - higher-level codebase analysis tools for .NET solutions
- a persistent Roslyn-backed code graph with incremental refresh
- graph-backed change impact, edit planning, and verification planning
- built-in XAML analysis for WPF and WinUI workflows
- structured JSON output by default for agent consumption
This MCP server helps AI coding agents and MCP clients inspect medium-to-large .NET codebases faster.
- workspace setup and shutdown
- file diagnostics
- hover, definition, references, symbols
- completions, code actions, rename
- workspace diagnostics
- workspace symbol search
- semantic search for ASP.NET endpoints, hosted services, DI registrations, configuration bindings, and middleware
- implementation lookup
- call hierarchy
- type hierarchy
- project overview
- entrypoint discovery
- DI registration tracing
- one-shot symbol analysis
- production-to-test mapping
- dead code candidate detection
- persistent code graph build and refresh
- graph stats and snapshot inspection
- downstream change impact analysis
- ordered change planning
- verification planning with builds, tests, and focused diagnostics
- XAML validation
- binding extraction
- resource analysis
- named element inspection
- tree structure extraction
- binding issue detection
- ViewModel interface extraction
Older C# MCP servers often stop at raw LSP primitives. This project also exposes higher-level, codebase-shaped operations that reduce repeated tool calls:
csharp_project_overviewcsharp_analyze_symbolcsharp_find_entrypointscsharp_find_registrationscsharp_semantic_searchcsharp_test_mapcsharp_find_dead_code_candidatescsharp_build_code_graphcsharp_change_impactcsharp_plan_changecsharp_verify_change
That makes it easier for an agent to answer questions like:
- "How is this solution structured?"
- "Where are the ASP.NET entrypoints?"
- "Which implementation backs this interface?"
- "Where is this service registered in DI?"
- "What tests probably cover this type?"
- "What breaks if I change this symbol?"
- "Which files should I inspect first?"
- "What build and test commands should I run after the edit?"
The newer graph features move this project beyond a thin C# LSP wrapper.
You can now build a persistent Roslyn-backed code graph for a solution, reuse it incrementally, and ask higher-level planning questions that are difficult to answer from raw LSP calls alone:
csharp_build_code_graph: build or refresh the persisted graphcsharp_graph_stats: inspect the current snapshot and reuse statecsharp_export_code_graph: render the persisted graph as Mermaid or DOT for quick visualizationcsharp_change_impact: estimate callers, implementations, registrations, entrypoints, and related tests touched by a changecsharp_plan_change: turn impact into an ordered edit and inspection plancsharp_verify_change: generate build, test, and focused-diagnostics verification steps
This is the part of the MCP surface that gives LLM agents the most leverage during real refactors, because it helps answer:
- what else changes when this type or method changes
- which projects are affected
- which files are the highest-value inspection targets
- which verification commands are worth running first
All current C# and XAML tools support format. The default is structured.
structured: pretty-printed JSON envelope for LLM parsingsummary: short text summarytextandmarkdown: compatibility aliases forsummary
Structured responses use this shape:
{
"schemaVersion": 1,
"tool": "csharp_hover",
"success": true,
"summary": "Hover information available.",
"data": {
"summary": "Hover information available."
},
"error": null
}Error responses keep the same top-level envelope:
{
"schemaVersion": 1,
"tool": "csharp_hover",
"success": false,
"summary": "Workspace not initialized.",
"data": null,
"error": {
"code": "tool_execution_failed",
"message": "Workspace not initialized."
}
}This repository is flat:
CSharpLspMcp.sln: solution entrypointsrc/CSharpLspMcp/: MCP server sourcesrc/CSharpLspMcp.Tests/: unit and integration-style tests- repo root: docs, changelog, contribution guide, GitHub metadata
Install the .NET 8 SDK from https://dotnet.microsoft.com/download/dotnet/8.0.
The C# tools depend on csharp-ls being available on PATH.
dotnet tool install --global csharp-ls
csharp-ls --versionThe XAML tools do not depend on csharp-ls, but the C# toolchain does.
git clone https://github.com/armeldemarsac92/csharp-lsp-mcp.git
cd csharp-lsp-mcp
dotnet build CSharpLspMcp.sln -c ReleaseBuild outputs from the repo root:
- Windows:
src/CSharpLspMcp/bin/Release/net8.0/csharp-lsp-mcp.exe - Linux/macOS:
src/CSharpLspMcp/bin/Release/net8.0/csharp-lsp-mcp - Cross-platform
dotnethost:src/CSharpLspMcp/bin/Release/net8.0/csharp-lsp-mcp.dll
From the repo root, for a local development run:
dotnet run --project src/CSharpLspMcp -- --verboseOr run the built server directly:
dotnet src/CSharpLspMcp/bin/Release/net8.0/csharp-lsp-mcp.dll --verboseExample MCP configuration:
{
"mcpServers": {
"csharp": {
"command": "dotnet",
"args": [
"/absolute/path/to/csharp-lsp-mcp/src/CSharpLspMcp/bin/Release/net8.0/csharp-lsp-mcp.dll"
]
}
}
}For iterative local development, using dotnet run is also valid:
{
"mcpServers": {
"csharp": {
"command": "dotnet",
"args": [
"run",
"--project",
"/absolute/path/to/csharp-lsp-mcp/src/CSharpLspMcp",
"--",
"--verbose"
]
}
}
}If you publish or install the binary separately, point the MCP client to csharp-lsp-mcp directly.
These conventions apply across the C# MCP surface:
filePath: usually an absolute path to a.csfile; some higher-level tools also accept a workspace-relative pathline: 0-based line numbercharacter: 0-based character positioncontent: optional unsaved file content; if omitted, tools read from disk; some analyzers also treat empty content as a disk fallbackformat:structuredby default,summaryfor compact human-readable outputmaxResults,maxDocuments,maxDiagnosticsPerDocument: hard caps for agent context controlminimumSeverity: for workspace diagnostics, supportsALL,ERROR,WARNING,INFO, andHINTincludeGenerated,includeTests,excludePaths: filtering controls for higher-level analysis tools such as workspace diagnostics and semantic searchesexcludeDiagnosticCodes,excludeDiagnosticSources: suppress low-value warnings during workspace or change verification runsmode: graph build mode,incrementalby default orfullwhen a complete rebuild is neededrebuildIfMissing: graph-backed tools can rebuild persisted graph data automatically when neededincludeRegistrations,includeEntrypoints: opt into DI and startup-surface overlays during change-impact analysis
Important workflow rule:
- call
csharp_set_workspacebefore using the C# tools - for the graph-backed planning tools, call
csharp_build_code_graphonce up front on larger solutions so later impact and verification calls can reuse persisted data
- Initialize the workspace:
{
"path": "/path/to/solution-root"
}Call with csharp_set_workspace.
- Inspect the solution:
{
"maxProjects": 25,
"format": "structured"
}Call with csharp_project_overview.
- Build the persistent graph:
{
"mode": "incremental",
"includeTests": true,
"format": "structured"
}Call with csharp_build_code_graph.
- Analyze a symbol:
{
"symbolQuery": "MyCompany.Feature.ServiceBusListener",
"maxResults": 10,
"format": "structured"
}Call with csharp_analyze_symbol.
- Plan and verify a change:
{
"symbolQuery": "MyCompany.Feature.ServiceBusListener",
"includeTests": true,
"format": "structured"
}Call with csharp_change_impact, csharp_plan_change, and csharp_verify_change.
Sets the current solution or project directory and starts the C# language server.
| Parameter | Type | Required | Description |
|---|---|---|---|
path |
string |
Yes | Path to the solution or project directory. |
format |
string |
No | Output format. Default: structured. |
Stops the C# language server and releases file locks.
| Parameter | Type | Required | Description |
|---|---|---|---|
format |
string |
No | Output format. Default: structured. |
Returns pull diagnostics across the current workspace.
This tool supports filtering so LLM agents can suppress low-signal diagnostics from generated files, tests, or noisy path segments in larger solutions.
| Parameter | Type | Required | Description |
|---|---|---|---|
maxDocuments |
int |
No | Maximum number of documents to include. Default: 20. |
maxDiagnosticsPerDocument |
int |
No | Maximum diagnostics to include per document. Default: 10. |
minimumSeverity |
string |
No | Minimum severity to include: ALL, ERROR, WARNING, INFO, or HINT. Default: WARNING. |
includeGenerated |
bool |
No | Include generated files such as obj, bin, and *.g.cs. Default: false. |
includeTests |
bool |
No | Include test files and test projects. Default: true. |
excludePaths |
string[]? |
No | Optional file-path substrings to exclude from results. |
excludeDiagnosticCodes |
string[]? |
No | Optional diagnostic codes to exclude, such as CS8933, CS8019, or IDE0005. |
excludeDiagnosticSources |
string[]? |
No | Optional diagnostic sources to exclude, such as lsp or csharp. |
format |
string |
No | Output format. Default: structured. |
Returns compiler diagnostics for one C# document.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Absolute path to the C# file. |
content |
string? |
No | Optional file content. Reads from disk when omitted. |
format |
string |
No | Output format. Default: structured. |
Returns type information and documentation at a position.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Absolute path to the C# file. |
line |
int |
Yes | 0-based line number. |
character |
int |
Yes | 0-based character position. |
content |
string? |
No | Optional file content. |
format |
string |
No | Output format. Default: structured. |
Returns IntelliSense completions at a position.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Absolute path to the C# file. |
line |
int |
Yes | 0-based line number. |
character |
int |
Yes | 0-based character position. |
content |
string? |
No | Optional file content. |
maxResults |
int |
No | Maximum completion items. Default: 20. |
format |
string |
No | Output format. Default: structured. |
Finds the definition of the symbol at a position.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Absolute path to the C# file. |
line |
int |
Yes | 0-based line number. |
character |
int |
Yes | 0-based character position. |
content |
string? |
No | Optional file content. |
format |
string |
No | Output format. Default: structured. |
Finds references to the symbol at a position.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Absolute path to the C# file. |
line |
int |
Yes | 0-based line number. |
character |
int |
Yes | 0-based character position. |
content |
string? |
No | Optional file content. |
includeDeclaration |
bool |
No | Include the declaration in results. Default: true. |
format |
string |
No | Output format. Default: structured. |
Lists document symbols for a single C# file.
For top-level Program.cs files, this tool can enrich sparse LSP symbol output with heuristic startup-call symbols such as Add..., Use..., and Map... when the underlying server only returns a thin file/program symbol set.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Absolute path to the C# file. |
content |
string? |
No | Optional file content. |
format |
string |
No | Output format. Default: structured. |
Returns available quick fixes and refactorings for a selected range.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Absolute path to the C# file. |
startLine |
int |
Yes | 0-based start line. |
startCharacter |
int |
Yes | 0-based start character. |
endLine |
int |
Yes | 0-based end line. |
endCharacter |
int |
Yes | 0-based end character. |
content |
string? |
No | Optional file content. |
format |
string |
No | Output format. Default: structured. |
Returns a rename plan for the symbol at a position.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Absolute path to the C# file. |
line |
int |
Yes | 0-based line number. |
character |
int |
Yes | 0-based character position. |
newName |
string |
Yes | New symbol name. |
content |
string? |
No | Optional file content. |
format |
string |
No | Output format. Default: structured. |
Searches symbols across the current workspace by name.
Fully qualified queries are ranked so production matches beat fallback test matches when the underlying language server only returns simple-name results.
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string |
Yes | Symbol-name query. Can be empty to inspect top-ranked results. |
maxResults |
int |
No | Maximum number of results. Default: 20. |
format |
string |
No | Output format. Default: structured. |
Runs named semantic searches across the current workspace.
Supported query values:
aspnet_endpointshosted_servicesdi_registrationsconfig_bindingsmiddleware_pipeline
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string |
Yes | Named search mode. |
projectFilter |
string? |
No | Optional project name or path fragment filter. |
includeTests |
bool |
No | Include results from test code. Default: false. |
maxResults |
int |
No | Maximum number of matches. Default: 20. |
format |
string |
No | Output format. Default: structured. |
Finds implementations of the symbol at a given position.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Absolute path to the C# file. |
line |
int |
Yes | 0-based line number. |
character |
int |
Yes | 0-based character position. |
content |
string? |
No | Optional file content. |
maxResults |
int |
No | Maximum implementation results. Default: 20. |
format |
string |
No | Output format. Default: structured. |
Returns incoming and outgoing calls for the symbol at a position.
If csharp-ls does not provide outgoing calls for a method, this tool can fall back to definition-based source heuristics and reports that via usedHeuristicOutgoingFallback in structured output.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Absolute path to the C# file. |
line |
int |
Yes | 0-based line number. |
character |
int |
Yes | 0-based character position. |
content |
string? |
No | Optional file content. |
maxResults |
int |
No | Maximum incoming and outgoing items per side. Default: 20. |
format |
string |
No | Output format. Default: structured. |
Returns immediate supertypes and subtypes for a type.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Absolute path to the C# file. |
line |
int |
Yes | 0-based line number. |
character |
int |
Yes | 0-based character position. |
content |
string? |
No | Optional file content. |
maxResults |
int |
No | Maximum supertype and subtype items. Default: 20. |
format |
string |
No | Output format. Default: structured. |
Summarizes the current .NET workspace at the solution and project level.
| Parameter | Type | Required | Description |
|---|---|---|---|
maxProjects |
int |
No | Maximum number of projects to include in detail. Default: 25. |
maxPackagesPerProject |
int |
No | Maximum package references to show per project. Default: 8. |
maxProjectReferencesPerProject |
int |
No | Maximum project references to show per project. Default: 8. |
format |
string |
No | Output format. Default: structured. |
Finds host projects, startup surfaces, middleware, routes, and hosted services.
| Parameter | Type | Required | Description |
|---|---|---|---|
includeAspNetRoutes |
bool |
No | Include direct ASP.NET route registrations such as MapGet and MapPost. Default: true. |
includeHostedServices |
bool |
No | Include AddHostedService registrations and BackgroundService implementations. Default: true. |
includeMiddlewarePipeline |
bool |
No | Include middleware calls such as UseAuthentication. Default: true. |
maxResults |
int |
No | Maximum items per section. Default: 20. |
format |
string |
No | Output format. Default: structured. |
Traces dependency injection registrations and likely consumers.
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string? |
No | Optional filter by service type, implementation type, or registration text. |
includeConsumers |
bool |
No | Include likely constructor consumers. Default: true. |
maxResults |
int |
No | Maximum registrations and consumers per section. Default: 20. |
format |
string |
No | Output format. Default: structured. |
Builds a one-shot symbol report from multiple lower-level analyzers.
Use either symbolQuery, or filePath with line and character.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbolQuery |
string? |
No | Workspace symbol query or fully qualified name. |
filePath |
string? |
No | Absolute or workspace-relative file path. Required for position-based analysis. |
line |
int |
No | 0-based line number. Use with filePath and character. Default: -1. |
character |
int |
No | 0-based character position. Use with filePath and line. Default: -1. |
content |
string? |
No | Optional file content. Reads from disk when null or empty. |
maxResults |
int |
No | Maximum references and hierarchy edges to include. Default: 10. |
format |
string |
No | Output format. Default: structured. |
Maps production code to likely related tests.
Provide filePath, symbolQuery, or both.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string? |
No | Absolute or workspace-relative path to a production C# file. |
symbolQuery |
string? |
No | Symbol name or fully qualified member/type name. |
maxResults |
int |
No | Maximum related tests to return. Default: 10. |
format |
string |
No | Output format. Default: structured. |
Finds best-effort dead code candidates in the current workspace.
| Parameter | Type | Required | Description |
|---|---|---|---|
includePrivateMembers |
bool |
No | Include unused private methods and fields. Default: true. |
includeInternalTypes |
bool |
No | Include unreferenced internal types. Default: true. |
includeTests |
bool |
No | Include candidates from test projects and test paths. Default: false. |
maxResults |
int |
No | Maximum candidates to return. Default: 20. |
format |
string |
No | Output format. Default: structured. |
Builds or refreshes the persistent Roslyn-backed workspace graph.
Incremental mode reuses unchanged project graph slices from the last compatible snapshot, which makes repeated impact and verification calls much cheaper on medium-to-large solutions.
| Parameter | Type | Required | Description |
|---|---|---|---|
path |
string? |
No | Optional workspace, solution, or project path. Uses the current workspace when omitted. |
mode |
string |
No | Build mode: incremental (default) or full. |
includeTests |
bool |
No | Include test projects and test paths in the graph. Default: true. |
includeGenerated |
bool |
No | Include generated files such as obj, bin, and *.g.cs. Default: false. |
format |
string |
No | Output format. Default: structured. |
Reads the persisted graph summary for the current workspace or an explicit path.
Useful fields in structured output include snapshot identity, project and symbol counts, edge counts, reuse statistics, and warnings emitted during the last build.
| Parameter | Type | Required | Description |
|---|---|---|---|
path |
string? |
No | Optional workspace, solution, or project path. Uses the current workspace when omitted. |
format |
string |
No | Output format. Default: structured. |
Renders the persisted graph as Mermaid or Graphviz DOT, and by default also writes a real .mmd or .dot file for user-facing visualization.
Use this when you want a compact picture of the workspace shape, a project slice, or the neighborhood around one symbol without manually assembling nodes and edges yourself.
| Parameter | Type | Required | Description |
|---|---|---|---|
path |
string? |
No | Optional workspace, solution, or project path. Uses the current workspace when omitted. |
layout |
string |
No | Output graph syntax: mermaid (default) or dot. |
focusSymbol |
string? |
No | Optional fully qualified symbol name, documentation ID, or simple symbol query for a focused neighborhood. |
projectFilter |
string? |
No | Optional project name or path fragment for a project-scoped slice. Exact project matches are preferred over broader partial matches. |
includeTypes |
bool |
No | Include type nodes in project or overview slices. Default: false. |
includeMembers |
bool |
No | Include method, property, field, and event nodes. Default: false. |
includeDocuments |
bool |
No | Include document nodes. Default: false. |
includeDi |
bool |
No | Include DI registration nodes. Default: true. |
includeEntrypoints |
bool |
No | Include entrypoint nodes such as host projects, routes, and handlers. Default: true. |
edgeKinds |
string[]? |
No | Optional edge kinds to include: contains, depends_on_project, inherits, implements, overrides, calls, registered_as, consumed_by. |
maxNodes |
int |
No | Maximum nodes to render. Default: 80. |
maxEdges |
int |
No | Maximum edges to render. Default: 160. |
rebuildIfMissing |
bool |
No | Build the graph automatically when no persisted snapshot exists. Default: true. |
writeToFile |
bool |
No | Write a real .mmd or .dot file. Default: true. |
outputPath |
string? |
No | Optional export file path. Relative paths are resolved from the workspace root. When omitted, the server writes to .csharp-lsp-mcp/exports/. |
format |
string |
No | Output format. Default: structured. |
Structured output includes both the inline projection text and the exported exportPath, so an agent can parse the graph while the user can open the generated file directly.
Example Mermaid export:
{
"focusSymbol": "MeshBoard.Contracts.Authentication.AppUserPrincipalFactory",
"layout": "mermaid",
"includeTypes": true,
"includeDi": true,
"includeEntrypoints": true
}Example DOT export:
{
"projectFilter": "MeshBoard.Api",
"layout": "dot",
"includeTypes": true,
"includeMembers": true,
"maxNodes": 120,
"maxEdges": 220
}Estimates downstream impact for changing a symbol or file using the persisted graph plus higher-level architecture and test overlays.
This tool is designed to answer "what breaks if I change this?" without forcing the agent to manually combine references, implementations, DI registrations, entrypoints, and test hints across multiple calls.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbolQuery |
string? |
No | Fully qualified symbol name, documentation ID, or simple symbol query. |
filePath |
string? |
No | Optional file path to analyze instead of or in addition to a symbol query. |
includeTests |
bool |
No | Include related tests in the impact report. Default: true. |
includeRegistrations |
bool |
No | Include matching DI registrations and consumers. Default: true. |
includeEntrypoints |
bool |
No | Include routes, startup surfaces, hosted services, and other entrypoints. Default: true. |
rebuildIfMissing |
bool |
No | Rebuild the graph automatically when missing or stale. Default: true. |
maxResults |
int |
No | Maximum items to return per section. Default: 20. |
format |
string |
No | Output format. Default: structured. |
Builds an ordered change plan for a symbol or file: primary edit targets, affected projects, inspection order, and verification steps.
This is the high-level planning companion to csharp_change_impact.
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
string? |
No | Optional short description of the intended change. |
symbolQuery |
string? |
No | Fully qualified symbol name, documentation ID, or simple symbol query. |
filePath |
string? |
No | Optional file path to analyze instead of or in addition to a symbol query. |
includeTests |
bool |
No | Include related tests and test-driven verification steps. Default: true. |
rebuildIfMissing |
bool |
No | Rebuild the graph automatically when missing or stale. Default: true. |
maxResults |
int |
No | Maximum items to include per section. Default: 10. |
format |
string |
No | Output format. Default: structured. |
Prepares a verification plan for changed symbols or files: build commands, test commands, focused diagnostics, and ordered verification steps.
Use this after an edit, or use it up front to decide what the smallest safe validation loop looks like before touching code.
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
string? |
No | Optional short description of the intended change. |
symbolQuery |
string? |
No | Fully qualified symbol name, documentation ID, or simple symbol query. |
filePath |
string? |
No | Optional file path to analyze instead of or in addition to a symbol query. |
changedFiles |
string[]? |
No | Optional changed files to prioritize in diagnostics and project selection. |
includeTests |
bool |
No | Include test projects and test diagnostics. Default: true. |
rebuildIfMissing |
bool |
No | Rebuild the graph automatically when missing or stale. Default: true. |
minimumSeverity |
string |
No | Minimum severity for focused diagnostics: ALL, ERROR, WARNING (default), INFO, or HINT. |
excludeDiagnosticCodes |
string[]? |
No | Optional diagnostic codes to exclude, such as IDE0005 or CS8933. |
excludeDiagnosticSources |
string[]? |
No | Optional diagnostic sources to exclude, such as csharp or Style. |
maxResults |
int |
No | Maximum items to include per section. Default: 10. |
format |
string |
No | Output format. Default: structured. |
Validates a XAML file and returns parse and semantic diagnostics.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Path to the XAML file. |
content |
string? |
No | Optional XAML content. Reads from disk when omitted. |
projectPath |
string? |
No | Optional project path for assembly-aware validation. |
format |
string |
No | Output format. Default: structured. |
Extracts data bindings from a XAML file.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Path to the XAML file. |
content |
string? |
No | Optional XAML content. |
format |
string |
No | Output format. Default: structured. |
Lists resource definitions and references in a XAML file.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Path to the XAML file. |
content |
string? |
No | Optional XAML content. |
format |
string |
No | Output format. Default: structured. |
Lists all named elements and duplicate x:Name values.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Path to the XAML file. |
content |
string? |
No | Optional XAML content. |
format |
string |
No | Output format. Default: structured. |
Builds a simplified XAML element tree.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Path to the XAML file. |
content |
string? |
No | Optional XAML content. |
maxDepth |
int |
No | Maximum tree depth to include. Default: 10. |
format |
string |
No | Output format. Default: structured. |
Finds likely binding issues in a XAML file.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Path to the XAML file. |
content |
string? |
No | Optional XAML content. |
format |
string |
No | Output format. Default: structured. |
Generates a ViewModel interface from inferred binding properties.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath |
string |
Yes | Path to the XAML file. |
content |
string? |
No | Optional XAML content. |
interfaceName |
string |
No | Generated interface name. Default: IViewModel. |
format |
string |
No | Output format. Default: structured. |
csharp_set_workspacecsharp_project_overviewcsharp_find_entrypointscsharp_find_registrations
csharp_search_symbolscsharp_analyze_symbolcsharp_call_hierarchycsharp_find_implementationscsharp_test_map
csharp_workspace_diagnosticscsharp_find_dead_code_candidatescsharp_semantic_search
csharp_build_code_graphcsharp_change_impactcsharp_plan_changecsharp_verify_change
- The C# analysis path depends on
csharp-ls, so its capabilities and quirks affect the low-level editor-style tools. - The higher-level planning path now combines LSP, Roslyn, and a persisted graph. That gives agents much stronger refactor support, but some overlays still remain heuristic.
- Higher-level tools such as semantic search, test mapping, and dead-code detection are intentionally heuristic. They are designed to be useful for agents, not to act as a full formal static-analysis platform.
- Graph-backed tools are most effective after
csharp_build_code_graphhas been run once for the current workspace. Incremental refresh is supported, but afullrebuild is still useful after major repository churn. - DI registrations and entrypoints are now persisted in the graph for impact analysis, but the graph is still a pragmatic agent-oriented model rather than a full general-purpose code-intelligence database.
csharp_set_workspaceshould be called before other C# tools so the language server can load the solution correctly.
dotnet build
dotnet testVerbose server logging from the repo root:
dotnet run --project src/CSharpLspMcp -- --verboseSee CONTRIBUTING.md.
See CHANGELOG.md.
MIT. See LICENSE.