This repository contains the recipie to build the snap version of radare2 using docker as well to build a standalone docker image with the same build.
The resulting build includes the following projects:
- radare2
- r2ghidra
- r2frida (only in supported platforms)
- r2dec
- r2yara
- r2ai
- r2mcp
- r2book (as
infofile)
Radare requires snap classic confinement, to install run:
sudo snap install radare2 --classicOnce installed all radare commands are available as:
radare2.<command> (ex: radare2.rasm2).
To allow using radare commands without this prefix, it can be solved by using shell aliases. So as an example could be something like this:
alias r2='radare2.r2'
alias r2agent='radare2.r2agent'
alias r2frida-compile='radare2.r2frida-compile'
alias r2mcp='radare2.r2mcp'
alias r2p='radare2.r2p'
alias r2pm='radare2.r2pm'
alias r2r='radare2.r2r'
alias r2sdb='radare2.r2sdb'
alias rabin2='radare2.rabin2'
alias radiff2='radare2.radiff2'
alias rafind2='radare2.rafind2'
alias rafs2='radare2.rafs2'
alias ragg2='radare2.ragg2'
alias rahash2='radare2.rahash2'
alias rapatch2='radare2.rapatch2'
alias rarun2='radare2.rarun2'
alias rasign2='radare2.rasign2'
alias rasm2='radare2.rasm2'
alias ravc2='radare2.ravc2'
alias rax2='radare2.rax2'
alias sleighc='radare2.sleighc'
alias yara='radare2.yara'
alias yarac='radare2.yarac'
alias clang-format-radare2='radare2.clang-format-radare2'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:
-
Locate your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the following to your configuration file:
{
"mcpServers": {
"radare2": {
"command": "radare2.r2mcp"
}
}
}VS Code Integration
To use r2mcp with GitHub Copilot Chat in Visual Studio Code by adding it to your user configuration (see also add an mcp server to vscode):
- Open the Command Palette with
CMD + Shift + P(macOS) orCtrl + Shift + P(Windows/Linux). - Search for and select
Copilot: Open User Configuration(typically found in~/Library/Application Support/Code/User/mcp.jsonin macOS). - Add the following to your configuration file:
{
"servers": {
"radare2": {
"type": "stdio",
"command": "radare2.r2mcp"
}
},
"inputs": []
}Zed Integration
You can use r2mcp with Zed as well by adding it to your configuration:
- Open the command palette:
CMD + Shift + P(macOS) orCtrl + Shift + P(Windows/Linux).1º - Search of
agent: open configurationor search ofsettings. - Add your server as such:
"context_servers": {
"r2-mcp-server": {
"source": "custom",
"command": "radare2.r2mcp"
}
}Note: you will need another LLM agent, such as Claude, Gemini or else to be able to use it.
As explained, with the same snap build a docker image is generated.
For documentation on how to use this docker image you can refer to containers section in this respository.