Skip to content
Back to search

radare2-mcp

MCP stdio server for radare2

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/radareorg/radare2-mcp with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/radareorg/radare2-mcp'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/radareorg--radare2-mcp/badge.svg)](/listings/radareorg--radare2-mcp)

HTML

<a href="/listings/radareorg--radare2-mcp"><img src="/api/listings/radareorg--radare2-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

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"]`.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 262 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # Radare2 MCP Server
  2. [![ci](https://github.com/radareorg/radare2-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/radareorg/radare2-mcp/actions/workflows/ci.yml)
  3. [![radare2](https://img.shields.io/badge/radare2-6.2.4-green)](https://github.com/radareorg/radare2)
  4. <img width="400" alt="r2mcp logo" src="./r2mcp.png" />
  5. An MCP server to use **radare2** with AI agents such as OpenCode, Mai, VSCode, Claude, CLION, ...
  6. ## Features
  7. This implementation provides:
  8. - 💻 Fully written in C using the native r2 APIs
  9. - 🧩 Works from the CLI, as an r2 plugin and as an MCP server
  10. - 🔍 Seamless binary analysis with radare2
  11. - 🔗 Connect to any local or remote r2/iaito session via r2pipe
  12. - 🔒 Supports readonly mode, sandbox lock and restrict tools
  13. - 🔩 Fine grained tools configuration
  14. - 🔁 Direct stdin/stdout communication model
  15. - 🌐 HTTP MCP server mode with optional `X-Session-ID` multiplexing
  16. - 🛠️ Optional raw access to run r2 commands or r2js scripts
  17. ## Installation
  18. <img width="400" alt="Screenshot_2025-03-22_at_5 34 47_PM" src="https://github.com/user-attachments/assets/5322c3fc-fc07-4770-96a3-5a6d82d439c2" />
  19. <img width="400" alt="Screenshot_2025-03-22_at_5 36 17_PM" src="https://github.com/user-attachments/assets/132a1de0-6978-4202-8dce-aa3d60551b9a" />
  20. ### Using r2pm
  21. The simplest way to install the package is by using `r2pm`:
  22. ```bash
  23. $ r2pm -Uci r2mcp
  24. ```
  25. 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.
  26. ```bash
  27. $ r2pm -r r2mcp
  28. ```
  29. That's the common mcpServer JSON configuration file:
  30. ```json
  31. {
  32. "mcpServers": {
  33. "radare2": {
  34. "command": "r2pm",
  35. "args": ["-r", "r2mcp"]
  36. }
  37. }
  38. }
  39. ```
  40. ### Codex
  41. To install the codex plugin just run the following command:
  42. ```bash
  43. make codex-plugin-install
  44. ```
  45. This will create a personal marketplace in your home and copy the files from dist/codex-plugin inside.
  46. ### Using Docker
  47. Alternatively, you can build the Docker image:
  48. ```bash
  49. docker build -t r2mcp .
  50. ```
  51. Update your MCP client configuration file (see below) to use the Docker image to use:
  52. - `"command": "docker"`
  53. - `"args": ["run", "--rm", "-i", "-v", "/tmp/data:/data", "r2mcp"]`.
  54. ## Configuration
  55. ### HTTP Server Mode
  56. Use `-H [address:]port` to run r2mcp as an HTTP MCP server instead of using
  57. stdin/stdout. A bare port binds only to `127.0.0.1`; use `0.0.0.0:port`
  58. explicitly to make the server reachable from the network:
  59. ```bash
  60. r2mcp -H 8765
  61. ```
  62. ```bash
  63. # Public binding; protect this with -a <token> or -A.
  64. r2mcp -H 0.0.0.0:8765 -A
  65. ```
  66. Per-session HTTP state is enabled with `-X max[:idle_seconds]` and routed by
  67. the `X-Session-ID` request header:
  68. ```bash
  69. r2mcp -H 8765 -X 8:600
  70. ```
  71. HTTP bearer authentication is enabled with `-a <token>`. Clients must send
  72. `Authorization: Bearer <token>` on every `GET` and `POST` request:
  73. ```bash
  74. r2mcp -H 8765 -a my-secret-token
  75. ```
  76. Use `-A` or `-a random` to generate a random token at startup. The generated
  77. token is printed once on stderr:
  78. ```bash
  79. r2mcp -H 8765 -A
  80. ```
  81. The same token setting can be supplied with `R2MCP_AUTH_TOKEN`; set it to
  82. `random` to generate one.
  83. `-X` requires radare2 ABI 91 or newer because older radare2 headers do not
  84. expose the HTTP request header API. With older ABIs, `-H` still works as a
  85. single shared HTTP server, but `-X` is ignored. Bearer authentication also
  86. requires this header API.
  87. ### r2 Core Plugin Mode
  88. The r2 core plugin exposes the `r2mcp` command inside an existing radare2
  89. session. Starting HTTP mode from r2 reuses the current `RCore`, so MCP tools
  90. operate on the file and analysis state already loaded in that session:
  91. ```bash
  92. r2 -e r2mcp.port=8765 -c 'r2mcp start' /bin/ls
  93. ```
  94. Useful subcommands:
  95. - `r2mcp start` or `r2mcp http` starts the HTTP MCP server in the background.
  96. - `r2mcp stop`, `r2mcp restart`, and `r2mcp status` manage the background server.
  97. - `r2mcp logs on|off` and `r2mcp logs file <path>` control plugin debug logs.
  98. - `r2mcp approve on|off` and `r2mcp approve url <url>` control supervisor approvals.
  99. - `r2mcp yolo on|off` disables approvals and exposes dangerous run tools.
  100. - `r2mcp config` lists the `r2mcp.*` eval keys.
  101. The plugin registers eval keys for the same server options exposed by the CLI:
  102. `r2mcp.port`, `r2mcp.log`, `r2mcp.logfile`, `r2mcp.auth`, `r2mcp.approve`, `r2mcp.svc`,
  103. `r2mcp.yolo`, `r2mcp.mini`, `r2mcp.permissive`, `r2mcp.run`,
  104. `r2mcp.readonly`, `r2mcp.ignore_analysis`, `r2mcp.prompts`,
  105. `r2mcp.prompts.dir`, `r2mcp.sandbox`, `r2mcp.sandbox.grain`,
  106. `r2mcp.content`, `r2mcp.enabled`, `r2mcp.disabled`,
  107. `r2mcp.session_tools`, `r2mcp.sessions`, `r2mcp.sessions.max`,
  108. `r2mcp.sessions.timeout`, `r2mcp.decompiler`, and `r2mcp.baseurl`.
  109. When loading the plugin manually with `-i`, set these keys after the plugin is
  110. loaded, for example with `-c 'e r2mcp.port=8765'`, because radare2 processes
  111. early `-e` options before ad hoc plugin initialization.
  112. ### SQL through r2xsql
  113. Install the [r2xsql](https://github.com/radareorg/r2xsql) core plugin for the
  114. same radare2 build that r2mcp uses. The `sql` tool is available without `-r`
  115. in local mode. Call `open_file`, `analyze`, and `sql` with arguments such as:
  116. ```json
  117. {"query":"SELECT name, size FROM funcs WHERE size > 100 ORDER BY size DESC LIMIT 10"}
  118. ```
  119. The `sql` tool passes one statement directly to the loaded SQL core plugin,
  120. preserving SQL operators and quoted text. Results are the plugin's text output.
  121. It supports SQL writes, so it is excluded from read-only mode (`-R`).
  122. Use it with a local r2mcp server or r2mcp's core plugin; remote r2 HTTP client
  123. mode (`-u`) does not expose this tool.
  124. An installed plugin loads automatically. To load a build explicitly, add
  125. `-c 'L /absolute/path/core_r2xsql.so'` to the r2mcp command. Startup commands
  126. run in order before MCP requests or `-T` tests, and their output is discarded
  127. to keep stdout valid for MCP. On macOS/Windows use the actual plugin filename.
  128. ### Claude Desktop Integration
  129. 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:
  130. 1. Locate your Claude Desktop configuration file:
  131. - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
  132. - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
  133. 2. Add the following to your configuration file:
  134. ```json
  135. {
  136. "mcpServers": {
  137. "radare2": {
  138. "command": "r2pm",
  139. "args": ["-r", "r2mcp"]
  140. }
  141. }
  142. }
  143. ```
  144. ## VS Code Integration
  145. To use r2mcp with GitHub Copilot Chat in Visual Studio Code by [adding it to your user configuration](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server-to-your-user-configuration) (see other options [here](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server)):
  146. 1. Open the Command Palette with `CMD + Shift + P` (macOS) or `Ctrl + Shift + P` (Windows/Linux).
  147. 2. Search for and select `Copilot: Open User Configuration` (typically found in `~/Library/Application Support/Code/User/mcp.json` in macOS).
  148. 3. Add the following to your configuration file:
  149. ```json
  150. {
  151. "servers": {
  152. "radare2": {
  153. "type": "stdio",
  154. "command": "r2pm",
  155. "args": ["-r", "r2mcp"]
  156. }
  157. },
  158. "inputs": []
  159. }
  160. ```
  161. ## Zed Integration
  162. You can use r2mcp with Zed as well by [adding it to your configuration](https://zed.dev/docs/ai/mcp):
  163. 1. Open the command palette: `CMD + Shift + P` (macOS) or `Ctrl + Shift + P` (Windows/Linux).
  164. 2. Search of `agent: open configuration` or search of `settings`.
  165. 3. Add your server as such:
  166. ```json
  167. "context_servers": {
  168. "r2-mcp-server": {
  169. "source": "custom",
  170. "command": "r2pm",
  171. "args": ["-r", "r2mcp"],
  172. "env": {}
  173. }
  174. }
  175. ```
  176. Note: you will need another LLM agent, such as Claude, Gemini or else to be able to use it.
  177. ## For Developers
  178. ### Build from Source
  179. #### Linux/macOS
  180. To test the server locally, you can build and install it with make:
  181. ```bash
  182. make install
  183. ```
  184. This will compile the server and place the `r2mcp` binary in `/usr/local/bin` on macOS.
  185. #### Windows
  186. For Windows, just use meson and ninja like it's done in the CI:
  187. ```cmd
  188. meson b
  189. ninja -C b
  190. ```

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.