The Android ADB MCP Server enables AI assistants to interact with Android devices through the Android Debug Bridge (ADB). This powerful tool bridges the gap between AI capabilities and Android device management, allowing for seamless automation of Android development and testing operations.
Add the server to your MCP configuration file:
{
"mcpServers": {
"android-adb": {
"command": "npx",
"args": ["-y", "@landicefu/android-adb-mcp-server"],
"env": {},
"disabled": false,
"alwaysAllow": []
}
}
}
~/Library/Application Support/Claude/claude_desktop_config.json
(macOS)~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
(macOS)After configuring, restart your AI assistant to load the new server configuration.
Before using the Android ADB MCP Server, ensure you have:
adb version
in your terminalosascript
(built-in)xclip
(install via apt-get install xclip
or equivalent)The server provides the following tools to manage Android devices:
Tool | Description | Required Parameters | Optional Parameters |
---|---|---|---|
adb_devices |
List connected devices | None | None |
adb_shell |
Execute shell commands | command |
device_id |
adb_install |
Install APK files | path |
device_id |
adb_uninstall |
Uninstall applications | package_name |
device_id |
adb_list_packages |
List installed packages | None | device_id , filter |
adb_pull |
Pull files from device | remote_path , local_path |
device_id |
adb_push |
Push files to device | local_path , remote_path |
device_id |
launch_app |
Launch an application | package_name |
device_id |
take_screenshot_and_save |
Take and save screenshot | output_path |
device_id , format |
take_screenshot_and_copy_to_clipboard |
Take screenshot to clipboard | None | device_id , format |
// Use the adb_devices tool to list all connected Android devices
const devices = await mcp.invoke("android-adb:adb_devices");
console.log(devices);
// Execute a shell command on the connected device
const result = await mcp.invoke("android-adb:adb_shell", {
command: "ls /sdcard"
});
// For multiple devices, specify the device ID
const result = await mcp.invoke("android-adb:adb_shell", {
command: "ls /sdcard",
device_id: "emulator-5554"
});
// Install an APK file
await mcp.invoke("android-adb:adb_install", {
path: "/path/to/app.apk"
});
// List installed packages with an optional filter
const packages = await mcp.invoke("android-adb:adb_list_packages", {
filter: "google"
});
// Launch an app
await mcp.invoke("android-adb:launch_app", {
package_name: "com.example.app"
});
// Uninstall an app
await mcp.invoke("android-adb:adb_uninstall", {
package_name: "com.example.app"
});
// Push a file to the device
await mcp.invoke("android-adb:adb_push", {
local_path: "~/Documents/test.txt",
remote_path: "/sdcard/test.txt"
});
// Pull a file from the device
await mcp.invoke("android-adb:adb_pull", {
remote_path: "/sdcard/screenshot.png",
local_path: "~/Downloads/screenshot.png"
});
// Take a screenshot and save it to a file
await mcp.invoke("android-adb:take_screenshot_and_save", {
output_path: "~/Screenshots/android_screen.png",
format: "png" // Optional: png or jpg
});
// Take a screenshot and copy it to clipboard
await mcp.invoke("android-adb:take_screenshot_and_copy_to_clipboard");
The server intelligently handles device selection:
device_id
parameter# Install globally
npm install -g @landicefu/android-adb-mcp-server
# Or install locally in your project
npm install @landicefu/android-adb-mcp-server
Clone the repository:
git clone https://github.com/landicefu/android-adb-mcp-server.git
cd android-adb-mcp-server
Install dependencies and build:
npm install
npm run build
Configure with direct path:
{
"mcpServers": {
"android-adb": {
"command": "node",
"args": ["/path/to/android-adb-mcp-server/build/index.js"],
"env": {},
"disabled": false,
"alwaysAllow": []
}
}
}
"ADB is not available" error
adb version
in your terminal"No Android devices connected" error
adb devices
adb kill-server
followed by adb start-server
"Multiple devices connected" error
device_id
parameter in your tool calladb_devices
toolScreenshot to clipboard not working
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.