angr.mcp.session¶
Session management for angr MCP server.
- angr.mcp.session.parse_flavor(flavor)¶
Validate a decompilation flavor name, naming the valid ones on failure.
- angr.mcp.session.parse_address_option(name, value)¶
Parse an optional hex-or-decimal address option, naming the option on failure.
- angr.mcp.session.parse_arch_option(arch)¶
Resolve an archinfo identifier such as “x86_64”, “aarch64”, “armel”, or “mips32”.
- angr.mcp.session.build_main_opts(*, arch=None, backend=None, base_address=None, entry_point=None)¶
Translate load_binary’s optional loader inputs into CLE main_opts.
archselects the slice of a universal Mach-O or overrides a headered file.backend="blob"witharchloads a headerless raw binary atbase_addresswithentry_point.
- angr.mcp.session.reject_dos_executable(path)¶
16-bit DOS MZ images share PE’s magic but have no lifter; report that instead of a loader crash.
- class angr.mcp.session.ProjectSession¶
Bases:
objectRepresents a loaded angr project with its associated analyses.
- project_id: str
- project: Project
- binary_path: str
- lock: RLock
- set_flavor(flavor)¶
Set the project-wide decompilation flavor and return the previous one.
- exclusive()¶
Serialize access to this project.
FastMCP runs synchronous tools on worker threads, so two calls can reach the same Project and KnowledgeBase at once. Neither is thread-safe, and the decompilation and variable caches spill to LMDB, where a concurrent eviction and reload can hand back a half-imported object. Read-only tools are not exempt: a read racing an eviction is exactly that hazard.
- Return type:
- class angr.mcp.session.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.session.get_session_manager()¶
Get or create the global session manager.
- Return type: