An MCP server to use radare2 with AI agents such as OpenCode, Mai, VSCode, Claude, CLION, ... 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 too
Add this skill
npx mdskills install radareorg/radare2-mcpWell-documented binary analysis MCP server with comprehensive setup instructions and strong security controls
1# Radare2 MCP Server23[](https://github.com/radareorg/radare2-mcp/actions/workflows/ci.yml)4[](https://github.com/radareorg/radare2)56<img width="400" alt="r2mcp logo" src="./r2mcp.png" />78An MCP server to use **radare2** with AI agents such as OpenCode, Mai, VSCode, Claude, CLION, ...910## Features1112This implementation provides:1314- ๐ป Fully written in C using the native r2 APIs15- ๐งฉ Works from the CLI, as an r2 plugin and as an MCP server16- ๐ Seamless binary analysis with radare217- ๐ Connect to any local or remote r2/iaito session via r2pipe18- ๐ Supports readonly mode, sandbox lock and restrict tools19- ๐ฉ Fine grained tools configuration20- ๐ Direct stdin/stdout communication model21- ๐ ๏ธ Optional raw access to run r2 commands or r2js scripts2223## Installation2425<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" />26<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" />2728### Using r2pm2930The simplest way to install the package is by using `r2pm`:3132```bash33$ r2pm -Uci r2mcp34```3536The `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.3738```bash39$ r2pm -r r2mcp40```4142That's the common mcpServer JSON configuration file:4344```json45{46 "mcpServers": {47 "radare2": {48 "command": "r2pm",49 "args": ["-r", "r2mcp"]50 }51 }52}53```5455### Using Docker5657Alternatively, you can build the Docker image:5859```bash60docker build -t r2mcp .61```6263Update your MCP client configuration file (see below) to use the Docker image to use:6465- `"command": "docker"`66- `"args": ["run", "--rm", "-i", "-v", "/tmp/data:/data", "r2mcp"]`.6768## Configuration6970### Claude Desktop Integration7172In 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:73741. Locate your Claude Desktop configuration file:7576 - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`77 - Windows: `%APPDATA%\Claude\claude_desktop_config.json`78792. Add the following to your configuration file:8081```json82{83 "mcpServers": {84 "radare2": {85 "command": "r2pm",86 "args": ["-r", "r2mcp"]87 }88 }89}90```9192## VS Code Integration9394To 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)):95961. Open the Command Palette with `CMD + Shift + P` (macOS) or `Ctrl + Shift + P` (Windows/Linux).972. Search for and select `Copilot: Open User Configuration` (typically found in `~/Library/Application Support/Code/User/mcp.json` in macOS).983. Add the following to your configuration file:99100```json101{102 "servers": {103 "radare2": {104 "type": "stdio",105 "command": "r2pm",106 "args": ["-r", "r2mcp"]107 }108 },109 "inputs": []110}111```112113## Zed Integration114115You can use r2mcp with Zed as well by [adding it to your configuration](https://zed.dev/docs/ai/mcp):1161171. Open the command palette: `CMD + Shift + P` (macOS) or `Ctrl + Shift + P` (Windows/Linux).1182. Search of `agent: open configuration` or search of `settings`.1193. Add your server as such:120121```json122 "context_servers": {123 "r2-mcp-server": {124 "source": "custom",125 "command": "r2pm",126 "args": ["-r", "r2mcp"],127 "env": {}128 }129 }130```131Note: you will need another LLM agent, such as Claude, Gemini or else to be able to use it.132133## For Developers134135### Build from Source136137#### Linux/macOS138139To test the server locally, you can build and install it with make:140141```bash142make install143```144145This will compile the server and place the `r2mcp` binary in `/usr/local/bin` on macOS.146147#### Windows148149For Windows, just use meson and ninja like it's done in the CI:150151```cmd152meson b153ninja -C b154```155
Full transparency โ inspect the skill content before installing.