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).
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
You can also use Docker to run the MCP server:
docker build -t r2mcp .
To integrate with Claude Desktop:
Open the Developer settings by pressing CMD + ,
Locate your configuration file based on your operating system:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
Add the following to your configuration file:
{
"mcpServers": {
"radare2": {
"command": "r2pm",
"args": ["-r", "r2mcp"]
}
}
}
To use r2mcp with GitHub Copilot Chat in Visual Studio Code:
CMD + Shift + P
(macOS) or Ctrl + Shift + P
(Windows/Linux)Copilot: Open User Configuration
{
"servers": {
"radare2": {
"type": "stdio",
"command": "r2pm",
"args": ["-r", "r2mcp"]
}
},
"inputs": []
}
To use r2mcp with Zed:
CMD + Shift + P
(macOS) or Ctrl + Shift + P
(Windows/Linux)agent: open configuration
or settings
"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.
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"]
}
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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