shell_command
Execute ADB shell commands on Android devices for debugging, testing, and device management through the Enhanced ADB MCP Server.
Instructions
Execute an arbitrary ADB shell command. Use with caution - this gives full shell access.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"command": "<command>"
},
"name": "shell_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| device_serial | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/adb_mcp_server/server.py:987-993 (handler)Handler and registration for the 'shell_command' tool via @mcp.tool() decorator. Executes arbitrary ADB shell commands using the run_adb helper.
@mcp.tool() def shell_command(command: str, device_serial: str | None = None) -> str: """ Execute an arbitrary ADB shell command. Use with caution - this gives full shell access. """ return run_adb(["shell", command], device_serial) - src/adb_mcp_server/server.py:987-987 (registration)Decorator that registers the shell_command function as an MCP tool.
@mcp.tool()