Resharper Cli Mcp
io.github.andypgray由 GitHub 账号 andypgray 发布v1.8.0更新于 Oct 31, 2026
ReSharper CLI inspection/cleanup via MCP. Unofficial: not affiliated with or endorsed by JetBrains.
概览
为编码助手运行 JetBrains ReSharper 命令行工具:检查 .NET 解决方案的问题,并对指定文件执行 ReSharper 代码清理。
- 可以做什么
- 对整个解决方案运行 ReSharper 检查,按文件分组返回问题,可按 glob 和严重级别筛选,并可写出 markdown 报告文件
- 对指定文件运行 ReSharper 清理配置,并报告哪些文件在磁盘上被改动
- 重置或回收解决方案的 ReSharper 缓存
- 以 MCP 资源形式提供安装与配置指南,并提供引导助手推导代码风格指南的提示词
- 适用场景
- 适合在 .NET 解决方案中由助手修改 C# 或 Razor 代码时使用,让助手遵循与 IDE 相同的 ReSharper 严重级别和代码风格,或在任务结束时执行可重复的清理,而不必自己调用 jb 并解析报告文件。
- 运行要求
- 仅本地进程(stdio)。需要安装 .NET 10 SDK 和 JetBrains ReSharper 命令行工具(均为 .NET 全局工具),以及本服务器包。工作目录中需能发现 .sln 或 .slnx,或通过 JB_SOLUTION_PATH 指定。可选环境变量:JB_CACHE_HOME、JB_SETTINGS_PATH、JB_EXTENSIONS、JB_EXTENSION_SOURCE、RESHARPER_MCP_TIMEOUT_SECS、RESHARPER_MCP_PREWARM、RESHARPER_MCP_CLEANUP_FILTER、RESHARPER_MCP_LOG_LEVEL。
安装
在 SourceWeft 中
- 打开 控制台中的 Resharper Cli Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
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 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.
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 and JetBrains' ReSharper Command Line Tools, which are free and need no ReSharper license. Both install as .NET global tools:
Register the command resharper-cli-mcp, which takes no arguments, with your MCP client. For Claude Code, add it to .mcp.json:
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:
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:
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
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:
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.
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:
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.
来源:README.md,提交 fa47c67
工具
0版本历史
4- v1.8.0最新Oct 31, 2026
- v1.7.2Oct 21, 2026
- v1.7.1Oct 6, 2026
- v1.7.0Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分