ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

SharpLens

โดย pzalutski-pixelรุ่น 1.5.3i★ –iรันบนเครื่อง
ชื่อใน registryio.github.pzalutski-pixel/sharplens

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

67 semantic C#/.NET analysis tools via Roslyn: navigation, refactoring, codegen, audit.

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: อื่น ๆ

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ต้องเตรียมก่อน

  • npmติดตั้ง Node.js (มีคำสั่ง npx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "sharplens": {
      "command": "npx",
      "args": [
        "-y",
        "sharplens-mcp"
      ],
      "env": {
        "DOTNET_SOLUTION_PATH": "ใส่ค่าของคุณ",
        "ROSLYN_LOG_LEVEL": "ใส่ค่าของคุณ",
        "ROSLYN_TIMEOUT_SECONDS": "ใส่ค่าของคุณ"
      }
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add sharplens --env DOTNET_SOLUTION_PATH='ใส่ค่าของคุณ' --env ROSLYN_LOG_LEVEL='ใส่ค่าของคุณ' --env ROSLYN_TIMEOUT_SECONDS='ใส่ค่าของคุณ' -- npx -y sharplens-mcp

เติมค่าที่เว้นว่างไว้ก่อนรัน

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "sharplens": {
      "command": "npx",
      "args": [
        "-y",
        "sharplens-mcp"
      ],
      "env": {
        "DOTNET_SOLUTION_PATH": "ใส่ค่าของคุณ",
        "ROSLYN_LOG_LEVEL": "ใส่ค่าของคุณ",
        "ROSLYN_TIMEOUT_SECONDS": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "sharplens": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "sharplens-mcp"
      ],
      "env": {
        "DOTNET_SOLUTION_PATH": "ใส่ค่าของคุณ",
        "ROSLYN_LOG_LEVEL": "ใส่ค่าของคุณ",
        "ROSLYN_TIMEOUT_SECONDS": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าที่ต้องใส่เอง

  • DOTNET_SOLUTION_PATH env
    Path to .sln or .slnx file to auto-load on startup
  • ROSLYN_LOG_LEVEL env
    Logging verbosity: Trace, Debug, Information, Warning, Error
  • ROSLYN_TIMEOUT_SECONDS env
    Timeout for long-running operations

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 8 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub pzalutski-pixel ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด อื่น ๆi

  • ดาวมากกว่า 0% ของอีก 18498 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 8% ของอีก 18498 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 18498 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

SharpLens ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (1.5.3) เข้า registry 6 เดือนที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Node.js, .NET ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Spec Driven Development, Remote Desktop Commander, Readfirst

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:↓ ดาวน์โหลดต่อสัปดาห์i★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Spec Driven Development

MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.

โดย formulahendryเริ่มต้น↓ 66/สัปดาห์★ 440อัปเดต 14 เดือนที่ผ่านมา

รันบนเครื่อง

Remote Desktop Commander

Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.

โดย desktop-commanderกำลังโต★ 211อัปเดต 3 วันที่ผ่านมา

รันบนคลาวด์✓ desktopcommander.app

Readfirst

What to read and check before changing a file: project rules, risks, checks and tests per file.

โดย jeonghun917กำลังโต↓ 5.3K/สัปดาห์อัปเดต วันนี้

รันบนเครื่อง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

SharpLensMcp

A Model Context Protocol (MCP) server providing 92 AI-optimized tools for .NET/C# semantic code analysis, navigation, refactoring, and code generation using Microsoft Roslyn.

Built for AI coding agents - provides compiler-accurate code understanding that AI cannot infer from reading source files alone.

Installation

Via NuGet (Recommended)
dotnet tool install -g SharpLensMcp

Then run with:

sharplens
Via npm
npx -y sharplens-mcp
Build from Source
dotnet build -c Release

dotnet publish -c Release -o ./publish

Claude Code Setup

  1. Install the tool (pick one):
dotnet tool install -g SharpLensMcp

or

npx -y sharplens-mcp

  1. Create `.mcp.json` in your project root:
{

"mcpServers": { "sharplens": { "type": "stdio", "command": "npx", "args": ["-y", "sharplens-mcp"], "env": { "DOTNET_SOLUTION_PATH": "/path/to/your/Solution.sln (or .slnx)" } } } }

  1. Restart Claude Code to load the MCP server
  1. Verify by asking Claude to run a health check on the Roslyn server
Why Use This with Claude Code?

Claude Code has native LSP support for basic navigation (go-to-definition, find references). SharpLensMcp adds deep semantic analysis:

CapabilityNative LSPSharpLensMcp
Go to definition✅✅
Find references✅✅
Find async methods missing CancellationToken❌✅
Impact analysis (what breaks?)❌✅
Dead code detection❌✅
Complexity metrics❌✅
Safe refactoring with preview❌✅
Batch operations❌✅

Configuration

Environment VariableDescriptionDefault
DOTNET_SOLUTION_PATHPath to a .sln, .slnx or .slnf file (or a directory holding exactly one) to auto-load on startup; the load runs beside the request loop, so initialize answers immediatelyNone (must call load_solution)
SHARPLENS_ABSOLUTE_PATHSUse absolute paths instead of relativefalse (relative paths save tokens)
SHARPLENS_LOG_LEVELLogging verbosity: Trace, Debug, Information, Warning, ErrorInformation
SHARPLENS_TIMEOUT_SECONDSTimeout for long-running operations30
SHARPLENS_MAX_DIAGNOSTICSMaximum diagnostics to return100
SHARPLENS_ENABLE_SEMANTIC_CACHECache the file-path to document lookuptrue (set to false to disable)

The pre-1.6.0 ROSLYN_* spellings of these variables are still read as a fallback; the SHARPLENS_* spelling wins when both are set. Boolean values are case-insensitive. A number that does not parse or is below its minimum falls back to the default, and one above its maximum is capped; each case logs a warning to stderr.

Multi-targeted projects

A project built for several target frameworks is one project to every tool: each result is reported once, with a targetFrameworks list where it exists only under some frameworks. projectName accepts the plain name (MyLib) for all frameworks, or a framework-qualified name (MyLib(net8.0)) for one.

If DOTNET_SOLUTION_PATH is not set, you must call the load_solution tool before using other tools.

Migrating from 1.5.x tool names

Tool names no longer carry the roslyn: prefix — the colon violates the MCP tool-name pattern (^[a-zA-Z0-9_-]{1,64}$), which some clients enforce. Every tool keeps its name minus the prefix:

1.5.x name1.6.0 name
roslyn:load_solutionload_solution
roslyn:get_diagnosticsget_diagnostics
roslyn:rename_symbolrename_symbol
...same rule for all tools...drop the roslyn: prefix

tools/list publishes only the new names. Calls using the old prefixed names are still accepted as aliases for one release and will be removed in the following one.

AI Agent Configuration Tips

AI models may have trained bias toward using their native tools (Grep, Read, LSP) instead of MCP server tools, even when SharpLensMcp provides better capabilities.

To ensure optimal tool usage:

  1. Claude Code: Add to your project's CLAUDE.md:
   For C# code analysis, prefer SharpLensMcp tools over native tools:
  • Use search_symbols instead of Grep for finding symbols
  • Use get_method_source instead of Read for viewing methods
  • Use find_references for semantic (not text) references
  1. Other MCP clients: Configure tool priority in your agent's system prompt

The semantic analysis from Roslyn is more accurate than text-based search, especially for overloaded methods, partial classes, and inheritance hierarchies.

Agent Responsibility: Document Synchronization

Important: SharpLensMcp maintains an in-memory representation of your solution for fast queries. When files are modified externally (via Edit/Write tools), the agent is responsible for synchronizing changes.

When to call sync_documents:
ActionCall sync_documents?
Used Edit tool to modify .cs files✅ Yes
Used Write tool to create new .cs files✅ Yes
Deleted .cs files✅ Yes
Used SharpLensMcp refactoring tools (rename, extract, etc.)❌ No (auto-updated)
Modified .csproj files❌ No (use load_solution instead)
Usage:
# After editing specific files

sync_documents(filePaths: ["src/MyClass.cs", "src/MyService.cs"])

After bulk changes - sync all documents

sync_documents()

A full sync also picks up new .cs files the project's compile items include. SharpLensMcp's apply tools write only the files an edit changes, keep each file's encoding and line endings, and refuse with STALE_DOCUMENT when a target file changed on disk since it was read — run sync_documents, then retry. They also refuse with UNSUPPORTED_ENCODING to write a file whose bytes its encoding cannot reproduce (a BOM-less file that is not valid UTF-8 on a system whose fallback code page is UTF-8, such as Linux); save it as UTF-8 first.

Why this design?

This mirrors how LSP (Language Server Protocol) works - the client (editor) notifies the server of changes. This approach:

  • Eliminates race conditions (agent controls timing)
  • Avoids file watcher complexity and platform quirks
  • Is faster than full solution reload
  • Gives agents explicit control over workspace state

If you don't sync: Queries may return stale data (old method signatures, missing new files, etc.)

Features

  • 92 Semantic Analysis Tools - Navigation, refactoring, code generation, diagnostics, discovery, audit/quality
  • AI-Optimized Descriptions - Clear USAGE/OUTPUT/WORKFLOW patterns
  • Structured Responses - Consistent success/error/data format with suggestedNextTools
  • Zero-Based Coordinates - Clear warnings to prevent off-by-one errors
  • Preview Mode - Safe refactoring with preview before apply
  • Batch Operations - Multiple lookups in one call to reduce context usage

Tool Categories

Navigation & Discovery (24 tools)
ToolDescription
get_symbol_infoSemantic info at position
go_to_definitionJump to symbol definition
find_referencesAll references; each classified read/write/invocation/cast/typeof/nameof/attribute; optional kind filter
find_implementationsInterface/abstract implementations
find_callersImpact analysis - who calls this?
get_call_graphMulti-hop callers/callees graph with depth bound + cycle detection
find_path_betweenReachability + the connecting call path(s) between two methods; follows dispatch, with barriers and a checkpoint
get_type_hierarchyInheritance chain
search_symbolsGlob pattern search (*Handler, Get*)
semantic_queryMulti-filter search (async, public, etc.)
get_type_membersAll members by type name
get_type_members_batchMultiple types in one call
get_method_signatureDetailed signature by name
get_derived_typesFind all subclasses
get_base_typesFull inheritance chain
get_attributesList attributes on a symbol
get_containing_memberEnclosing symbol at position
get_method_overloadsAll overloads of a method
find_attribute_usagesFind types/members by attribute
get_external_type_infoInspect NuGet/BCL/external assembly types — members + XML docs
resolve_stack_traceMap a pasted stack trace to file/line/symbol, mangling undone
get_extension_methodsExtensions applying to a type — classic and C# 14 blocks
get_documentationFull XML docs for a symbol with expanded
get_super_methodNavigate to the base member / interface members a member implements
Analysis (17 tools)
ToolDescription
get_diagnosticsCompiler errors/warnings + configured analyzer findings (StyleCop, Roslynator, NetAnalyzers); matches CI
diff_api_surfacePublic-API breaking-change report vs a git ref
get_exception_flowWhich exceptions can escape a method, and where they're caught
find_similar_codeStructural similarity search (token-shingle fingerprints)
remove_unused_codeCompute dead-code removals + newly unused usings (generation-only)
find_dead_branchesUnreachable basic blocks per method (real CFG, not heuristics)
add_missing_importsCompute the usings that fix CS0246/CS0103 (generation-only)
analyze_data_flowVariable assignments and usage
analyze_control_flowBranching/reachability
analyze_change_impactWhat breaks if changed?
check_type_compatibilityCan A assign to B?
get_outgoing_callsWhat does this method call?
find_unused_codeDead code detection
validate_codeCompile check without writing
get_complexity_metricsCyclomatic, nesting, LOC, cognitive
find_circular_dependenciesProject and namespace cycle detection
get_missing_membersUnimplemented interface/abstract members
Refactoring (16 tools)
ToolDescription
rename_symbolSafe rename across solution
change_signatureAdd/remove/reorder parameters
extract_methodExtract with data flow analysis
extract_interfaceGenerate interface from class
generate_constructorFrom fields/properties
move_type_to_fileCompute the contents to move a type into its own file (generation-only)
split_typeCompute a partial-class split for selected members (generation-only)
organize_usingsSort and remove unused
organize_usings_batchBatch organize multiple files
format_document_batchBatch format files in project
get_code_actions_at_positionAll Roslyn refactorings at position
apply_code_action_by_titleApply any refactoring by title
implement_missing_membersGenerate interface stubs
encapsulate_fieldField to property
inline_variableInline temp variable
extract_variableExtract expression to variable
Code Generation (3 tools)
ToolDescription
add_null_checksGenerate ArgumentNullException guards
generate_equality_membersEquals/GetHashCode/operators
generate_test_stubCompilable test skeleton for a method (framework auto-detected)
Compound Tools (7 tools)
ToolDescription
get_type_overviewFull type info in one call

| analyze_method | Signature + callers + outgoing calls

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx