Radare2

Developer tools

MCP stdio server for radare2.

Your AI app calls the Radare2 MCP server, which does the developer tools work and sends the result back to the chat.

About Radare2

Radare2 is a community MCP server from radareorg, filed in our directory under developer tools. MCP stdio server for radare2.

At a glance

Publisher
radareorg (community)
Runs
See the README for setup
Written in
C
License
MIT
GitHub stars
383

How to set up Radare2

  1. Follow the install steps in the Radare2 README; it is written in C, so have that toolchain ready.
  2. Check the Radare2 README for keys or settings; the registry lists none that Radare2 requires.
  3. Add Radare2 to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Radare2 tools to confirm the connection.
  5. Run one read-only task with Radare2 first, and keep your app asking before each tool call until the results look right.

Radare2 compared with similar servers

  • Modelstudioai CLI by modelstudioai has fewer GitHub stars than Radare2 (378 against 383); both are community servers, and both run locally.
  • TrueMemory by buildingjoshbetter has more GitHub stars than Radare2 (384 against 383); both are community servers, and both run locally.
  • Mapbox by mapbox has fewer GitHub stars than Radare2 (377 against 383); both are community servers, and Mapbox runs as a remote server and Radare2 runs on your own machine.

Before you connect Radare2

  • Give Radare2 its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Radare2 tool call until you trust what it does with them.
  • Treat text that Radare2 fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Radare2 on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Radare2

How marketing and sales teams put Radare2 to work, by company size. Pick the size closest to yours and start Radare2 on one use case.

Small business

  • A small business with a developer can use Radare2 to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask Radare2 to explain and fix a marketing site issue without context switching between tools.
  • Radare2 runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Growth engineers can use Radare2 to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect Radare2 to keep scripts and automations documented and versioned as they change.
  • Start Radare2 on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprise engineering teams can roll out Radare2 with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on Radare2 so web and marketing engineering share one reviewed way of working with AI.
  • Radare2 is a community server, so have security review the code and pin a version before Radare2 touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Radare2 README

From radareorg/radare2-mcp on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

Radare2 MCP Server

An MCP server to use radare2 with AI agents such as OpenCode, Mai, VSCode, Claude, CLION, ...

Features

This implementation provides:

  • 💻 Fully written in C using the native r2 APIs
  • 🧩 Works from the CLI, as an r2 plugin and as an MCP server
  • 🔍 Seamless binary analysis with radare2
  • 🔗 Connect to any local or remote r2/iaito session via r2pipe
  • 🔒 Supports readonly mode, sandbox lock and restrict tools
  • 🔩 Fine grained tools configuration
  • 🔁 Direct stdin/stdout communication model
  • 🌐 HTTP MCP server mode with optional X-Session-ID multiplexing
  • 🛠️ Optional raw access to run r2 commands or r2js scripts

Installation

Requires radare2 6.2.6 or newer.

Using r2pm

The simplest way to install the package is by using r2pm:

$ r2pm -Uci r2mcp

The r2mcp executable will be copied into r2pm's bindir in your home directory. However, this binary is not supposed to be executed directly from the shell; it will only work when launched by the MCP service handler of your language model of choice.

$ r2pm -r r2mcp

That's the common mcpServer JSON configuration file:

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

To install the codex plugin just run the following command:

make codex-plugin-install

This will create a personal marketplace in your home and copy the files from dist/codex-plugin inside.

Using Docker

Alternatively, you can build the Docker image:

docker build -t r2mcp .

Update your MCP client configuration file (see below) to use the Docker image to use:

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

Configuration

File paths and sandbox permissions

open_file accepts existing regular files using absolute local paths. A file:// prefix is treated as a local path and receives the same checks. list_files and run_script also require absolute local paths. Network shares and device paths are rejected; Windows paths must use a local drive.

Explicit open_file targets may include hidden files, hidden directories, and . path components. They use the same validated local-file exception as other binary targets, including with -g none. With -s, the resolved path must still remain inside the allowed directory.

Commands and scripts retain radare2's native sandbox checks. The hidden grain permits hidden path components where filesystem permissions and r2's path policy allow access; it does not grant general filesystem access.

Other URI schemes run with the configured radare2 sandbox active, including on the first open. Use -g to grant the permissions their plugins need: socket permits localhost connections, network permits remote connections, and exec permits process operations. Frida requires both exec and network because it uses its own process and network APIs. -g all disables the radare2 sandbox. With -s, URI schemes other than local file:// paths are rejected so they cannot bypass the configured directory restriction.

HTTP Server Mode

Use -H [address:]port to run r2mcp as an HTTP MCP server instead of using stdin/stdout. A bare port binds only to 127.0.0.1; use 0.0.0.0:port explicitly to make the server reachable from the network:

r2mcp -H 8765
# Public binding; protect this with -a <token> or -A.
r2mcp -H 0.0.0.0:8765 -A

Per-session HTTP state is enabled with -X max[:idle_seconds] and routed by the X-Session-ID request header:

r2mcp -H 8765 -X 8:600

HTTP bearer authentication is enabled with -a <token>. Clients must send Authorization: Bearer <token> on every GET and POST request:

r2mcp -H 8765 -a my-secret-token

