espresso-mcp
The espresso-mcp server is an MCP (Model Context Protocol) server that automates and enhances Android testing workflows using the Espresso framework.
Android Device and Emulator Management: List available Android Virtual Devices (AVDs), list running emulators, start emulators by name, and kill specific emulators.
UI Interaction and Testing: Dump UI hierarchy, open URIs, simulate taps at specific coordinates, perform swipe gestures with optional duration, and simulate various button presses on connected Android devices.
Text Input: Type text or clear existing text and type new text on the connected Android device.
Application Control: List installed applications, install APKs, start/stop apps, uninstall apps, and clear app data.
Screen Capture: Take screenshots and record screen for specified durations.
Additional Utilities: Fetch weather data for cities, retrieve static app configuration, and get personalized greetings via resources.
Provides integration with the Espresso Android Test Framework, enhancing Android app testing capabilities and streamlining test automation workflows.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@espresso-mcp take a screenshot of the current device"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
espresso-mcp
An MCP Server for the Espresso Android Test Framework, crafted to improve testing capabilities and optimize development workflows.
Installation
Python 3.x
uv:
pip install uv
# Run in stdio mode
uvx espresso-mcp
# Run in sse mode
uvx espresso-mcp --sseRelated MCP server: android-mcp
Usage
On Github Copilot: Add below JSON config to the file
.vscode/mcp.json
{
"servers": {
"espresso-mcp": {
"command": "uvx",
"args": ["espresso-mcp"],
"env": {}
}
}
}On Claude: Add below JSON config to the file
claude_desktop_config.json
{
"mcpServers": {
"terminal": {
"command": "uvx",
"args": ["espresso-mcp", "--timeout-ms", "30000"]
}
}
}Using OpenAI SDK
from openai import OpenAI
client = OpenAI()
resp = client.responses.create(
model="gpt-4.1",
tools=[
{
"type": "mcp",
"server_label": "espresso-mcp",
"server_url": "http://localhost:8000/sse",
"require_approval": "never",
},
],
input="Open Teams App",
)
print(resp.output_text)Available Tools
The following tools are available in the espresso-mcp project:
list_avds: List all available Android Virtual Devices (AVDs).
list_emulators: List all running Android Emulators.
start_emulator: Start an Android Emulator by name.
kill_emulator: Kill a specific Android Emulator.
dump_ui_hierarchy: Dump the UI hierarchy of the connected Android device.
open_uri: Open a URI on the connected Android device.
list_apps: List all installed apps on the connected Android device.
install_app: Install an APK on the connected Android device.
start_app: Start a specific app on the connected Android device.
stop_app: Stop a specific app on the connected Android device.
uninstall_app: Uninstall an app from the connected Android device.
clear_app_data: Clear app data for a specific app on the connected Android device.
take_screenshot: Take a screenshot of the connected Android device.
record_screen: Record the screen of the connected Android device for a specified duration.
press_button: Simulate a button press on the connected Android device.
type_text: Type text on the connected Android device.
clear_and_type_text: Clear all text and type new text on the connected Android device.
replace_text: Replace text by clearing current text and typing new text on the connected Android device.
tap: Simulate a tap on the connected Android device at specific coordinates.
swipe: Perform a swipe gesture in a specific direction on the connected Android device.
dump_current_activity: Dump the current activity name of the connected Android device.
Resources
The following resources are available:
config://app: Retrieve static configuration data.
greeting://{name}: Get a personalized greeting.
Local Setup
Python 3.x
uv:
pip install uv
# Install dependencies
uv sync
# OR
uv sync --frozen --all-extras --dev
# Run Server
uv run espresso-mcp
# Run in Dev Mode
uv run mcp dev src/espresso_mcp/server.pyDebugging
Use MCP Inspector
# Install MCP Inspector
yarn global add @modelcontextprotocol/inspector
# Test MCP Server
yarn run @modelcontextprotocol/inspector python server.pyLinting and Testing
# Lint
uv run ruff check
# Tests
uv run pytestPublishing
# Build the package
uv build
uv build --wheel
uv build --no-sources
# Upload to PyPI
uv publishDevelopement Notes
uv tool install espresso-mcp
# OR
uvx espresso-mcp
uv init espresso-mcp
uv add "mcp[cli]"
uv run mcp dev server.py
uv tool run espresso-mcp
uv run pre-commit install
pre-commit run --all-files
Available Tools
22 toolsclear_and_type_textC
Clear all text and type new text on the connected Android device
Inputs: text (required).
clear_app_dataC
Clear app data for a specific app on the connected Android device
Inputs: package_name (required).
dump_current_activityA
Dump the current activity name of the connected Android device
Inputs: no named parameters.
dump_ui_hierarchyB
Dump the UI hierarchy of the connected Android device
Inputs: no named parameters.
fetch_weatherB
Fetch current weather for a city
Inputs: city (required).
install_appB
Install an App APK on the connected Android device
Inputs: app_path (required).
kill_emulatorC
Kill a specific Android Emulator
Inputs: emulator_name (required).
list_appsA
List all installed apps on the connected Android device
Inputs: no named parameters.
list_avdsC
List all available Android Virtual Devices (AVDs)
Inputs: no named parameters.
list_emulatorsA
List all running Android Emulators
Inputs: no named parameters.
open_uriC
Open a URI on the connected Android device
Inputs: uri (required).
press_buttonC
Simulate a button press on the connected Android device using an Enum button
Inputs: button (required).
record_screenC
Record the screen of the connected Android device for a specified duration
Inputs: output_path (required), duration (required).
replace_textB
Replace text on the connected Android device by clearing current text and typing new text
Inputs: text (required).
start_appC
Start an app on the connected Android device
Inputs: package_name (required).
start_emulatorC
Start an Android Emulator by name
Inputs: emulator_name (required).
stop_appC
Stop an app on the connected Android device
Inputs: package_name (required).
swipeC
Perform a swipe gesture in a specific direction on the connected Android device
Inputs: direction (required), duration.
take_screenshotC
Take a screenshot of the connected Android device
Inputs: output_path (required).
tapB
Simulate a tap on the connected Android device at the specified coordinates
Inputs: x (required), y (required).
type_textC
Type text on the connected Android device. Handles spaces correctly.
Inputs: text (required).
uninstall_appC
Uninstall an app from the connected Android device
Inputs: package_name (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Most tools are clearly separated by resource and action, but clear_and_type_text and replace_text describe essentially the same operation, which creates real ambiguity. The unrelated fetch_weather tool also muddies the tool surface.
The overwhelming majority of tools follow a clear verb_noun snake_case pattern (list_apps, start_emulator, take_screenshot). Minor deviations include short gesture verbs like tap and swipe, plus the redundant clear_and_type_text vs replace_text naming.
22 tools is on the heavy side but mostly justifiable for Android emulator/device automation. The count feels inflated by the duplicate text-replacement tools and the off-topic weather tool, which could be trimmed.
Core emulator and app lifecycle operations are covered well, along with common UI interactions. Obvious gaps include no AVD creation/deletion, no device/serial selection, and no test-running or assertion tools despite the espresso name.
Maintenance
Related MCP Connectors
MCP server for Appcircle mobile CI/CD platform.
The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
MCP Server for an Agent Task Marketplace
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
- AlicenseBqualityDmaintenanceA server that enables browser automation using Playwright, allowing interaction with web pages, capturing screenshots, and executing JavaScript in a browser environment through LLMs.1214,136 npm1MIT
- FlicenseNot gradedqualityDmaintenanceA lightweight MCP server for Android operating system automation. This server provides tools to interact directly with Android devices and app interaction with control3-
- AlicenseBqualityDmaintenanceAn MCP server that enables AI assistants to build, test, and debug Android applications by interacting directly with the Android development environment. It provides tools for managing emulators, executing Gradle tasks, running ADB commands, and performing UI automation via accessibility trees.14105 npm19MIT
- FlicenseAqualityDmaintenanceAn MCP server designed for Android development, enabling AI assistants to directly control Android devices for screenshots, UI analysis, app management, and more.19-