clear_proxy
Remove HTTP proxy configurations from Android devices to restore direct network connections for development and testing workflows.
Instructions
Clear HTTP proxy settings
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_serial | No |
Implementation Reference
- src/adb_mcp_server/server.py:864-867 (handler)The clear_proxy tool handler. Decorated with @mcp.tool() for automatic registration in the MCP server. Executes an ADB command to clear the global HTTP proxy setting by setting it to ":0".@mcp.tool() def clear_proxy(device_serial: str | None = None) -> str: """Clear HTTP proxy settings""" return run_adb(["shell", "settings", "put", "global", "http_proxy", ":0"], device_serial)
- src/adb_mcp_server/server.py:24-40 (helper)Core utility function used by clear_proxy (and all other tools) to execute ADB commands safely, handling device targeting, timeouts, and error capture.def run_adb(args: list[str], device_serial: str | None = None, timeout: int = 30) -> str: """Run an ADB command and return output""" cmd = ["adb"] if device_serial: cmd.extend(["-s", device_serial]) cmd.extend(args) try: result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout) if result.returncode != 0 and result.stderr: return f"Error: {result.stderr}" return result.stdout except subprocess.TimeoutExpired: return "Error: Command timed out" except Exception as e: return f"Error: {str(e)}"