angr.mcp.session

Session management for angr MCP server.

class angr.mcp.session.ProjectSession

Bases: object

Represents a loaded angr project with its associated analyses.

project_id: str
project: Project
binary_path: str
cfg: CFGModel | None = None
property has_cfg: bool

Check if CFG has been built for this project.

__init__(project_id, project, binary_path, cfg=None)
Parameters:
Return type:

None

class angr.mcp.session.SessionManager

Bases: object

Manages 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:
  • binary_path (str) – Path to the binary to analyze

  • kwargs (Any) – Additional arguments passed to angr.Project

Return type:

ProjectSession

Returns:

The created ProjectSession with unique ID

get_session(project_id)

Get an existing session by ID.

Parameters:

project_id (str) – The project ID to look up

Return type:

ProjectSession

Returns:

The ProjectSession

Raises:

KeyError – If no project with that ID exists

list_sessions()

List all active sessions.

Return type:

list[dict[str, Any]]

Returns:

List of session metadata dictionaries

close_session(project_id)

Close and remove a session.

Parameters:

project_id (str) – The project ID to close

Return type:

bool

Returns:

True if closed, False if not found

angr.mcp.session.get_session_manager()

Get or create the global session manager.

Return type:

SessionManager