resharper-cli-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| JB_CACHE_HOME | No | ReSharper cache directory. Defaults to ~/.jb-cache. | |
| JB_EXTENSIONS | No | Semicolon-separated ReSharper plugin IDs to load. | |
| JB_SETTINGS_PATH | No | Explicit .DotSettings file for jb, mounted as a Custom layer above the solution's and every project's own settings. | |
| JB_SOLUTION_PATH | No | Solution to analyse when the working directory holds zero or several. The solutionPath tool argument overrides it for one call. | |
| JB_EXTENSION_SOURCE | No | Custom NuGet source for those ReSharper plugins. | |
| MAX_MCP_OUTPUT_TOKENS | No | Output budget the response is rendered to fit. Set by the MCP client rather than by hand; 25,000 characters when unset. | |
| RESHARPER_MCP_PREWARM | No | Set to off to stop the background cache pre-warm that runs when a client connects. | |
| RESHARPER_MCP_LOG_LEVEL | No | Minimum level for the rolling file log. Defaults to Warning. | |
| RESHARPER_MCP_TIMEOUT_SECS | No | Cap in seconds on one jb run, and on the wait for one already in flight. Defaults to 600, clamped to 60-86,400. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server runs JetBrains' ReSharper command-line tools. resharper_inspect is read-only — run it before editing to see existing issues, or after to catch regressions. resharper_cleanup rewrites files in place: call it once, at the end of a task, with every modified .cs/.razor file batched into that single call.
Cleanup is cosmetic: it fixes formatting, unused usings, var style, modifier order, redundant qualifiers, brace style, and similar. Do not spend edit effort on those by hand — write correct logic and naming and let cleanup do the polish. After a cleanup there is no need to re-inspect or re-build to check it: it never changes behavior.
Before changing what ReSharper enforces — a settings file, a cleanup profile, suppressing a rule, or stopping cleanup from normalizing a deliberate style — read the resharper://guides/configuration resource. When a call cannot find the solution, times out, or comes back shortened, read resharper://guides/setup.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| resharper_inspectA | Run ReSharper code inspection (static analysis, lint) over a C# solution and return the warnings, errors and suggestions it finds. |
| resharper_cleanupA | 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. |
| resharper_reset_cacheA | 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. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| derive_style_guide | Derive an intentional ReSharper/editorconfig style guide from an existing (legacy) C# codebase, reconcile it with tooling already present (StyleCop, analyzers), and validate it with the resharper_inspect loop. The server does not infer settings; this recipe guides you to. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| resharper_configuration_guide | How ReSharper configuration works for this server: inspection severities drive resharper_inspect while the cleanup profile drives resharper_cleanup (they never share a switch), how to protect a deliberate style from cleanup, where settings and .editorconfig are read from, and the DotSettings key shapes. Load this before changing what ReSharper enforces. It does not cover running the server: for a call that cannot find the solution, times out, or comes back shortened, read resharper://guides/setup instead. |
| resharper_setup_guide | How to run this server and diagnose a failing call: installing and locating jb (PATH, then ~/.dotnet/tools), which solution a call runs against (the solutionPath argument, JB_SOLUTION_PATH, then a single .sln/.slnx in the working directory with no parent walk), why the first call is slow, the run cap (this server's own, and raisable) and why calls against one solution queue, how MAX_MCP_OUTPUT_TOKENS caps output, how a reduced result differs from a truncated one and how to get the complete itemised findings written to a file instead, the JB_SETTINGS_PATH, JB_CACHE_HOME, JB_EXTENSIONS, JB_EXTENSION_SOURCE, RESHARPER_MCP_TIMEOUT_SECS, RESHARPER_MCP_PREWARM, RESHARPER_MCP_CLEANUP_FILTER, and RESHARPER_MCP_LOG_LEVEL variables, and where logs go. Load this when a call cannot find jb or the solution, times out, reports another run already in flight, comes back shortened, or is slower than the queue explains alongside a jb run outside this server — which is also how an unexpected extra cache generation appears. |
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.