AgentHubAgentHub

claude-roslyn-lsp MCP Setup & Guide

MCP ServerMCP RegistryOfficial

io.github.lahma/claude-roslyn-lsp · v1.0.0

C# semantic rename, code actions, fix-all, formatting and diagnostics via Microsoft's Roslyn server

Copy the install config on this page first, then verify docs and permissions upstream.

Overview

C# semantic rename, code actions, fix-all, formatting and diagnostics via Microsoft's Roslyn server claude-roslyn-lsp is a MCP Server listed from MCP Registry. Transports: stdio. This page includes an overview, setup tutorial, install commands, and use cases for Trae, Tongyi Lingma, Cursor, Claude Code, and VS Code.

Use cases

AgentHub Verified AvailabilityTested & Ready

Automated pipeline validated install commands, protocol & client compatibility

Verified At2026-11-21
Install Snippets TestedCLI & JSON config syntax verified
Protocol Handshake ReadyComplies with JSON-RPC 2.0 specifications
Origin Registry ActiveSourced from official-mcp-registry
Verified ClientsClaude Code、Claude Desktop、Cursor 等
Security Tier: A+ 级 · 官方认证推荐 (A+)·Maintained by official/verified teams, audited for standard MCP protocol compliance.
No auto-generated install guide — see the source repository README.

Troubleshooting & Common ErrorsFAQ

Common connection errors and verified fixes for claude-roslyn-lsp

Getting 'connection closed' or exit code 1 in Cursor / Claude Code for claude-roslyn-lsp?

Usually caused by missing runtime paths or IDE environment inheritance. Fix steps: 1. Verify Node.js 18+ (npx) or Python 3.10+ (uvx) is installed; 2. Run 'which npx' or 'which uvx' in terminal, and replace 'command' with absolute path; 3. Reload or restart the client window after modifying config.

Fix Snippet
# Check binary path in terminal:
which npx
node -v
Getting 'spawn npx ENOENT' or 'command not found'?

The editor background process does not inherit your full terminal PATH. Solution: Globally install the package, or set the absolute binary path (e.g. C:\Program Files\nodejs\npx.cmd on Windows, or /usr/local/bin/npx on macOS).

Missing required environment variable or authentication failure?

claude-roslyn-lsp requires environment variables (CLAUDE_ROSLYN_LSP_SOLUTION、CLAUDE_ROSLYN_LSP_ROSLYN_PATH、CLAUDE_ROSLYN_LSP_ROSLYN_VERSION、CLAUDE_ROSLYN_LSP_ROSLYN_ARGS、CLAUDE_ROSLYN_LSP_CACHE_DIR、CLAUDE_ROSLYN_LSP_HOME、CLAUDE_ROSLYN_LSP_OFFLINE、CLAUDE_ROSLYN_LSP_TRANSPORT、CLAUDE_ROSLYN_LSP_READY_TIMEOUT_SECONDS、CLAUDE_ROSLYN_LSP_DIAGNOSTICS、CLAUDE_ROSLYN_LSP_DIAGNOSTIC_MIN_SEVERITY、CLAUDE_ROSLYN_LSP_WORKSPACE_DIAGNOSTICS、CLAUDE_ROSLYN_LSP_FILE_WATCHER、CLAUDE_ROSLYN_LSP_SHARE、CLAUDE_ROSLYN_LSP_GC、CLAUDE_ROSLYN_LSP_GC_CONSERVE、CLAUDE_ROSLYN_LSP_IDLE_RECYCLE_MINUTES、CLAUDE_ROSLYN_LSP_RECYCLE_GROWTH_FACTOR、CLAUDE_ROSLYN_LSP_IDLE_SHUTDOWN_MINUTES、CLAUDE_ROSLYN_LSP_LOG_LEVEL、CLAUDE_ROSLYN_LSP_ROSLYN_LOG_LEVEL、CLAUDE_ROSLYN_LSP_OPTIONS). Ensure you have added valid keys under the 'env' object in your config file without trailing whitespace.

