1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Ghidra MCP, Binary Ninja MCP, IDA MCPを使ってみた

Last updated at Posted at 2025-04-11

概要

  • 静的解析ツールのMCP使ってみたよ~
  • CursorでMCPを使ったよ~
  • 簡単なセットアップ・使い方まとめ
  • Ghidraは変数のrenameができるがBinary Ninjaはできない

Ghidra MCP編

構築

READMEに動画があるしほぼ詰まらず構築できるけど一応

Ghidra側

  1. githubのreleaseからzipをダウンロード
  2. Ghidraを起動しFile->Install Extensions->+ボタンを押して展開したzipファイル内にあるzipファイルを読み込ませる
  3. Ghidraを再起動
  4. CodeBrowserへ移動しFile->ConfigureでConfigure Toolウィンドウが表示されたら右上のプラグアイコン(Configure All Plugins)を選択
  5. GhidraMCPPluginにチェックを入れる(ここ動画に載ってなかったので注意)

Cursor側

Claude Desktopとかでもほぼ変わらんと思う

  1. 必要に応じてvenvを作成
  2. pip install mcp==1.5 requests==2.32.3 (https://github.com/LaurieWired/GhidraMCP/blob/main/requirements.txt 参照)
  3. mcp.jsonを設定する
  • bridge_mcp_ghidra.pyは展開したzip内にあるので指定
  • commandのpythonはvenvの場合など必要に応じて変更
{
  "mcpServers": {
    "ghidra": {
      "command": "python",
      "args": [
        "/ABSOLUTE_PATH_TO/bridge_mcp_ghidra.py",
        "http://127.0.0.1:8080/"
      ]
    }
  }
}

使ってみた

Binary Ninja MCP編

構築

  1. リポジトリをクローンgit clone https://github.com/Invoke-RE/binja-lattice-mcp.git
  2. venvを作成後pip install -r requirements.txt

Binary Ninja側

  1. lattice_server_plugin.pyをプラグインディレクトリに移動
    • windowsの場合AppData\Roaming\Binary Ninja\plugins (READMEがミスってる)
  2. Binary Ninjaを起動
    ctrl + ,で設定を開きpython関連のパスをvenvのものに変更する
    ctrl + pでRestart Binary Ninjaと入力し実行
  3. 適当な実行ファイルをBinary Ninjaで開く
  4. Plugins->Start Lattice Protocol Serverを選択
  5. Logにtokenが表示されるのでコピー

Cursor側

mcp.jsonを編集

{
    "mcpServers": {
      "binja-lattice-mcp": {
        "command": "/path/to/venv/bin/python",
        "args": ["/path/to/mcp_server.py"],
        "env": {
            "BNJLAT": "your_api_key_here"
        }
      }
    }
}

"your_api_key_here"に先ほどコピーしたtokenを張り付ける
あとはcommandとmcp_server.pyのpathを修正する

使ってみた

検証に使用させていただいたバイナリ

IDA

環境構築

  1. python 3.11以降のバージョンを用意 & gitを使えるように
  2. pip install --upgrade git+https://github.com/mrexodia/ida-pro-mcp
  3. ida-pro-mcp --install
  4. 必要に応じてida側のpythonを変更
    1. IDAがインストールされているディレクトリへ移動
    2. idapyswitchを実行し3.11以降のバージョンを選択

比較

  • Ghidraはxrefの参照ができないらしい https://x.com/PINKSAWTOOTH/status/1912032582579175929 (そのうちフォークが出るかも...?)
  • Ghidraはコメント追加できない
  • Binary Ninjaは変数や関数のリネームができない
  • IDAは大体全部できる
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?