Skip to main content
ClaudeWave
andypgray avatar
andypgray

resharper-cli-mcp

View on GitHub

MCP server wrapping JetBrains' ReSharper CLI for headless C# inspection and code cleanup for coding agents. Unofficial, not affiliated with JetBrains.

MCP ServersOfficial Registry0 stars0 forksC#MITUpdated today
Install in Claude Code / Claude Desktop
Method: Manual
Claude Code CLI
git clone https://github.com/andypgray/resharper-cli-mcp
1. Run the command above in your terminal (Claude Code), or paste the JSON config into claude_desktop_config.json (Claude Desktop).
2. Replace any <placeholder> values with your API keys or paths.
3. Restart Claude. The MCP server and its tools appear automatically.
💡 Clone https://github.com/andypgray/resharper-cli-mcp and follow its README for install instructions.
Use cases

MCP Servers overview

# resharper-cli-mcp

<!-- mcp-name: io.github.andypgray/resharper-cli-mcp -->

[![CI](https://github.com/andypgray/resharper-cli-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/andypgray/resharper-cli-mcp/actions/workflows/ci.yml) [![OpenSSF Scorecard](https://img.shields.io/ossf-scorecard/github.com/andypgray/resharper-cli-mcp?label=openssf+scorecard)](https://scorecard.dev/viewer/?uri=github.com/andypgray/resharper-cli-mcp) [![NuGet](https://img.shields.io/nuget/v/Zphil.ReSharperCli?logo=nuget&label=nuget)](https://www.nuget.org/packages/Zphil.ReSharperCli) [![NuGet downloads](https://img.shields.io/nuget/dt/Zphil.ReSharperCli?label=downloads)](https://www.nuget.org/packages/Zphil.ReSharperCli)

resharper-cli-mcp is an MCP server that runs JetBrains' ReSharper command-line tools and exposes them to C# coding agents over stdio. It is unofficial — not affiliated with or endorsed by JetBrains.

It gives an agent two things a text search cannot: a real ReSharper inspection of your solution (`resharper_inspect`), and ReSharper's own code cleanup applied in place (`resharper_cleanup`). The server shells out to a `jb` you install yourself, and bundles no JetBrains software.

## Quickstart

The server needs the .NET 10 SDK and JetBrains' [ReSharper Command Line Tools](https://www.jetbrains.com/help/resharper/ReSharper_Command_Line_Tools.html). Both install as .NET global tools, and neither needs an IDE.

```bash
dotnet tool install -g JetBrains.ReSharper.GlobalTools
dotnet tool install -g Zphil.ReSharperCli
```

Register the server with your MCP client under the command `resharper-cli-mcp`. For Claude Code, add it to `.mcp.json`:

```json
{
  "mcpServers": {
    "resharper": {
      "command": "resharper-cli-mcp"
    }
  }
}
```

The server finds a single `.sln`/`.slnx` in its working directory. When that directory holds zero or several, set `JB_SOLUTION_PATH` in the config's `env` block or pass `solutionPath` on the call.

VS Code and Cursor users can add the server in one click, once both tools are installed:

[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=resharper&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22resharper-cli-mcp%22%7D) [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=resharper&config=eyJjb21tYW5kIjoicmVzaGFycGVyLWNsaS1tY3AifQ==)

## Install as a Claude Code plugin

Claude Code users can install everything in one step instead of editing `.mcp.json` by hand. This repository doubles as a single-plugin marketplace, so the two tools, the `derive_style_guide` prompt, and both guide resources — `resharper://guides/configuration` for what ReSharper enforces and `resharper://guides/setup` for running the server — arrive together:

```
/plugin marketplace add andypgray/resharper-cli-mcp
/plugin install resharper-cli-mcp@resharper-cli-mcp
```

The plugin starts the server with `dotnet dnx`, which fetches `Zphil.ReSharperCli` from NuGet on first use — so you skip `dotnet tool install` for the wrapper itself. You still need the .NET 10 SDK and JetBrains' ReSharper Command Line Tools (`dotnet tool install -g JetBrains.ReSharper.GlobalTools`), which this project never bundles. ReSharper's caches live in the plugin's own data directory, outside your source tree.

## Tools

| Tool | Mutates files | What it does |
|---|---|---|
| `resharper_inspect` | no | Runs ReSharper InspectCode and returns the issues, grouped by file. |
| `resharper_cleanup` | yes | Runs ReSharper CleanupCode to reformat and normalize the given files in place. |

Scope `resharper_inspect` with the `files` glob and raise `severity` (`Suggestion`, `Warning`, `Error`; default `Warning`) to control how much comes back. Each issue carries a file, line, severity, rule ID, and message:

```text
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.
```

Call `resharper_cleanup` once, at the end of a task, with every file you changed batched into the one call.

The first run on a solution is slow while ReSharper builds its caches under `--caches-home`; later runs reuse them and finish in seconds. The server caps each run at 5 minutes. If your MCP client's own tool-call timeout is shorter than a cold run needs, the client gives up first. In Claude Code, raise it with a per-server `"timeout"` in milliseconds in `.mcp.json`, or the `MCP_TOOL_TIMEOUT` environment variable; raising it past 5 minutes has no effect, since the server's own cap binds first.

## Configuration

Set these in the MCP client config's `env` block. All are optional.

| Variable | Purpose |
|---|---|
| `JB_SOLUTION_PATH` | Solution to use when the working directory has zero or several. |
| `JB_SETTINGS_PATH` | Explicit `.DotSettings` file to pass to `jb`. |
| `JB_CACHE_HOME` | ReSharper cache directory (default `~/.jb-cache`). |
| `JB_EXTENSIONS` | Semicolon-separated ReSharper plugin IDs to load. |
| `JB_EXTENSION_SOURCE` | Custom NuGet source for those plugins. |
| `RESHARPER_MCP_LOG_LEVEL` | Level for the rolling file log (default `Warning`). |
| `MAX_MCP_OUTPUT_TOKENS` | Client output budget; caps large inspection results. |

The `solutionPath` tool argument overrides `JB_SOLUTION_PATH` for a single call. When a result would exceed `MAX_MCP_OUTPUT_TOKENS` (2.5 characters per token, or 25,000 characters when unset), the server truncates at a line boundary and appends a note saying how much it dropped.

**Solution discovery** tries, in order: the `solutionPath` argument, then `JB_SOLUTION_PATH`, then a single `.sln`/`.slnx` in the working directory (top level only, no parent walk). Zero or several without an override is an error that names the variable to set.

**Settings discovery** tries, in order: `JB_SETTINGS_PATH` (a missing file logs a warning and falls through), then a `.DotSettings` file beside the solution, then `GlobalSettingsStorage.DotSettings` in the JetBrains shared directory, then none. On top of whichever it finds, `jb` also reads `.editorconfig` from the source tree automatically — no flag needed — so editorconfig style rules apply even with no `.DotSettings` at all.

Logs roll daily under `%LOCALAPPDATA%\Zphil.ReSharperCli\logs` on Windows, and the platform-equivalent path elsewhere. Nothing leaves the machine; [PRIVACY.md](https://github.com/andypgray/resharper-cli-mcp/blob/main/PRIVACY.md) states that as policy.

## Deriving a style guide for a legacy codebase

Adding this server to a large existing solution unlocks a second workflow: deriving an *intentional* ReSharper style guide from the code you already have, so an inspection flags real house-style deviations rather than un-configured defaults. The server advertises an MCP prompt, `derive_style_guide` (surfaced as a slash command or prompt-picker entry in clients that render prompts), that walks an agent through it.

Be clear on the division of labour: ReSharper's command-line tools have no "infer settings from code" verb, and **this server does not infer settings**. The agent derives the rules from evidence — the code plus whatever is already in the repo (StyleCop, analyzers, an existing `.editorconfig`) — and `resharper_inspect` *validates* them: scope an inspection to a representative folder, then keep or silence each noisy rule until the remaining output is all intentional. The recipe is `.editorconfig`-first (portable across ReSharper, StyleCop.Analyzers, Roslyn, `dotnet format`, and Rider), spilling only ReSharper-only knobs and cleanup-profile definitions into `.sln.DotSettings`. When the codebase genuinely mixes conventions, the prompt pauses and asks rather than guessing.

If a teammate has ReSharper or Rider, prefer JetBrains' first-party [Detect Code Style Settings](https://blog.jetbrains.com/dotnet/2018/12/05/detection-code-styles-naming-resharper/) for the baseline; it is IDE-only, so this recipe is the path for headless, CI, or no-licence use, and it adds StyleCop reconciliation and severity tuning on top. See also ReSharper's [Use EditorConfig](https://www.jetbrains.com/help/resharper/Using_EditorConfig.html) and the [InspectCode](https://www.jetbrains.com/help/resharper/InspectCode.html) / [CleanupCode](https://www.jetbrains.com/help/resharper/CleanupCode.html) references. The embedded prompt is the full recipe; this section is only a digest of it.

## Cleanup is cosmetic

`resharper_cleanup` never changes behavior. Its fallback `Built-in: Full Cleanup` profile fixes formatting and style only, so an agent should write correct logic and let the cleanup pass handle the polish. There is no need to re-inspect or rebuild after it. That profile handles all of these:

- unused usings, sorted and shortened qualified references
- indentation, spacing, line breaks, and wrapping
- `var` versus explicit type, per the solution's settings
- modifier order, and explicit or implicit modifiers as configured
- redundant parentheses, `this.` qualifiers, casts, and default values
- braces around single statements, per style
- auto-properties, readonly fields, object-creation style, trailing commas, namespace style

Keep the agent's editing effort on logic, types, naming, and architecture. For a legacy codebase where Full Cleanup would churn regions you did not touch — or for a deliberate style it would normalize away — define a narrower profile (for example `Custom: No Reordering`) in the solution's `.sln.DotSettings`. Name it under `SilentCleanupProfile` there and every call uses it without a `profile` argument, including calls from an agent that does not know it exists; the `profile` argument overrides it per call.

`resharper_cleanup` reports which of the files it chan
ai-agentsclaude-codecsharpdotnetdotnet-toollintermcpmcp-servermcp-toolsmodel-context-protocolresharperstatic-analysis

What people ask about resharper-cli-mcp

What is andypgray/resharper-cli-mcp?

+

andypgray/resharper-cli-mcp is mcp servers for the Claude AI ecosystem. MCP server wrapping JetBrains' ReSharper CLI for headless C# inspection and code cleanup for coding agents. Unofficial, not affiliated with JetBrains. It has 0 GitHub stars and was last updated today.

How do I install resharper-cli-mcp?

+

You can install resharper-cli-mcp by cloning the repository (https://github.com/andypgray/resharper-cli-mcp) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.

Is andypgray/resharper-cli-mcp safe to use?

+

andypgray/resharper-cli-mcp has not been audited yet by our security agent. Review the original repository on GitHub before using it in production.

Who maintains andypgray/resharper-cli-mcp?

+

andypgray/resharper-cli-mcp is maintained by andypgray. The last recorded GitHub activity is from today, with 2 open issues.

Are there alternatives to resharper-cli-mcp?

+

Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.

Deploy resharper-cli-mcp to your cloud

Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.

Maintain this repo? Add a badge to your README

Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.

Featured on ClaudeWave: andypgray/resharper-cli-mcp
[![Featured on ClaudeWave](https://claudewave.com/api/badge/andypgray-resharper-cli-mcp)](https://claudewave.com/repo/andypgray-resharper-cli-mcp)
<a href="https://claudewave.com/repo/andypgray-resharper-cli-mcp"><img src="https://claudewave.com/api/badge/andypgray-resharper-cli-mcp" alt="Featured on ClaudeWave: andypgray/resharper-cli-mcp" width="320" height="64" /></a>

More MCP Servers

resharper-cli-mcp alternatives