Fix Snippet
// .cursor/mcp.json 或 claude_desktop_config.json
{
  "env": {
    "API_KEY": "your_actual_key_here"
  }
}

Tool Mock Playground

Sandbox

claude-roslyn-lsp Tool Interface Simulation · Preview tool schema & outputs without local runtime

Sandbox Ready
fn: claude_roslyn_lspExecute the core tool interface of claude-roslyn-lsp
Request ArgumentsJSON Schema
{
  "target": "claude-roslyn-lsp",
  "action": "execute",
  "options": {
    "mode": "standard",
    "timeoutMs": 5000
  }
}
💡Parameters generated dynamically by Agent runtime
Agent Tool Output

Click 'Run Mock' above

to preview the raw response returned to the LLM

Env: AgentHub Virtual SandboxJSON-RPC 2.0

Decision Guide: Why & When to Use

Assess suitability before installing to save trial-and-error time

Best Suited For
  • PR review
  • Changelog generation
  • Cross-repo issue search
When NOT to Use
  • Replacing human security audit
  • Unauthorized repo access
Recommended Workflow Pairing:View Scenario →

claude-roslyn-lsp + Scenario Prompt → Complete Agent Automation

MCP hands-on: install to visible results

Follow the full lab (expected UI/output + contrast checks). After installing this item, verify with the tutorial prompts.

Open tutorial →

Related resources

Often paired with

insurance-advisor-china

v2.4.21

SkillClawHub7410.3k

io.clawhub.mnetfairy/insurance-advisor-china

中国大陆AI保险顾问。为个人和家庭提供全方位的保险咨询、产品对比、方案设计、投保指导。当用户询问保险配置、保险方案、产品对比、重疾险/医疗险/寿险/意外险/储蓄险推荐、保费计算、保障缺口分析、需求分析、核保合规、理赔等问题时使用。发布产物仅含 SKILL.md + 3 个只读参考文件(references/products.json、insurance-knowledge.md、compliance.md)+ 3 个运行时脚本(needs_analyzer / premium_calculator / plan_designer);数据清洗脚本与回归测试脚本是本地维护工具,不随发布产物分发。

source

ai-insurance-advisor

v2.4.21

SkillClawHub8110.4k

io.clawhub.mnetfairy/ai-insurance-advisor

中国大陆保险顾问。本 skill 覆盖 8 项能力:保险需求分析(needs_analyzer.py)、产品对比(premium_calculator.py + 本地 products.json)、保费计算(premium_calculator.py)、方案设计(plan_designer.py)、保险知识问答(insurance-knowledge.md)、合规要点提示(compliance.md)、朋友圈/社交营销文案生成(agent LLM 生成,无专属脚本)、培训话术支持(agent LLM 生成,无专属脚本)。不提供核保预审、理赔代办、代理人展业工具等能力——这些场景请转人工或调用专业服务。发布产物仅含 SKILL.md + 3 个只读参考文件 + 3 个运行时脚本(needs_analyzer / premium_calculator / plan_designer);数据清洗与回归测试脚本为本地维护工具,不随发布产物分发。

source

中文公文写作

v2.0.63

SkillClawHub7412k

io.clawhub.gongyu0918-debug/chinese-official-writing

用于中文公文、事务性材料和新闻稿件的起草、改写、压缩、润色、审校、文种核对、去口语化、降 AI 味及 Word 格式处理,适用于机关、企事业单位、学校和新闻机构。涵盖申请、请示、报告、通知、通告、意见、决定、决议、议案、公报、命令、函、复函、批复、说明、方案、纪要、公告、公示、通报、制度、规定、办法、细则、操作规程、工作要点、总结、调研、讲话、致辞、主持词、述职、可研、审查材料、技术需求、新闻消息、编者按、新闻评论,以及采购、整改、反馈和 AI 算力等场景。

source

Keep exploring AgentHub

Most people compare similar tools or check scenario guides before installing—start here.

Listing badge: put AgentHub on your site

Copy either snippet into your project homepage, docs, or GitHub README. The badge is a hotlinked SVG — nothing to host — and it links back to this page so visitors can find the install steps.

