Radare2 MCP server

Provides direct access to radare2's binary analysis framework for reverse engineering, malware analysis, and debugging through a simple stdin/stdout communication model.
Back to servers
Setup instructions
Provider
dnakov
Release date
Mar 23, 2025
Language
Python
Stats
101 stars

Radare2 MCP Server is a tool that enables AI agents like Claude, VSCode Copilot, and other language models to interact with the radare2 reverse engineering framework. This server provides a bridge between AI systems and binary analysis capabilities through the Model Context Protocol (MCP).

Features

  • Fully written in C using native r2 APIs
  • Works from command line, as an r2 plugin, and as an MCP server
  • Provides binary analysis capabilities through radare2
  • Connects to local or remote r2/iaito sessions via r2pipe
  • Supports readonly mode, sandbox lock and tool restrictions
  • Offers fine-grained tool configuration
  • Uses direct stdin/stdout communication
  • Optional raw access for r2 commands or r2js scripts

Installation

Using r2pm (Recommended)

The simplest way to install r2mcp is using the r2pm package manager:

r2pm -Uci r2mcp

This will install the r2mcp executable to r2pm's bindir in your home directory. Note that this binary shouldn't be executed directly from the shell—it's designed to be launched by your language model's MCP service handler.

You can also run it using:

r2pm -r r2mcp

Using Docker

You can alternatively use Docker to run r2mcp:

docker build -t r2mcp .

Configuration

Claude Desktop Integration

To configure Claude Desktop for use with r2mcp:

  1. Open Claude Desktop settings with CMD + ,

  2. Edit the configuration file as follows:

    • macOS: Located at ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: Located at %APPDATA%\Claude\claude_desktop_config.json
  3. Add this configuration:

{
  "mcpServers": {
    "radare2": {
      "command": "r2pm",
      "args": ["-r", "r2mcp"]
    }
  }
}
  1. Restart Claude Desktop after making changes

VS Code Integration

To use r2mcp with GitHub Copilot Chat in Visual Studio Code:

  1. Open Command Palette with CMD + Shift + P (macOS) or Ctrl + Shift + P (Windows/Linux)
  2. Search for and select Copilot: Open User Configuration
  3. Add the following to your configuration file:
{
  "servers": {
    "radare2": {
      "type": "stdio",
      "command": "r2pm",
      "args": ["-r", "r2mcp"]
    }
  },
  "inputs": []
}

Zed Integration

To configure r2mcp with Zed:

  1. Open command palette: CMD + Shift + P (macOS) or Ctrl + Shift + P (Windows/Linux)
  2. Search for agent: open configuration or settings
  3. Add the server configuration:
  "context_servers": {
    "r2-mcp-server": {
      "source": "custom",
      "command": "r2pm",
      "args": ["-r", "r2mcp"],
      "env": {}
    }
  }

Note: You'll need another LLM agent (like Claude, Gemini, etc.) to use this integration.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "radare2" '{"command":"r2pm","args":["-r","r2mcp"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "radare2": {
            "command": "r2pm",
            "args": [
                "-r",
                "r2mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your 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

2. Add this to your configuration file:

{
    "mcpServers": {
        "radare2": {
            "command": "r2pm",
            "args": [
                "-r",
                "r2mcp"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later