Use -A or -a random to generate a random token at startup. The generated token is printed once on stderr:

r2mcp -H 8765 -A

The same token setting can be supplied with R2MCP_AUTH_TOKEN; set it to random to generate one.

-X requires radare2 ABI 91 or newer because older radare2 headers do not expose the HTTP request header API. With older ABIs, -H still works as a single shared HTTP server, but -X is ignored. Bearer authentication also requires this header API.

r2 Core Plugin Mode

The r2 core plugin exposes the r2mcp command inside an existing radare2 session. Starting HTTP mode from r2 reuses the current RCore, so MCP tools operate on the file and analysis state already loaded in that session:

r2 -e r2mcp.port=8765 -c 'r2mcp start' /bin/ls

Useful subcommands:

  • r2mcp start or r2mcp http starts the HTTP MCP server in the background.
  • r2mcp stop, r2mcp restart, and r2mcp status manage the background server.
  • r2mcp logs on|off and r2mcp logs file <path> control plugin debug logs.
  • r2mcp approve on|off and r2mcp approve url <url> control supervisor approvals.
  • r2mcp yolo on|off disables approvals and exposes dangerous run tools.
  • r2mcp config lists the r2mcp.* eval keys.

The plugin registers eval keys for the same server options exposed by the CLI: r2mcp.port, r2mcp.log, r2mcp.logfile, r2mcp.auth, r2mcp.approve, r2mcp.svc, r2mcp.yolo, r2mcp.mini, r2mcp.permissive, r2mcp.run, r2mcp.readonly, r2mcp.ignore_analysis, r2mcp.prompts, r2mcp.prompts.dir, r2mcp.sandbox, r2mcp.sandbox.grain, r2mcp.content, r2mcp.enabled, r2mcp.disabled, r2mcp.session_tools, r2mcp.sessions, r2mcp.sessions.max, r2mcp.sessions.timeout, r2mcp.decompiler, and r2mcp.baseurl.

When loading the plugin manually with -i, set these keys after the plugin is loaded, for example with -c 'e r2mcp.port=8765', because radare2 processes early -e options before ad hoc plugin initialization.

SQL through r2xsql

Install the r2xsql core plugin for the same radare2 build that r2mcp uses. The sql tool is available without -r in local mode. Call open_file, analyze, and sql with arguments such as:

{"query":"SELECT name, size FROM funcs WHERE size > 100 ORDER BY size DESC LIMIT 10"}

The sql tool passes one statement directly to the loaded SQL core plugin, preserving SQL operators and quoted text. Results are the plugin's text output. It supports SQL writes, so it is excluded from read-only mode (-R). Use it with a local r2mcp server or r2mcp's core plugin; remote r2 HTTP client mode (-u) does not expose this tool.

An installed plugin loads automatically. To load a build explicitly, add -c 'L /absolute/path/core_r2xsql.so' to the r2mcp command. Startup commands run in order before MCP requests or -T tests, and their output is discarded to keep stdout valid for MCP. On macOS/Windows use the actual plugin filename.

Claude Desktop Integration

In the Claude Desktop app, press CMD + , to open the Developer settings. Edit the configuration file and restart the client after editing the JSON file as explained below:

  1. Locate your Claude Desktop configuration file:

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

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

VS Code Integration

To use r2mcp with GitHub Copilot Chat in Visual Studio Code by adding it to your user configuration (see other options code.visualstudio.com/docs/copilot/chat):

  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 (typically found in ~/Library/Application Support/Code/User/mcp.json in macOS).
  3. Add the following to your configuration file:
{
  "servers": {
    "radare2": {
      "type": "stdio",
      "command": "r2pm",
      "args": ["-r", "r2mcp"]
    }
  },
  "inputs": []
}

Zed Integration

You can use r2mcp with Zed as well by adding it to your configuration:

  1. Open the command palette: CMD + Shift + P (macOS) or Ctrl + Shift + P (Windows/Linux).
  2. Search of agent: open configuration or search of settings.
  3. Add your server as such:
  "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 else to be able to use it.

For Developers

Build from Source
Linux/macOS

To test the server locally, you can build and install it with make:

make install

This will compile the server and place the r2mcp binary in /usr/local/bin on macOS.

Windows

For Windows, just use meson and ninja like it's done in the CI:

meson b
ninja -C b
Tests

Run make test-r2r to build and run the offline CLI and core plugin tests in test/db. These use handcrafted hex:// files and need only radare2, r2r, and a POSIX shell in addition to the build dependencies. make test also runs the existing shell and Python tests.

Questions about Radare2

What is the Radare2 MCP server?

MCP stdio server for radare2. Radare2 is maintained by radareorg on GitHub at radareorg/radare2-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Radare2 MCP server?

Radare2 doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (radareorg/radare2-mcp). Like most servers, Radare2 ends with a command or URL you paste into your AI app's MCP config.

Does Radare2 need an API key?

The registry lists no required keys for Radare2. Check the Radare2 README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Radare2 an official MCP server?

No. Radare2 is a community server maintained by radareorg. Community servers can be excellent; read the code and the open issues before you give Radare2 access to company data.

What license is Radare2 under?

Radare2 is released under the MIT license, according to its GitHub repository. The license covers the code of Radare2; the service it connects to has its own terms.