PreviewListed on AgentHub: claude-roslyn-lsp
HTML
<a href="https://myagenthub.cn/p/io.github.lahma/claude-roslyn-lsp" title="Listed on AgentHub: claude-roslyn-lsp" target="_blank" rel="noopener">
  <img src="https://myagenthub.cn/badge/io.github.lahma/claude-roslyn-lsp?lang=en" alt="Listed on AgentHub: claude-roslyn-lsp" height="20" style="border:0"/>
</a>
Markdown (GitHub README)
[![Listed on AgentHub: claude-roslyn-lsp](https://myagenthub.cn/badge/io.github.lahma/claude-roslyn-lsp?lang=en)](https://myagenthub.cn/p/io.github.lahma/claude-roslyn-lsp)

Badges are generated on the fly from /badge/<package-id>, so name and listing changes propagate automatically. Keep the link target unchanged — it is what counts as the referral.

Unified Manifest

{
  "id": "io.github.lahma/claude-roslyn-lsp",
  "type": "mcp-server",
  "version": "1.0.0",
  "displayName": "claude-roslyn-lsp",
  "description": "C# semantic rename, code actions, fix-all, formatting and diagnostics via Microsoft's Roslyn server",
  "repository": {
    "url": "https://github.com/lahma/claude-roslyn-lsp",
    "source": "github"
  },
  "distribution": {
    "packages": [
      {
        "registryType": "nuget",
        "identifier": "claude-roslyn-lsp",
        "version": "1.0.0",
        "transport": "stdio",
        "environmentVariables": [
          {
            "name": "CLAUDE_ROSLYN_LSP_SOLUTION",
            "description": "Path to the .slnx, .sln or .csproj to load. Optional: the adapter discovers one from the working directory, honouring .vscode/settings.json's dotnet.defaultSolution. Set it in a monorepo, where discovery picks a solution that is often not the one being worked in. A path that does not exist is a startup failure rather than a fall back to discovery."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_ROSLYN_PATH",
            "description": "Directory holding an already-installed Microsoft.CodeAnalysis.LanguageServer.dll, used instead of downloading one. Optional; set it to run air-gapped or against a locally built server. Its version is not checked. Alias: CLAUDE_ROSLYN_LSP_SERVER_PATH."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_ROSLYN_VERSION",
            "description": "Overrides the pinned roslyn-language-server version the adapter downloads from nuget.org. Optional; the pin is the only version this release is tested against, an override has no hash to verify against, and doctor reports it as unverified. Alias: CLAUDE_ROSLYN_LSP_SERVER_VERSION."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_ROSLYN_ARGS",
            "description": "Extra arguments for the Roslyn child process, split on whitespace with no quoting. Development only: it exists so the smoke test can point the launcher at this binary's own scripted backend."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_CACHE_DIR",
            "description": "Where downloaded Roslyn servers are extracted. Optional; defaults to a directory under the adapter's home. Moves the payloads only - logs and staged downloads stay under the home."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_HOME",
            "description": "The adapter's per-user state directory: downloads, logs and lock files. Optional; unset, it falls back to CLAUDE_PLUGIN_DATA and then to the platform cache location (%LOCALAPPDATA%, ~/Library/Caches, $XDG_CACHE_HOME or ~/.cache). Around 140 MB extracted per Roslyn version per platform, so it belongs on a disk with room and outside a roaming profile."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_OFFLINE",
            "description": "Set to 1 to refuse to download a Roslyn server. A missing cache entry becomes an immediate, explained failure instead of a 70 MB fetch. Accepts 1/true/yes/on and 0/false/no/off; default 0."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_TRANSPORT",
            "description": "How the adapter talks to the Roslyn child process: pipe (default) or stdio. The named pipe is preferred because Roslyn writes a startup banner to its own stdout, which under stdio shares a stream with the protocol."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_READY_TIMEOUT_SECONDS",
            "description": "How long a call waits for the workspace to finish loading before it is answered anyway, 1-3600, default 120. Tools report status \"loading\" rather than hanging while they wait."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_DIAGNOSTICS",
            "description": "The pull-to-push diagnostics bridge, on by default. Applies to the lsp verb only: an MCP client asks for diagnostics with getDiagnostics instead. Accepts 1/true/yes/on and 0/false/no/off."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_DIAGNOSTIC_MIN_SEVERITY",
            "description": "The severity floor applied before diagnostics are pushed to an LSP client: error, warning (default), information or hint. The MCP getDiagnostics tool takes its own minSeverity argument instead."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_WORKSPACE_DIAGNOSTICS",
            "description": "Opt-in workspace-wide diagnostics for files that are not open, for the lsp verb. Off unless set, because it needs a full-solution compiler scope, which is what makes a large solution slow."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_FILE_WATCHER",
            "description": "The file-watch bridge, on by default. Without it a file created by a shell command or by git never joins its project and every later answer is silently stale. Accepts 1/true/yes/on and 0/false/no/off."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_SHARE",
            "description": "Whether the lsp and mcp servers share one Roslyn per solution, on by default. Off makes each of them launch a Roslyn of its own, which loads the solution twice and pays for it twice in memory. getWorkspaceStatus reports engine: owned or attached, so which of the two happened is never a guess."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_GC",
            "description": "Which garbage collector the Roslyn child runs with: workstation (the default) or server. Workstation peaks at about 577 MB on a 239-project solution where server peaks at about 2 GB, and costs about 8 seconds of load time. An explicit DOTNET_gcServer in the environment wins over this."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_GC_CONSERVE",
            "description": "The DOTNET_GCConserveMemory level, 0-9, the Roslyn child runs with: it caps how far the child's heap may grow past its live data, so less free space stays committed after a compacting collection. Default 7; 0 sets nothing. An explicit DOTNET_GCConserveMemory in the environment wins over this."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_IDLE_RECYCLE_MINUTES",
            "description": "How long the session has to be idle before a Roslyn child that has grown past its threshold is stopped to give its memory back; the next call relaunches it and waits for the reload. Default 20; 0 switches the recycle off."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_RECYCLE_GROWTH_FACTOR",
            "description": "How far past its post-load baseline the Roslyn child has to have grown before an idle recycle is worth a reload: the threshold is the larger of baseline times this factor and baseline plus 512 MB. A decimal, 1.2-20, default 2."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_IDLE_SHUTDOWN_MINUTES",
            "description": "Stop the Roslyn child after this many idle minutes whatever its size; the next call relaunches it. Default 0, which is off, because every relaunch costs a full solution load."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_LOG_LEVEL",
            "description": "Trace, Debug, Information, Warning, Error, Critical or None (default Information). Logs go to stderr only - stdout is the JSON-RPC channel."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_ROSLYN_LOG_LEVEL",
            "description": "The level handed to the Roslyn child process, default Warning. Its Information level is about twenty lines of narration per start, all of it on this adapter's stderr."
          },
          {
            "name": "CLAUDE_ROSLYN_LSP_OPTIONS",
            "description": "A JSON object merged into the answers the adapter gives Roslyn's workspace/configuration requests, for the sections the defaults get wrong for your repository. A syntax error is a logged warning, never a startup failure."
          }
        ]
      }
    ],
    "remotes": []
  },
  "dependencies": [],
  "installTargets": [
    "claude-code",
    "claude-desktop",
    "cursor",
    "vscode",
    "trae",
    "cherry-studio",
    "lingma",
    "windsurf",
    "cline",
    "workbuddy"
  ],
  "keywords": [],
  "provenance": {
    "origin": "official-mcp-registry",
    "originalId": "io.github.lahma/claude-roslyn-lsp",
    "originalUrl": "https://registry.modelcontextprotocol.io/v0.1/servers/io.github.lahma%2Fclaude-roslyn-lsp/versions/latest",
    "isOfficial": true,
    "status": "active"
  }
}
claude-roslyn-lsp MCP Setup & Guide - AgentHub