Token导航 LogoToken导航TokenDH.com
Binary Analysis MCP logo
安全风控stdio官方级别未说明来源级核验

Binary Analysis MCP

MCP Server

BinaryAnalysis-MCP是一个用于分析PE、ELF、Mach-O和COFF二进制文件的工具,提供快速静态分析和安全加固检查功能。

工具数

9

提示词数

0

GitHub Stars

23

资源数

0
PythonClaude静态分析Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Ap3x

提供方

Ap3x

最后核验

2026/5/17 20:23

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m venv .venv

详细介绍

二元分析MCP

Tests

用于分析PE、ELF、Mach-O和COFF二进制文件的MCP服务器 科琳·利夫. 将绝对文件路径传递给任何工具,格式将自动检测。

工具

工具说明
get_binary_info快速分类——格式、架构、入口点、部分/导入/导出计数、NX和PIE标志
get_binary_headers完整标头转储(PE DOS/COF/可选,ELF标头,Mach-O标头)
get_binary_sections所有包含名称、大小、虚拟地址、熵、权限、映像库和入口点的部分
get_binary_imports按库分组的导入函数(PE按DLL,ELF按共享库,Mach-O按dylib)
get_binary_exports带有序号、地址和转发信息的导出函数/符号
get_binary_libraries动态库依赖关系(DLL/共享对象/dylibs)
get_binary_security安全强化——ASLR、DEP/NX、SEH、CFG、RELRO、堆栈金丝雀、代码签名
get_binary_signatures代码签名详细信息——PE验证码/x509证书、Mach-O LC_Code_SIGNATURE/CodeDirectory
get_coff_infoCOFF对象文件分析——头、节、符号和重定位

需求

  • Python 3.10+
  • 中列出的依赖关系 requirements.txt:

- mcp[cli] --模型上下文协议SDK - lief>=0.17.0 --二进制解析库

安装

git clone https://github.com/Ap3x/BinaryAnalysis-MCP.git
cd BinaryAnalysis-MCP
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate

pip install -r requirements.txt

运行服务器

python server.py

服务器通过以下方式进行通信 标准 使用MCP协议。

MCP客户端配置

克劳德桌面版

将以下内容添加到您的Claude Desktop配置文件中:

  • 窗户: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "binary-analysis": {
      "command": "python",
      "args": ["C:/path/to/BinaryAnalysis-MCP/server.py"],
      "env": {}
    }
  }
}

如果你使用的是虚拟环境,直接指向venv Python:

{
  "mcpServers": {
    "binary-analysis": {
      "command": "C:/path/to/BinaryAnalysis-MCP/.venv/Scripts/python.exe",
      "args": ["C:/path/to/BinaryAnalysis-MCP/server.py"],
      "env": {}
    }
  }
}

克劳德代码(CLI)

在您的项目中 .mcp.json:

{
  "mcpServers": {
    "binary-analysis": {
      "command": "python",
      "args": ["C:/path/to/BinaryAnalysis-MCP/server.py"],
      "env": {}
    }
  }
}

通用MCP客户端(stdio)

任何兼容MCP的客户端都可以将服务器作为子进程启动:

{
  "command": "python",
  "args": ["/absolute/path/to/server.py"],
  "transport": "stdio"
}

示例用法

连接后,让您的MCP客户端使用绝对文件路径调用工具:

Claude Desktop analysing notepad.exe

Analyse the security hardening of C:\Windows\System32\notepad.exe
List all imported DLLs for /usr/bin/ls
Show me the PE headers of C:\Windows\explorer.exe

输出示例

get_binary_infoC:\Windows\System32\notepad.exe

{
  "file": "C:/Windows/System32/notepad.exe",
  "format": "PE",
  "entrypoint": "0x1400019b0",
  "imagebase": "0x140000000",
  "is_pie": true,
  "has_nx": true,
  "sections": 8,
  "imported_functions": 339,
  "exported_functions": 0,
  "libraries": 56,
  "machine": "AMD64",
  "subsystem": "WINDOWS_GUI",
  "has_signatures": false,
  "has_tls": false,
  "has_resources": true,
  "has_rich_header": true,
  "has_relocations": true
}

