angr.mcp¶
angr MCP Server - Model Context Protocol interface for angr binary analysis.
This module provides an MCP server that exposes angr’s binary analysis capabilities through standardized tools accessible by LLM applications.
- Usage:
# Run as module with stdio transport (for Claude Desktop, etc.) python -m angr.mcp
# Run with SSE transport python -m angr.mcp –transport sse –port 8080
# Run with HTTP transport python -m angr.mcp –transport http –host 0.0.0.0 –port 8080 –path /mcp
# Programmatic usage from angr.mcp import create_server server = create_server() server.run()
- Available Tools:
load_binary: Load a binary file for analysis
get_cfg: Build the control flow graph
list_functions: List discovered functions
get_function_info: Get detailed function information
decompile_function: Decompile to pseudocode
get_xrefs: Get cross-references
get_strings: Extract strings from binary
get_imports: List imported symbols
get_exports: List exported symbols
get_basic_blocks: Get basic blocks with disassembly
get_callgraph: Get function call graph
find_functions_by_pattern: Search functions by name
list_projects: List active analysis sessions
close_project: Close a project session
- exception angr.mcp.CFGNotBuiltError
Bases:
MCPAngrErrorRaised when CFG is required but not built.
- exception angr.mcp.DecompilationError
Bases:
MCPAngrErrorRaised when decompilation fails.
- exception angr.mcp.FunctionNotFoundError
Bases:
MCPAngrErrorRaised when a function cannot be found.
- exception angr.mcp.MCPAngrError
Bases:
AngrErrorBase exception for MCP angr server errors.
- exception angr.mcp.ProjectNotFoundError
Bases:
MCPAngrErrorRaised when a project ID is not found.
- class angr.mcp.ProjectSession
Bases:
objectRepresents a loaded angr project with its associated analyses.
- project_id: str
- project: Project
- binary_path: str
- property has_cfg: bool
Check if CFG has been built for this project.
- class angr.mcp.SessionManager
Bases:
objectManages multiple angr project sessions.
This class maintains state across MCP tool invocations, allowing projects to persist between calls.
- __init__()
- Return type:
None
- create_session(binary_path, **kwargs)
Load a binary and create a new project session.
- Parameters:
- Return type:
- Returns:
The created ProjectSession with unique ID
- get_session(project_id)
Get an existing session by ID.
- list_sessions()
List all active sessions.
- angr.mcp.create_server()
Create and return the configured MCP server instance.
- Return type:
FastMCP
- angr.mcp.get_session_manager()
Get or create the global session manager.
- Return type:
Submodules
Main MCP server for angr binary analysis. |
|
Session management for angr MCP server. |