resharper-cli-mcp
This server lets an agent run JetBrains ReSharper command-line analysis and cleanup on a C# solution.
Inspect a solution with
resharper_inspect, returning warnings, errors, and suggestions; optionally narrow reported files with globs, set minimum severity, cap response detail, and write a full Markdown report.Format and fix code style in place with
resharper_cleanup, including formatting, unused usings,varusage, modifier order, qualifiers, parentheses, and braces; it requires files and can use a named cleanup profile.Reset a solution's ReSharper cache with
resharper_reset_cacheto force a cold rebuild or reclaim cache for a deleted checkout.Override solution discovery with
solutionPathfor any tool, supporting.sln,.slnx, or.slnf.Manage ReSharper cache prewarming, cleanup solution filtering, timeouts, logging, and output budget via configuration, though these are not separate tools.
Runs JetBrains ReSharper command-line tools to inspect code for issues and apply code cleanup to .NET solutions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@resharper-cli-mcp inspect the solution for code issues"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
resharper-cli-mcp
resharper-cli-mcp is an MCP server that runs JetBrains' ReSharper command-line tools for a coding agent. Its resharper_inspect tool runs jb inspectcode and returns the issues, and resharper_cleanup runs jb cleanupcode over the files the agent names. jb reads the solution's .DotSettings and .editorconfig as ReSharper does in the IDE, so the agent is held to the same severities and code style. The server is unofficial, not affiliated with or endorsed by JetBrains, and it runs a jb you install yourself.
Why not call jb directly?
An agent can run jb from a shell. It then gets a report file that can list thousands of issues, a cleanup profile it must name on every call, and a cold cache in each new checkout. The server handles each of these:
Issues come back as markdown grouped by file, re-rendered at lower detail until they fit the client's output budget.
jb cleanupcoderunsBuilt-in: Full Cleanupunless it is given--profile, whatever the solution's settings say. The server passes the profile the solution names underSilentCleanupProfile, and reports which files cleanup changed.The cache is warmed when a client connects, unless
RESHARPER_MCP_PREWARM=off. A new worktree or clone is seeded from another checkout's warm cache.Runs are queued, because otherwise a second concurrent
jbon one solution builds a cold cache of its own.A run reports progress every ten seconds, with the elapsed time and the cap.
Related MCP server: lsp-tools-mcp
Run times
An inspect analyses the whole solution, because resolving symbols needs the full solution model, so files narrows what is reported, not what is analysed. A cleanup loads only the projects its files belong to and every project those reference, through a solution filter the server writes, and on a warm cache it takes longer the more files it is given. RESHARPER_MCP_CLEANUP_FILTER=off makes it load the whole solution. The first run against a solution builds ReSharper's caches and typically takes minutes, then later runs against the same cache are several times faster.
Each run is capped at RESHARPER_MCP_TIMEOUT_SECS, defaulting to 10 minutes. If your client's own tool-call timeout is shorter than a cold run, raise that too.
Quickstart
The server needs the .NET 10 SDK or later and JetBrains' ReSharper Command Line Tools, which are free and need no ReSharper license. Both install as .NET global tools:
dotnet tool install -g JetBrains.ReSharper.GlobalTools
dotnet tool install -g Zphil.ReSharperCliRegister the command resharper-cli-mcp, which takes no arguments, with your MCP client. For Claude Code, add it to .mcp.json:
{
"mcpServers": {
"resharper": {
"command": "resharper-cli-mcp"
}
}
}The server uses the one .sln or .slnx in its working directory. When there are none or several, set JB_SOLUTION_PATH in the config's env block.
Other clients differ only in where the entry goes and the key around it:
Client | Where the entry goes | Top-level key |
Visual Studio 2022 17.14+ and 2026 |
|
|
VS Code |
|
|
Cursor |
|
|
Rider AI Assistant | Settings | Tools | AI Assistant | MCP |
|
Junie |
|
|
Cline |
|
|
Inside Rider, the IDE's own analysis already gives its agents the inspection results, and resharper_inspect would run a second analysis of the solution alongside it. There the server's sole use is resharper_cleanup, because Rider's MCP tools can reformat a file but cannot run a cleanup profile.
For Codex CLI, run codex mcp add resharper -- resharper-cli-mcp. llms-install.md has the full entry for each client as a checklist, so you can point an agent at it to do the install.
VS Code, Visual Studio, Cursor and LM Studio can add the server in one click once both tools are installed:
Install as a Claude Code plugin
This repository is also a Claude Code plugin marketplace with one plugin:
/plugin marketplace add andypgray/resharper-cli-mcp
/plugin install resharper-cli-mcp@resharper-cli-mcpThe plugin starts the server with dotnet dnx, pinned to one release, and claude plugin update resharper-cli-mcp@resharper-cli-mcp moves the pin to the latest. You still install the .NET 10 SDK or later and jb, and ReSharper's caches live in the plugin's data directory.
The plugin does not start in a repository whose global.json pins an SDK older than .NET 10, because dotnet dnx runs under the pinned SDK and that SDK has no dnx command. For such a repository, run dotnet tool install -g Zphil.ReSharperCli from a directory outside it, since the install fails under the same pin, and register resharper-cli-mcp as shown above. The installed command ignores global.json.
Install as a Claude Desktop extension
Download resharper-cli-mcp-<version>.mcpb from the latest release, double-click it, and set Solution file to the .sln or .slnx to analyse. Claude Desktop starts the server outside your repository, so it has no working directory to find a solution in. The bundle carries only the server, so install the .NET 10 runtime or later and the ReSharper Command Line Tools first. Run cap moves the 10-minute limit on one run.
Tools
Tool | Mutates files | What it does |
| no | Runs |
| yes | Runs |
| no (deletes caches) | Drops the solution's ReSharper cache so the next run starts cold, or reclaims the cache a deleted checkout left behind. |
resharper_inspect takes files globs, solution-relative or absolute, and a severity of Suggestion, Warning (the default) or Error. At severity=Suggestion a response reads:
Found 2 issue(s) across 1 file(s):
### /repo/src/HomeController.cs
- **Line 8** [WARNING] `RedundantUsingDirective`: Using directive is not required by the code and can be safely removed.
- **Line 24** [SUGGESTION] `FieldCanBeMadeReadOnly.Local`: Field can be made readonly.report=Markdown writes every issue with its own message to a file under the system temp directory. The response names the file, and the server deletes it after seven days. detail caps how detailed the response may be, down to a one-line Minimal, so detail=Minimal report=Markdown surveys a legacy solution in one call.
resharper_cleanup changes style, never behaviour: formatting, using directives, var style, modifier order, redundant qualifiers and parentheses, braces. Without a profile argument it uses the profile named under SilentCleanupProfile in the solution's settings, then Built-in: Full Cleanup. Where Full Cleanup would churn legacy code, name a narrower profile there. Every call then uses it, including calls from an agent that does not know it exists.
For a codebase with no style settings yet, start from ReSharper's Detect Code Style Settings, or in Rider Auto-Detect Code Style Rules. The derive_style_guide prompt walks an agent through the same job without an IDE.
Configuration
Set these in the client config's env block. All are optional. The JB_ variables are passed on to jb, and the RESHARPER_MCP_ ones govern the server itself.
Variable | Default | Purpose |
| discovered | Solution to use when the working directory has none or several; the |
| none | A |
|
| ReSharper cache directory. |
| none | Semicolon-separated ReSharper plugin IDs to load. |
|
| Custom NuGet source for those plugins. |
|
| Cap in seconds on one |
| on |
|
| on |
|
|
| Level for the rolling file log: |
| 25,000 characters | Client output budget that responses are reduced to fit, at 2.5 characters per token. |
The solution comes from the solutionPath argument, then JB_SOLUTION_PATH, then the one .sln or .slnx in the working directory, with no walk up to a parent. The first two also accept a solution filter (.slnf), whose settings are read from the solution it names. Logs roll daily under %LOCALAPPDATA%\Zphil.ReSharperCli\logs on Windows, and the platform equivalent elsewhere.
Two guides go deeper, and the server serves both as MCP resources for an agent to read. The setup guide (resharper://guides/setup) covers discovery, the cache, run times and output limits. The configuration guide (resharper://guides/configuration) covers settings layers, cleanup profiles, and keeping a deliberate style from being reverted.
Cleanup reminder hook
The single end-of-task cleanup is easy for an agent to forget. This Claude Code PostToolUse hook adds a one-line reminder to the agent's context after each .cs or .razor edit. It never edits code or calls the tool, so the agent still decides when to clean up. Add it to .claude/settings.json; the command needs a POSIX shell, which on Windows is Git Bash:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "grep -qiE '\"file_path\"[[:space:]]*:[[:space:]]*\"[^\"]*\\.(cs|razor)\"' && printf '%s' '{\"hookSpecificOutput\":{\"hookEventName\":\"PostToolUse\",\"additionalContext\":\"When this task is done, batch every edited .cs/.razor file into one resharper_cleanup call.\"}}' || true"
}
]
}
]
}
}Privacy Policy
resharper-cli-mcp collects nothing. It has no telemetry, analytics, accounts or remote logging, and it makes no network calls of its own. Each tool call runs the jb on your machine, and the results go back over stdio to the MCP client that started the server.
Everything the server writes stays on that machine: its diagnostic log, the inspection reports a call asks for, and bookkeeping files beside ReSharper's caches. The log and the reports can contain absolute paths and the rule IDs and messages read from your solution. PRIVACY.md is the full policy, with where each file lives and how long it is kept.
Contributing
Contributions are welcome. Bug reports reproduced on a public solution, MCP client-compatibility fixes, and improvements to discovery or output formatting land best. CONTRIBUTING.md covers the development setup and the test architecture, and SECURITY.md covers reporting a security issue privately.
License
MIT; see LICENSE.
JetBrains and ReSharper are trademarks of JetBrains s.r.o. This project is an independent wrapper of their ReSharper Command Line Tools, which ship under JetBrains' own license.
Available Tools
3 toolsresharper_cleanupReSharper Cleanup CodeADestructiveIdempotent
Run ReSharper code cleanup to format files in place, fixing formatting, code style, unused usings, var usage, modifier order and braces. Each call loads the files' projects and their references before it rewrites anything, so make one call per task with every modified file in it.
Inputs: files (required), profile, solutionPath.
resharper_inspectReSharper Inspect CodeARead-onlyIdempotent
Run ReSharper code inspection (static analysis, lint) over a C# solution and return the warnings, errors and suggestions it finds.
Inputs: files, detail, report, severity, +1 more.
resharper_reset_cacheReSharper Reset CacheADestructiveIdempotent
Delete this solution's ReSharper analysis cache so the next inspect or cleanup rebuilds it from cold. The cure for inspect reporting compilation errors a successful build does not: a stale index serves those until the cache is dropped, unless jb predates the project's C# version, which only a jb update cures. Build first, because on a checkout that was never built or restored the errors are real and a reset only adds a cold analysis to the build it still needs. Costs the next call a full cold analysis, so it is not routine maintenance. A deleted checkout's cache outlives it: pass its old solution path as solutionPath to reclaim it.
Inputs: solutionPath.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: resetting the analysis cache, formatting/fixing files, and running static analysis. The names and descriptions make it easy to choose the correct operation without overlap.
All tools use a consistent snake_case convention and shared `resharper_` prefix. The only minor deviation is that `reset_cache` is verb_noun while `cleanup` and `inspect` are bare verbs, but the pattern remains predictable.
Three tools is somewhat lean, but each maps to a meaningful ReSharper CLI capability: inspect, cleanup, and cache reset. The surface is well-scoped for a focused analysis/formatting server.
The core lifecycle of running inspections, applying cleanup, and recovering from stale caches is covered. Minor gaps exist around richer inspection result handling, but agents can accomplish the main workflows with these tools.
Maintenance
Related MCP Connectors
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
MCP server to assist with JxBrowser development.
Related MCP Servers
AlicenseNot gradedqualityDmaintenanceThe server proxies requests from client to JetBrains IDE.1,000 npm963Apache 2.0- AlicenseNot gradedqualityDmaintenanceExposes Language Server Protocol (LSP) tools such as diagnostics, goto definition, find references, symbols, and rename as a stdio MCP server.9MIT
- FlicenseAqualityDmaintenanceMinimal MCP server bridging a Roslyn C# language server to AI agents, exposing tools for diagnostics, call hierarchy, and type hierarchy.1-
- AlicenseBqualityCmaintenanceMCP server for structured patching of Mono / .NET assemblies.6MIT