dnSpy MCP Server (C#)のロゴ

dnSpy MCP Server (C#)

コミュニティ
soufianetahiri

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

公開者soufianetahiri
リポジトリdnspy-mcp
言語C#
フォーク
7
スター
44
利用可能なツール
0
通信方式stdio
カテゴリ
リンク
  • ツールをAIワークフローに接続

    dnSpy MCP Server (C#)は、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 利用可能なツール(0個)

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースプロジェクトの注目度

    リンク先のリポジトリには44件のスターと7件のフォークがあります。

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.

インストール

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

dnSpy MCP Server (C#)のMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度dnSpy MCP Server (C#)に接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」→「詳細設定」→「Model Context Protocol」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「Model Context Protocol」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

dnSpy MCP Server (C#)をサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. dnSpy MCP Server (C#)のMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタのステータスが「準備完了」のままか確認するには、画面を更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "soufianetahiri-dnspy-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてdnSpy MCP Server (C#)のMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. dnSpy MCP Server (C#)のMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
dnSpy MCP Server (C#)を使ってこのタスクを手伝ってもらえますか?
dnSpy MCP Server (C#)
はい、読みました。
dnSpy MCP Server (C#)で調べた結果をお伝えします。

よくある質問

dnSpy MCP Server (C#) MCPサーバーは何に使いますか?

dnSpy MCP Server (C#)は、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでは、複数のAIモデルでdnSpy MCP Server (C#) MCPを利用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでdnSpy MCP Server (C#)を利用できます。

TypingMindでdnSpy MCP Server (C#) MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けのトップクラスのフロントエンドです。dnSpy MCP Server (C#)を接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

dnSpy MCP Server (C#) MCPをTypingMindに接続するにはどうすればよいですか?

dnSpy MCP Server (C#)はTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでdnSpy MCP Server (C#) MCPのどのようなツールを利用できますか?

dnSpy MCP Server (C#)はMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

dnSpy MCP Server (C#) MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。dnSpy MCP Server (C#)で認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