Logo dnSpy MCP Server (C#)

dnSpy MCP Server (C#)

Cộng đồng
soufianetahiri

MCP server for .NET reverse engineering workflows (dnSpy/ILSpy ecosystem), built in C#.

Nhà phát hànhsoufianetahiri
Kho mãdnspy-mcp
Ngôn ngữC#
Bản fork
7
Sao
44
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    dnSpy MCP Server (C#) cung cấp các chức năng MCP cho các ứng dụng khách AI và tác nhân AI tương thích.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Mẫu cấu hình có thể sao chép ngay

    Dùng các đoạn cấu hình mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Mức độ quan tâm của cộng đồng đến kho mã

    44 sao và 7 bản fork từ kho mã được liên kết.

dnSpy MCP Server (C#)

MCP server for .NET reverse engineering workflows (dnSpy/ILSpy ecosystem), built in C#.

What’s implemented

  • Modular architecture (Core, Transport, Tools, Services)
  • Reflection-based tool registration via attributes
  • Auto-generated tool JSON schemas from C# method signatures
  • MCP stdio transport (Claude Code / Codex / OpenCode compatible)
  • MCP resources/list + resources/read
  • Structured tool outputs (structuredContent) + plain text content
  • Single-file publish profiles (win-x64 / linux-x64)

For full implementation details, see AGENT.md.

Project layout

  • dnspy-mcp.slnx
  • Directory.Build.props
  • publish.ps1
  • src/DnSpyMcpServer/Program.cs
  • src/DnSpyMcpServer/Core/*
  • src/DnSpyMcpServer/Transport/*
  • src/DnSpyMcpServer/Tools/*
  • src/DnSpyMcpServer/Services/*
  • src/DnSpyMcpServer/Properties/PublishProfiles/*

Tools

  • list_types
  • decompile_type
  • decompile_method (supports overload targeting)
  • get_method_il (supports overload targeting)
  • search_members
  • list_methods (helper for overload signatures)
  • find_string_references (find string-literal references in IL)
  • format_dnspy_jump (turn tokens/IL offsets into direct dnSpy navigation steps)
  • patch_replace_string_literal (patch one IL string literal)
  • patch_nop_instructions (NOP one/many IL instructions)

Navigation-friendly output: search/method/reference results include metadata tokens (TypeDef, MethodDef, etc.) so you can jump directly in dnSpy by token.

Patch safety: patch tools always create a backup before writing changes.

All tools return:

  • content (text)
  • structuredContent (JSON object for programmatic clients)

Resources

  • resources/list returns:

    • dnspy://assemblies
    • cached assembly resources, e.g. dnspy://assembly?path=...&view=summary
    • cached assembly resources, e.g. dnspy://assembly?path=...&view=types
  • resources/read supports:

    • dnspy://assemblies
    • dnspy://assembly?path=<absolute-or-relative>&view=summary
    • dnspy://assembly?path=<absolute-or-relative>&view=types

Note: assembly resources are cache-driven. Cache is populated when tools are called with assemblyPath.

Build

bash
dotnet build src/DnSpyMcpServer/DnSpyMcpServer.csproj -c Release

Run

bash
dotnet run --project src/DnSpyMcpServer/DnSpyMcpServer.csproj -c Release

Publish (single-file)

PowerShell helper:

powershell
./publish.ps1 -Runtime win-x64
./publish.ps1 -Runtime linux-x64

Or directly:

bash
dotnet publish src/DnSpyMcpServer/DnSpyMcpServer.csproj -c Release -p:PublishProfile=win-x64
dotnet publish src/DnSpyMcpServer/DnSpyMcpServer.csproj -c Release -p:PublishProfile=linux-x64

Quick start (copy/paste)

  1. Build:
bash
dotnet build src/DnSpyMcpServer/DnSpyMcpServer.csproj -c Release
  1. Use this server command in your MCP client:
json
{
  "mcpServers": {
    "dnspy": {
      "command": "dotnet",
      "args": [
        "C:/Tools/Cooking/Reverse/dnSpy/dnspy-mcp/src/DnSpyMcpServer/bin/Release/net8.0/win-x64/DnSpyMcpServer.dll"
      ]
    }
  }
}
  1. Restart your MCP client.

Prebuilt config files

Ready-to-copy templates are in:

  • configs/claude-code.mcp.json
  • configs/codex.mcp.json
  • configs/opencode.mcp.json

If your local path differs, edit the executable path in the selected file (args[0] for stdio clients, command[0] for OpenCode local MCP).

Client-specific config snippets

Claude Code

Add/update your MCP config with:

json
{
  "mcpServers": {
    "dnspy": {
      "command": "dotnet",
      "args": [
        "C:/Tools/Cooking/Reverse/dnSpy/dnspy-mcp/src/DnSpyMcpServer/bin/Release/net8.0/win-x64/DnSpyMcpServer.dll"
      ]
    }
  }
}

Codex

Use the same MCP server entry:

json
{
  "mcpServers": {
    "dnspy": {
      "command": "dotnet",
      "args": [
        "C:/Tools/Cooking/Reverse/dnSpy/dnspy-mcp/src/DnSpyMcpServer/bin/Release/net8.0/win-x64/DnSpyMcpServer.dll"
      ]
    }
  }
}

OpenCode (Windows)

OpenCode uses this config file:

%USERPROFILE%\.config\opencode\opencode.json

Add this block under mcp:

json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "dnspy": {
      "type": "local",
      "enabled": true,
      "command": [
        "dotnet",
        "C:/Tools/Cooking/Reverse/dnSpy/dnspy-mcp/src/DnSpyMcpServer/bin/Release/net8.0/win-x64/DnSpyMcpServer.dll"
      ]
    }
  }
}

(Template file: configs/opencode.mcp.json)

Optional: run from project instead of DLL

json
{
  "mcpServers": {
    "dnspy": {
      "command": "dotnet",
      "args": [
        "run",
        "--project",
        "C:/Tools/Cooking/Reverse/dnSpy/dnspy-mcp/src/DnSpyMcpServer/DnSpyMcpServer.csproj",
        "-c",
        "Release"
      ]
    }
  }
}

First actions to test in your client

After restart, ask your client to call:

  1. list_types
json
{ "assemblyPath": "C:/path/to/target.dll" }
  1. list_methods
json
{ "assemblyPath": "C:/path/to/target.dll", "typeFullName": "MyApp.Services.AuthService" }
  1. decompile_method
json
{
  "assemblyPath": "C:/path/to/target.dll",
  "typeFullName": "MyApp.Services.AuthService",
  "methodName": "Login",
  "parameterTypeNames": ["System.String", "System.String"]
}
  1. resources/list then resources/read with dnspy://assemblies

  2. find_string_references

json
{
  "assemblyPath": "C:/Program Files (x86)/Cato Networks/Cato Client/CatoClient.exe",
  "text": "Screenshot 2026-03-11 082704.png",
  "caseSensitive": false,
  "maxResults": 200
}

Tip: also search fragments like Pictures\\Screenshots or just Screenshot.

  1. format_dnspy_jump
json
{
  "assemblyPath": "C:/Program Files (x86)/Cato Networks/Cato Client/CatoClient.exe",
  "typeDefToken": "0x02000058",
  "methodDefToken": "0x060005C1",
  "ilOffset": "IL_01D2"
}
  1. patch_replace_string_literal (always creates backup)
json
{
  "assemblyPath": "C:/Program Files (x86)/Cato Networks/Cato Client/CatoClient.exe",
  "methodDefToken": "0x060005C1",
  "ilOffset": "IL_01D2",
  "newText": "[patched text]",
  "inPlace": false
}
  1. patch_nop_instructions (always creates backup)
json
{
  "assemblyPath": "C:/Program Files (x86)/Cato Networks/Cato Client/CatoClient.exe",
  "methodDefToken": "0x060005C1",
  "ilOffset": "IL_01DD",
  "count": 1,
  "inPlace": false
}

Overload targeting example

json
{
  "assemblyPath": "C:/path/target.dll",
  "typeFullName": "MyApp.Services.AuthService",
  "methodName": "Login",
  "parameterTypeNames": ["System.String", "System.String"]
}

If parameterTypeNames is omitted and overloads exist, the server returns an ambiguity error with available signatures.

Cài đặt

TypingMind
{
  "mcpServers": {
    "soufianetahiri-dnspy-mcp": {
      "command": "dotnet",
      "args": [
        "path/to/your/DnSpyMcpServer.dll"
      ]
    }
  }
}

Dùng MCP dnSpy MCP Server (C#) với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối dnSpy MCP Server (C#), bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Thiết lập trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Thiết lập trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh thiết lập trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Để tiến trình tiếp tục chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Để tiến trình tiếp tục chạy trong cửa sổ Terminal khi bạn dùng các công cụ MCP.
3

Thêm dnSpy MCP Server (C#) làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của dnSpy MCP Server (C#).
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "soufianetahiri-dnspy-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của dnSpy MCP Server (C#), sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của dnSpy MCP Server (C#).
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện trên TypingMind dùng các công cụ MCP đã bật với mô hình AI đã chọn
Bạn có thể dùng dnSpy MCP Server (C#) giúp tôi làm việc này không?
dnSpy MCP Server (C#)
Được. Tôi đọc rồi.
Đây là kết quả tôi tìm được bằng dnSpy MCP Server (C#).

Câu hỏi thường gặp

Máy chủ MCP dnSpy MCP Server (C#) dùng để làm gì?

dnSpy MCP Server (C#) là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP dnSpy MCP Server (C#) với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng dnSpy MCP Server (C#) với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP dnSpy MCP Server (C#) với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối dnSpy MCP Server (C#), bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP dnSpy MCP Server (C#) với TypingMind?

dnSpy MCP Server (C#) hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP dnSpy MCP Server (C#) cung cấp những công cụ nào trong TypingMind?

dnSpy MCP Server (C#) cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP dnSpy MCP Server (C#) không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu dnSpy MCP Server (C#) yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