Skip to main content
Glama

resharper-cli-mcp

CI works with jb OpenSSF Scorecard NuGet NuGet downloads

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 cleanupcode runs Built-in: Full Cleanup unless it is given --profile, whatever the solution's settings say. The server passes the profile the solution names under SilentCleanupProfile, 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 jb on 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-MCP

Run times

Every run analyses the whole solution, because resolving symbols needs the full solution model. files narrows what is reported, not what is analysed. 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 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.ReSharperCli

Register 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

.mcp.json beside the solution

servers, with "type": "stdio"

VS Code

.vscode/mcp.json

servers, with "type": "stdio"

Cursor

.cursor/mcp.json, or ~/.cursor/mcp.json for every project

mcpServers

Rider AI Assistant

Settings | Tools | AI Assistant | MCP

mcpServers

Junie

.junie/mcp/mcp.json, or ~/.junie/mcp/mcp.json for every project

mcpServers

Cline

cline_mcp_settings.json, under Configure MCP Servers

mcpServers

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 in VS Code Install in Visual Studio Add to Cursor Add to LM Studio

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-mcp

The 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 and jb, and ReSharper's caches live in the plugin's data directory.

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 and the ReSharper Command Line Tools first. Run cap moves the 10-minute limit on one run.

Tools

Tool

Mutates files

What it does

resharper_inspect

no

Runs jb inspectcode and returns the issues, grouped by file.

resharper_cleanup

yes

Runs jb cleanupcode on the given files and reports which ones changed on disk.

resharper_reset_cache

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

JB_SOLUTION_PATH

discovered

Solution to use when the working directory has none or several; the solutionPath tool argument overrides it for one call.

JB_SETTINGS_PATH

none

A .DotSettings file outside the solution's own, mounted as a Custom layer above the solution's and every project's settings.

JB_CACHE_HOME

~/.jb-cache

ReSharper cache directory.

JB_EXTENSIONS

none

Semicolon-separated ReSharper plugin IDs to load.

JB_EXTENSION_SOURCE

jb's own

Custom NuGet source for those plugins.

RESHARPER_MCP_TIMEOUT_SECS

600

Cap in seconds on one jb run, and on the wait for one already in flight, clamped to 60–86,400.

RESHARPER_MCP_PREWARM

on

off disables the cache pre-warm when a client connects.

RESHARPER_MCP_LOG_LEVEL

Warning

Level for the rolling file log: Verbose, Debug, Information, Warning, Error or Fatal. The Microsoft names Trace and Critical also work, and any value it does not recognise falls back to Warning.

MAX_MCP_OUTPUT_TOKENS

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. 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 tools
resharper_cleanupReSharper Cleanup CodeA
DestructiveIdempotent

Run ReSharper code cleanup to reformat and normalize files in place. Each call analyses the whole solution whatever the file count, so make one call per task with every modified file in it.

ParametersJSON Schema
NameRequiredDescriptionDefault
filesYesFile paths to clean up. Each is relative to the solution root, or absolute. jb matches them against the files that belong to a project in the solution, so one that is on disk but in no project matches nothing, which nothing here can detect. Wildcards are allowed and expanded by jb; a non-wildcard path that does not exist fails the whole call before anything is rewritten. An element joining several paths with ; or , is split into separate paths.
profileNoReSharper cleanup profile name. Defaults to the profile the solution declares, else full cleanup.
solutionPathNoPath to the .sln/.slnx to run against. Overrides JB_SOLUTION_PATH and working-directory discovery.

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond annotations (readOnlyHint=false, destructiveHint=true, idempotentHint=true), the description discloses that files are modified 'in place' and that every call analyzes the whole solution regardless of file count — a meaningful scope/performance trait. The parameter schema additionally reveals atomic failure behavior (a non-existent non-wildcard path fails the entire call before anything is rewritten).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the purpose verb in the first sentence and a single high-value operational rule in the second. No filler; every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and a destructive in-place action, the description plus fully-detailed parameter schema covers purpose, side effects, batching behavior, defaults, and failure modes. The only minor gap is the absence of an explicit statement of what a successful call returns or how to verify results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with rich descriptions (relative/absolute paths, wildcard expansion, ';'/',' separators, failure modes, profile defaults, solutionPath overriding JB_SOLUTION_PATH). The main description adds the batching strategy that clarifies how to use the files parameter, lifting it above the high-coverage baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource — 'Run ReSharper code cleanup to reformat and normalize files in place' — which precisely states what the tool does. It clearly distinguishes itself from siblings resharper_reset_cache (cache reset) and resharper_inspect (analysis).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The second sentence gives explicit operational guidance — 'Each call analyses the whole solution whatever the file count, so make one call per task with every modified file in it' — telling the agent exactly how to batch calls. It does not explicitly contrast with sibling tools, but the purpose statement makes selection clear enough.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

resharper_inspectReSharper Inspect CodeA
Read-onlyIdempotent

Run ReSharper static analysis on the solution and return the code issues it finds.

ParametersJSON Schema
NameRequiredDescriptionDefault
filesNoAnt-style globs narrowing the findings to matching files, for example src/**/*.cs. The analysis stays solution-wide, so a scoped run is no faster. Each is relative to the solution root, or absolute. jb matches them against the files that belong to a project in the solution, so one that is on disk but in no project matches nothing, which nothing here can detect. An element joining several paths with ; or , is split into separate paths.
detailNoCap on the detail the response carries: Full, the default, lists every issue on its own line, and Minimal is one line of totals. Rendering starts at this level and never goes above it, but still steps below it when the result does not fit the output budget. The DETAIL REDUCED note says which of the two happened. Response shaping only: the same analysis runs whatever the level, so a lower level does not make a call finish sooner. Pair detail=Minimal with report=Markdown for a cheap verdict in the response and every finding in the file.Full
reportNoWrite the complete itemised findings to a file, and name it in the response. Markdown lists every issue with its own message, which is what the response listing collapses once a solution-wide run exceeds the output budget. The file lands in a directory this server owns and is pruned after 7 days; the response carries the summary either way.None
severityNoMinimum severity to report. Error is ReSharper's compilation-error level, not a tier of high-priority warnings; raising to it usually reports nothing.Warning
solutionPathNoPath to the .sln/.slnx to run against. Overrides JB_SOLUTION_PATH and working-directory discovery.

TDQS

A3.8/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The report parameter explicitly says 'Write the complete itemised findings to a file' and mentions pruning after 7 days, which is a write side effect. This contradicts the annotation readOnlyHint: true, so behavioral transparency is seriously undermined.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The main description is concise and front-loaded, and the parameter descriptions are information-dense. Some phrases are slightly verbose, but nearly every sentence adds useful detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description reasonably explains what the response contains: issue listings, summary lines, detail reduction notes, and optional report filenames. It does not cover failure modes such as invalid solution paths, but the expected behavior is mostly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All five parameters have thorough, meaningful descriptions that go well beyond the schema: files explains glob matching and performance implications, detail clarifies rendering versus analysis, report explains file output and retention, severity disambiguates Error, and solutionPath explains override behavior.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Run ReSharper static analysis on the solution and return the code issues it finds.' This makes the tool's purpose immediately clear and distinct from typical maintenance or cleanup actions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Parameter descriptions provide practical guidance, such as pairing detail=Minimal with report=Markdown for a cheap verdict and noting that solutionPath overrides environment discovery. However, it does not explicitly compare against sibling tools like resharper_cleanup or resharper_reset_cache.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

resharper_reset_cacheReSharper Reset CacheA
DestructiveIdempotent

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

ParametersJSON Schema
NameRequiredDescriptionDefault
solutionPathNoPath to the .sln/.slnx to run against. Overrides JB_SOLUTION_PATH and working-directory discovery.

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true, idempotentHint=true, and readOnlyHint=false, which the description reinforces. Beyond that it adds genuinely useful behavior: the cold-analysis performance cost of the next call, the build-first prerequisite, and the surprising fact that a deleted checkout's cache outlives it. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but front-loaded with purpose and every sentence earns its place — usage boundaries, prerequisites, cost, and an edge case. Slightly denser than strictly necessary, but not bloated or repetitive. A 4 is fair.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive tool with subtle failure modes, the description covers purpose, when-to-use, when-not-to-use, consequences, and an edge case. No output schema is needed since this is a void side-effect operation, and the single parameter is fully handled. Nothing an agent needs to invoke it safely is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% so the baseline is 3. The description adds real value beyond the schema by explaining the deleted-checkout case for solutionPath ('pass its old solution path as solutionPath to reclaim it'), which the schema alone would not convey. That pushes it to a 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Delete this solution's ReSharper analysis cache') and the purpose (rebuild from cold on next inspect/cleanup). It implicitly distinguishes from the siblings inspect/cleanup by framing the cache as the thing they consume, so an agent can tell them apart without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use ('cure for inspect reporting compilation errors a successful build does not'), when-not-to-use ('on a checkout that was never built or restored the errors are real'), and a cost warning ('not routine maintenance'). It even handles the deleted-checkout edge case. This is exemplary usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv1.7.0
    • Changedresharper_cleanup1 field changed
      • changedInput schema / properties / files / description
        Previous value: -"File paths to clean up. Each is relative to the solution root, or absolute. jb matches them against the files that belong to a project in the solution, so one that is on disk but in no project matches nothing. Wildcards are allowed and expanded by jb; a non-wildcard path that does not exist fails the whole call before anything is rewritten. An element joining several paths with ; or , is split into separate paths."New value: +"File paths to clean up. Each is relative to the solution root, or absolute. jb matches them against the files that belong to a project in the solution, so one that is on disk but in no project matches nothing, which nothing here can detect. Wildcards are allowed and expanded by jb; a non-wildcard path that does not exist fails the whole call before anything is rewritten. An element joining several paths with ; or , is split into separate paths."
    • Changedresharper_inspect1 field changed
      • changedInput schema / properties / files / description
        Previous value: -"Ant-style globs scoping the analysis to specific files, for example src/**/*.cs. Each is relative to the solution root, or absolute. jb matches them against the files that belong to a project in the solution, so one that is on disk but in no project matches nothing. An element joining several paths with ; or , is split into separate paths."New value: +"Ant-style globs narrowing the findings to matching files, for example src/**/*.cs. The analysis stays solution-wide, so a scoped run is no faster. Each is relative to the solution root, or absolute. jb matches them against the files that belong to a project in the solution, so one that is on disk but in no project matches nothing, which nothing here can detect. An element joining several paths with ; or , is split into separate paths."
  2. 3 tool updatesv0.1.0
    • First observedresharper_cleanup
    • First observedresharper_inspect
    • First observedresharper_reset_cache

TDQS

A4.2/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: resetting the cache, cleanup formatting, and inspecting for issues. No overlap or ambiguity.

Naming Consistency5/5

All tool names follow the same 'resharper_<action>' pattern with clear verb-object structure, consistent and predictable.

Tool Count4/5

Three tools is slightly lean but appropriate for a focused ReSharper CLI server covering the essential operations.

Completeness4/5

Covers the core ReSharper workflow (cache reset, cleanup, inspect). Missing a build or run action, but for the stated purpose it is reasonably complete.

Maintenance

ActivityActive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers