configure_remote_device
Connect to a remote Frida server for dynamic instrumentation, enabling runtime analysis and reverse engineering of mobile and desktop applications.
Instructions
Connect to a remote Frida server and make it available for future requests.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The remote <host>:<port> to add. | |
| alias | No | Optional alias used as device_id when targeting this remote. | |
| set_as_default | No | If true, future requests without device_id will prefer this remote. |
Implementation Reference
- src/frida_mcp/cli.py:241-268 (handler)The @mcp.tool()-decorated handler function implementing the 'configure_remote_device' tool. Defines input schema via pydantic Fields and delegates core logic to register_remote_device helper.@mcp.tool() def configure_remote_device( address: str = Field(description="The remote <host>:<port> to add."), alias: Optional[str] = Field( default=None, description="Optional alias used as device_id when targeting this remote.", ), set_as_default: bool = Field( default=False, description="If true, future requests without device_id will prefer this remote.", ), ) -> Dict[str, Any]: """Connect to a remote Frida server and make it available for future requests.""" try: info = register_remote_device(address, alias=alias, set_default=set_as_default) except DeviceSelectionError as exc: if exc.reasons: attempts = "; ".join(exc.reasons) raise ValueError(f"{exc}. Attempts: {attempts}") from exc raise ValueError(str(exc)) from exc response: Dict[str, Any] = {"status": "success"} response.update(info) if set_as_default: response["message"] = "Remote device set as default" return response
- Helper function called by the tool handler. Uses DeviceSelector to register the remote device, cache it, and return device info including alias and default status.def register_remote_device( address: str, *, alias: Optional[str] = None, set_default: bool = False, ) -> Dict[str, str]: """Register a remote device using the active selector.""" global _selector if _selector is None: _selector = DeviceSelector() device = _selector.register_remote(address, alias=alias, set_default=set_default) normalized = _normalize_remote_identifier(address) resolved_alias = _selector._config.alias_for_address(normalized) return { "id": device.id, "name": device.name, "type": device.type, "address": normalized, "alias": resolved_alias or normalized, "default_remote": _selector._config.default_remote or "", }