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
86 stars

The Radare2 MCP Server provides an integration between radare2 and AI assistants like Claude, VSCode, CLION, and others. It allows you to leverage radare2's binary analysis capabilities directly within AI assistant interfaces through the Model Context Protocol (MCP).

Installation Options

Using r2pm (Recommended)

The easiest installation method is through the radare2 package manager:

$ r2pm -Uci r2mcp

This command installs 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 AI assistant's MCP service handler.

To run the MCP server through r2pm:

$ r2pm -r mcp

Using Docker

You can also use Docker to run the MCP server:

docker build -t r2mcp .

Configuration for AI Assistants

Claude Desktop

To integrate with Claude Desktop:

  1. Open the Developer settings by pressing CMD + ,

  2. Locate your configuration file based on your operating system:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  3. Add the following to your configuration file:

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

VS Code Integration

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

  1. Open the 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 use r2mcp with Zed:

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

Note: You will need another LLM agent, such as Claude, Gemini or another, to use this integration.

Using Docker Configuration

If you're using the Docker installation method, update your MCP client configuration to use:

{
  "command": "docker",
  "args": ["run", "--rm", "-i", "-v", "/tmp/data:/data", "r2mcp"]
}

Usage Tips

  • To avoid confusion, it's best to enable only one MCP server at a time in your AI assistant configurations
  • The server provides capabilities for binary analysis, file exploration, and inspection through radare2's toolset
  • You can interact with radare2 functionality directly through your AI assistant's interface

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