Skip to main content
Glama

create_interactive_session

Attach to a running process to establish an interactive REPL session for executing commands and scripts, enabling dynamic instrumentation and runtime analysis.

Instructions

Create an interactive REPL-like session with a process.

This returns a session ID that can be used with execute_in_session to run commands. Returns: Information about the created session

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_idNoOptional ID of the device where the process is running. Uses smart selection when omitted.
process_idYesThe ID of the process to attach to for creating an interactive session.

Implementation Reference

  • The core handler function for the 'create_interactive_session' MCP tool. Decorated with @mcp.tool(), it handles process attachment via Frida, session creation/storage, and returns a session ID for subsequent interactions.
    @mcp.tool() def create_interactive_session( process_id: int = Field( description="The ID of the process to attach to for creating an interactive session." ), device_id: Optional[str] = Field( default=None, description="Optional ID of the device where the process is running. Uses smart selection when omitted.", ), ) -> Dict[str, Any]: """Create an interactive REPL-like session with a process. This returns a session ID that can be used with execute_in_session to run commands. Returns: Information about the created session """ try: # Attach to process device = _resolve_device_or_raise(device_id) session = device.attach(process_id) # Generate a unique session ID session_id = f"session_{process_id}_{int(time.time())}" # Store the session _scripts[session_id] = session _script_messages[session_id] = [] _message_locks[session_id] = threading.Lock() return { "status": "success", "process_id": process_id, "session_id": session_id, "message": f"Interactive session created for process {process_id}. Use execute_in_session to run JavaScript commands.", } except Exception as e: return {"status": "error", "error": str(e)}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rmorgans/frida-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server