Logo vun BinAssistMCP

BinAssistMCP

Communautéit
symgraph

Binary Ninja plugin to provide MCP functionality.

Editeursymgraph
RepositoryBinAssistMCP
SproochPython
Forks
11
Stären
50
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    BinAssistMCP stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    50 Stären an 11 Forks aus dem verlinkte Repository.

BinAssistMCP

Comprehensive Model Context Protocol (MCP) server for Binary Ninja with AI-powered reverse engineering capabilities

Summary

BinAssistMCP is a powerful bridge between Binary Ninja and Large Language Models (LLMs) like Claude, providing comprehensive reverse engineering tools through the Model Context Protocol (MCP). It enables AI-assisted binary analysis by exposing Binary Ninja's advanced capabilities through Server-Sent Events (SSE) and Streamable HTTP transports.

Key Features

  • MCP 2025-11-25 Compliant: Full support for tool annotations, resources, and prompts
  • Dual Transport Support: SSE (Server-Sent Events) and Streamable HTTP transports
  • 45 Consolidated Tools: Streamlined Binary Ninja API wrapper with unified tool design
  • 8 MCP Resources: Browsable, cacheable binary metadata
  • 7 Guided Prompts: Pre-built workflows for common reverse engineering tasks
  • Multi-Binary Sessions: Concurrent analysis of multiple binaries with intelligent context management
  • Context-Rich Code Output: Function signatures and Binary Ninja comments are embedded in code results
  • Analysis-Safe Queries: Code retrieval uses already-loaded IL and never forces global reanalysis
  • Session-Independent Discovery: Direct tool calls discover open Binary Ninja views without requiring a prior listing call
  • Nonblocking Binary Opens: Large binaries and .bndb databases open asynchronously with pollable operation status
  • Thread-Safe: RLock-based synchronization for concurrent access
  • Auto-Integration: Seamless Binary Ninja plugin with automatic startup capabilities

Use Cases

  • AI-Assisted Reverse Engineering: Leverage LLMs for intelligent code analysis and documentation
  • Protocol Analysis: Trace network data flows and reconstruct protocol structures
  • Vulnerability Research: Systematic security audits with guided workflows
  • Automated Binary Analysis: Script complex analysis workflows with natural language
  • Code Understanding: Generate comprehensive documentation and explanations

Architecture

src/binassist_mcp/
├── server.py        # FastMCP server - SSE/Streamable HTTP transport, tool registration
├── tools.py         # Binary Ninja API wrapper - 45 MCP tools
├── plugin.py        # Binary Ninja plugin integration
├── context.py       # Thread-safe multi-binary session management
├── config.py        # Pydantic configuration with Binary Ninja settings
├── prompts.py       # 7 guided workflow prompts
├── resources.py     # 8 MCP resource definitions
├── cache.py         # Cache primitives (not currently connected to MCP tools)
├── tasks.py         # Task lifecycle support (tool dispatch is not yet implemented)
├── logging.py       # Binary Ninja logging integration
└── utils.py         # Utility functions

__init__.py          # Plugin entry point (root level)

Tools (45 Total)

BinAssistMCP provides 45 tools organized into functional categories. Tools include MCP annotations (readOnlyHint, idempotentHint) to help clients make informed decisions.

Binary Management

ToolDescription
list_binariesSynchronize with Binary Ninja and list all loaded binary files
get_binary_infoCheck analysis status and metadata
get_binary_statusPoll a queued open by operation ID, path, or name and report analysis progress
open_binaryQueue a nonblocking binary or .bndb open; raw binaries require a destination bndb_path
update_analysis_and_waitForce analysis update and wait for completion
export_programExport the patched binary or Binary Ninja database to disk

By default, open_binary validates its paths, schedules the Binary Ninja open, and immediately returns an operation_id with status="opening". Poll get_binary_status(operation_id) until it reports ready or failed. When ready, its name field is the final context name to pass to analysis tools. Concurrent requests for the same path reuse the active operation. Set wait_for_analysis=true only when legacy blocking behavior is explicitly required.

Code Analysis (Consolidated)

ToolDescription
get_codeRead analysis-safe code with signatures and comments; supports decompile, hlil, mlil, llil, disasm, and pseudo_c
get_function_low_level_ilGet Low-Level IL for a function
get_function_signatureGenerate the native masked byte signature for a function
analyze_functionComprehensive function analysis with control flow and complexity metrics
get_basic_blocksGet basic block information for control flow analysis
get_function_stack_layoutGet stack frame layout with variable offsets

get_code behavior

get_code is a read-only query. It does not clear analysis_skipped, request IL generation, or run global analysis. For format="decompile", it returns already-loaded HLIL when available, then falls back through MLIL and LLIL to instruction-aligned disassembly. Use update_analysis_and_wait explicitly when fresh analysis is desired.

The code string starts with the current function signature and includes function-level and instruction-level Binary Ninja comments. The response contains:

  • function and address: resolved function identity
  • format: requested format
  • actual_format: representation actually returned, or null when an explicitly requested IL is unavailable
  • fallback_used: whether decompile used a lower-level representation
  • code: rendered code, signature, and comments
  • note: present when a fallback explains why and what was returned

Cross-References (Consolidated)

ToolDescription
xrefsUnified cross-references with direction set to to, from, or both; optionally includes call relationships

Comments (Consolidated)

ToolDescription
commentsUnified comment management - actions: get, set, list, remove, set_function

Variables (Consolidated)

ToolDescription
variablesUnified variable management - actions: list, create, rename, set_type; rename supports local/global via scope

Types (Consolidated)

ToolDescription
typesUnified type management - actions: create, create_enum, create_typedef, create_class, add_member, info, list
get_classesList all classes and structures

Function Discovery

ToolDescription
get_functionsList all functions with metadata
search_functions_by_nameFind functions by name pattern
get_functions_advancedAdvanced filtering by size, complexity, parameters
search_functions_advancedMulti-target search (name, comments, calls, variables)
get_function_statisticsComprehensive statistics for all functions

Symbol Management

ToolDescription
rename_symbolRename functions and data variables
batch_renameRename multiple symbols in one operation
get_namespacesList namespaces and symbol organization

Binary Information

ToolDescription
get_importsImport table grouped by module
get_exportsExport table with symbol information
get_stringsPaginated string extraction
search_stringsSearch strings by pattern
get_segmentsMemory segment layout
get_sectionsBinary section information
get_entry_pointsList all binary entry points

Data Analysis

ToolDescription
create_data_varDefine data variables at addresses
get_data_varsList all defined data variables
get_data_atRead and analyze raw data
search_bytesSearch for byte patterns in binary

Patching

ToolDescription
patch_bytesPatch raw bytes in the binary at an address
assemble_codeAssemble instruction text at an address and optionally patch it

Navigation & Bookmarks

ToolDescription
get_current_addressGet current cursor position with context
get_current_functionIdentify function at current address
bookmarksUnified bookmark management - actions: list, set, remove

Task Management (Experimental)

ToolDescription
start_taskCreate a placeholder background task record; tool_name dispatch is not implemented yet
get_task_statusCheck status of async operations
list_tasksList all pending/running tasks
cancel_taskCancel a running task

These APIs currently exercise task lifecycle management only. They do not execute the named MCP tool in the background.


MCP Resources (8 Total)

Resources provide browsable, cacheable data that clients can access without tool calls.

URI PatternDescription
binassist://{filename}/triage_summaryComplete binary overview
binassist://{filename}/functionsAll functions with metadata
binassist://{filename}/importsImport table
binassist://{filename}/exportsExport table
binassist://{filename}/stringsString table
binja://{filename}/infoBinary metadata (arch, platform, entry point)
binja://{filename}/segmentsMemory segments with permissions
binja://{filename}/sectionsBinary sections

MCP Prompts (7 Total)

Pre-built prompts guide LLMs through structured analysis workflows.

PromptArgumentsDescription
analyze_functionfunction_name, filenameComprehensive function analysis workflow
identify_vulnerabilityfunction_name, filenameSecurity audit checklist (memory safety, input validation, crypto)
document_functionfunction_name, filenameGenerate Doxygen-style documentation
trace_data_flowaddress, filenameTrack data dependencies and taint propagation
compare_functionsfunc1, func2, filenameDiff two functions for similarity analysis
reverse_engineer_structaddress, filenameRecover structure definitions from usage patterns
trace_network_datafilenameTrace POSIX/Winsock send/recv for protocol analysis

Example: Network Protocol Analysis

The trace_network_data prompt guides analysis of network communication:

  1. Identify Network Functions: Finds POSIX (send/recv/sendto/recvfrom) and Winsock (WSASend/WSARecv) calls
  2. Trace Call Stacks: Maps application handlers down to network I/O
  3. Analyze Buffers: Identifies protocol structures (headers, length fields, TLV encoding)
  4. Reconstruct Protocols: Generates C struct definitions for message formats
  5. Security Assessment: Checks for buffer overflows, integer issues, information disclosure

Installation

Prerequisites

  • Binary Ninja: Version 5000 or higher
  • Python: 3.10+ (typically bundled with Binary Ninja and required by the pinned MCP SDK)
  • Platform: Windows, macOS, or Linux

NOTE: Windows users should start with: BinAssistMCP on Windows

Option 1: Binary Ninja Plugin Manager (Recommended)

  1. Open Binary Ninja
  2. Navigate to Tools → Manage Plugins
  3. Search for "BinAssistMCP"
  4. Click Install
  5. Restart Binary Ninja

Option 2: Manual Installation

bash
# Clone the repository
git clone https://github.com/symgraph/BinAssistMCP.git
cd BinAssistMCP

# Install dependencies
pip install -r requirements.txt

Copy to your Binary Ninja plugins directory:

PlatformPath
Windows%APPDATA%\Binary Ninja\plugins\
macOS~/Library/Application Support/Binary Ninja/plugins/
Linux~/.binaryninja/plugins/

Configuration

Binary Ninja Settings

Open Edit → Preferences → binassistmcp:

SettingDefaultDescription
server.hostlocalhostServer bind address
server.port8000Server port
server.transportstreamablehttpTransport: streamablehttp or sse
binary.max_binaries10Maximum concurrent binaries
plugin.auto_startuptrueAuto-start server on file load

Environment Variables

bash
export BINASSISTMCP_SERVER__HOST=localhost
export BINASSISTMCP_SERVER__PORT=8000
export BINASSISTMCP_SERVER__TRANSPORT=streamablehttp
export BINASSISTMCP_BINARY__MAX_BINARIES=10

Usage

Starting the Server

Via Binary Ninja Menu:

  1. Tools → BinAssistMCP → Start Server
  2. Check log panel for: BinAssistMCP server started on http://localhost:8000

Auto-Startup: Server starts automatically when Binary Ninja loads a file (configurable).

Connecting MCP Clients

Streamable HTTP (Default):

http://localhost:8000/mcp

Server-Sent Events:

http://localhost:8000/sse

Claude Desktop Configuration

Add to your Claude Desktop MCP configuration (claude_desktop_config.json):

json
{
  "mcpServers": {
    "binassist": {
      "url": "http://localhost:8000/mcp"
    }
  }
}

Integration Examples

Most binary-specific tools require the context name in filename. list_binaries returns these names, but it is not an initialization requirement: direct filename-based calls refresh the context from Binary Ninja automatically when necessary.

Basic Function Analysis

User: "Analyze the main function and explain what it does"

Claude uses:
1. list_binaries() - obtain the context filename
2. get_functions(filename='sample.bndb') - find main
3. get_code(filename='sample.bndb', function_name_or_address='main', format='decompile')
4. xrefs(filename='sample.bndb', address_or_name='main', direction='from')
5. analyze_function(filename='sample.bndb', function_name_or_address='main')

Vulnerability Research

User: "Find buffer overflow vulnerabilities in input handling functions"

Claude uses:
1. search_functions_advanced(filename='sample.bndb', search_term='strcpy', search_in='calls')
2. get_code(filename='sample.bndb', function_name_or_address='handler', format='decompile')
3. variables(filename='sample.bndb', action='list', function_name_or_address='handler')
4. comments(filename='sample.bndb', action='set', address='0x401000', text='Unchecked copy')

Protocol Reverse Engineering

User: "Analyze the network protocol used by this binary"

Claude uses the trace_network_data prompt:
1. Identifies send/recv call sites
2. Traces data flow from handlers to network I/O
3. Reconstructs message structures
4. Checks for network vulnerabilities

Troubleshooting

Server Issues

ProblemSolution
Server won't startCheck port 8000 availability, verify dependencies
Connection refusedEnsure server is running, check firewall settings
A requested IL is unavailableRun update_analysis_and_wait, then retry get_code
Binary name is rejectedCall list_binaries and use the returned context name

Performance

  • Memory usage: Reduce max_binaries setting
  • Code retrieval: get_code returns loaded analysis immediately and falls back rather than triggering analysis

Logs

Check Binary Ninja's Log panel for detailed error messages.


Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Follow existing code patterns (Pydantic models, type hints, docstrings)
  4. Test with multiple binary types
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "jtang613-binassistmcp": {
      "command": "",
      "args": []
    }
  }
}

BinAssistMCP MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal BinAssistMCP verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

BinAssistMCP als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu BinAssistMCP an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "jtang613-binassistmcp": {
      "command": "npx",
      "args": [
        "-y",
        "BinAssistMCP"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu BinAssistMCP. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu BinAssistMCP.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat BinAssistMCP?
BinAssistMCP
Jo. Ech hunn et gelies.
Dat hunn ech mat BinAssistMCP fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server BinAssistMCP benotzt?

BinAssistMCP ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech BinAssistMCP MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir BinAssistMCP mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat BinAssistMCP MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann BinAssistMCP verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech BinAssistMCP MCP mat TypingMind?

BinAssistMCP leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt BinAssistMCP MCP an TypingMind zur Verfügung?

BinAssistMCP stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir BinAssistMCP MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann BinAssistMCP eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