clear_proxy
Remove HTTP proxy configurations from Android devices to restore direct network connections for development and testing workflows.
Instructions
Clear HTTP proxy settings
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "clear_proxy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_serial | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
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)}"