Skip to main content
Glama

attach_to_process

Attach to a running process by its ID to enable dynamic instrumentation and runtime analysis using Frida's capabilities for mobile and desktop applications.

Instructions

Attach to a process by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_idNoOptional ID of the device where the process is running. Uses smart selection when omitted.
pidYesThe ID of the process to attach to.

Implementation Reference

  • The core handler function for the 'attach_to_process' MCP tool. It resolves the device, attaches Frida to the specified process PID, and returns success status or error.
    @mcp.tool() def attach_to_process( pid: int = Field(description="The ID of the process to attach to."), device_id: Optional[str] = Field( default=None, description="Optional ID of the device where the process is running. Uses smart selection when omitted.", ), ) -> dict: """Attach to a process by ID.""" try: device = _resolve_device_or_raise(device_id) device.attach(pid) return { "pid": pid, "success": True, "is_detached": False, # New session is not detached } except Exception as e: return {"success": False, "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