radare2-mcp

This is an MCP server for integrating radare2 with AI assistants. It utilizes a direct stdin/stdout communication model, enabling seamless binary analysis and file exploration. The direct integration with AI assistants allows users to work more efficiently.

GitHub Stars

78

User Rating

Not Rated

Favorites

0

Views

27

Forks

15

Issues

3

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
radare2: Latest version
Claude Desktop: Latest version

Installation

Installation

Prerequisites

Please specify required software and versions:
radare2: Latest version
Claude Desktop: Latest version

Installation Steps

1. Install using r2pm

bash
$ r2pm -Uci r2mcp
This command will copy the r2mcp executable into r2pm's bindir, but this binary is not supposed to be executed from the shell; it must be launched from the MCP service handler of your AI model.

Troubleshooting

Common Issues

Issue: Server won't start Solution: Check the versions of radare2 and Claude Desktop.

Configuration

Configuration

Claude Desktop Setup

Press CMD + , in the Claude Desktop app to open Developer settings and edit the configuration file as described below.

Location of Claude Configuration File

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json

Configuration File Content

Add the following to your configuration file:
json
{
  "mcpServers": {
    "radare2": {
      "command": "r2pm",
      "args": ["-r", "r2mcp"]
    }
  }
}

Examples

Examples

Basic Usage

Here are basic usage examples for the MCP server:

Using with Claude Desktop

1Verify MCP Server Startup
Open Claude Desktop and confirm that the configuration has been loaded correctly.
2Execute Basic Commands

   Available tools from this MCP server:
   - tool1: Description of tool1
   - tool2: Description of tool2
   

Programmatic Usage

javascript
// JavaScript example (Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');

const client = new MCPClient();
await client.connect();

// Execute tool
const result = await client.callTool('toolName', {
  parameter1: 'value1',
  parameter2: 'value2'
});

console.log(result);

Use Cases

Automate binary file analysis using an AI assistant.
Visualize complex binary data with radare2.
Send binary analysis results directly to an AI assistant from the CLI.
Explore specific files within the file system and retrieve information.