get_binary_securityC:\Windows\System32\notepad.exe

{
  "aslr_dynamic_base": true,
  "aslr_high_entropy_va": true,
  "dep_nx_compat": true,
  "seh": true,
  "guard_cf": true,
  "force_integrity": false,
  "appcontainer": false,
  "is_pie": true,
  "has_nx": true,
  "signed": false,
  "format": "PE"
}

get_binary_sectionsC:\Windows\System32\notepad.exe

{
  "format": "PE",
  "image_base": "0x140000000",
  "entrypoint": "0x19b0",
  "count": 8,
  "sections": [
    {
      "name": ".text",
      "virtual_address": "0x1000",
      "size": 159744,
      "entropy": 6.2826,
      "virtual_size": 157410,
      "sizeof_raw_data": 159744,
      "characteristics": ["CNT_CODE", "MEM_EXECUTE", "MEM_READ"]
    },
    {
      "name": ".rdata",
      "virtual_address": "0x29000",
      "size": 45056,
      "entropy": 5.8039,
      "virtual_size": 42456,
      "sizeof_raw_data": 45056,
      "characteristics": ["CNT_INITIALIZED_DATA", "MEM_READ"]
    },
    {
      "name": ".data",
      "virtual_address": "0x34000",
      "size": 4096,
      "entropy": 1.624,
      "virtual_size": 10048,
      "sizeof_raw_data": 4096,
      "characteristics": ["CNT_INITIALIZED_DATA", "MEM_READ", "MEM_WRITE"]
    },
    {
      "name": ".rsrc",
      "virtual_address": "0x3a000",
      "size": 126976,
      "entropy": 7.0998,
      "virtual_size": 123344,
      "sizeof_raw_data": 126976,
      "characteristics": ["CNT_INITIALIZED_DATA", "MEM_READ"]
    }
  ]
}
*为简洁起见,截断为8节中的4节。*

项目结构

server.py              — entrypoint: imports tools, runs mcp
app.py                 — FastMCP instance
helpers.py             — parse_binary, hex_addr, safe_str, safe_enum, format_name, _error
tools/
  __init__.py          — imports all tool modules (triggers @mcp.tool registration)
  info.py              — get_binary_info
  headers.py           — get_binary_headers
  sections.py          — get_binary_sections
  imports.py           — get_binary_imports
  exports.py           — get_binary_exports
  libraries.py         — get_binary_libraries
  security.py          — get_binary_security + _pe_security, _elf_security, _macho_security
  certificates.py      — get_binary_signatures (PE Authenticode/x509, Mach-O LC_CODE_SIGNATURE)
  coff.py              — get_coff_info
tests/
  conftest.py          — shared fixtures and sample file paths
  test_helpers.py      — tests for helpers.py utilities
  test_info.py         — tests for get_binary_info
  test_headers.py      — tests for get_binary_headers
  test_sections.py     — tests for get_binary_sections
  test_imports.py      — tests for get_binary_imports
  test_exports.py      — tests for get_binary_exports
  test_libraries.py    — tests for get_binary_libraries
  test_security.py     — tests for get_binary_security
  test_coff.py         — tests for get_coff_info
binary-samples/        — test binaries (git submodule)
.github/workflows/
  tests.yml            — CI: runs pytest on push/PR to main

搭配得很好

此MCP与 GhidraMCP --暴露Ghidra逆向工程能力的MCP服务器。使用BinaryAnalysis MCP进行快速静态分类(标头、导入、安全标志),使用GhidraMCP进行更深入的反编译和控制流分析。

许可证

该项目根据 GNU通用公共许可证v3.0.

目录标签

目录标签

PythonClaude静态分析二进制分析本地部署安全加固文件格式解析逆向工程

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

9

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP