Skip to content

Commit 0d147fb

Browse files
authored
Merge pull request #334 from dtmilano/mcp
Add MCP server
2 parents 6e6f54b + b60f4ed commit 0d147fb

36 files changed

Lines changed: 2826 additions & 26 deletions

‎.gitignore‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@ tmp/
2727

2828
# venv #
2929
########
30-
venv/*
30+
venv*/*
31+
32+
# Kiro #
33+
########
34+
.kiro/

‎README.md‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,88 @@ pip3 install androidviewclient --upgrade
3939
```
4040
Or check the wiki for more alternatives.
4141

42+
# AI-Powered Testing with MCP
43+
44+
**NEW!** AndroidViewClient now includes a Model Context Protocol (MCP) server that enables AI assistants like Kiro to interact with Android devices through natural language.
45+
46+
## Quick Start with MCP
47+
48+
1. **Install with MCP support:**
49+
```bash
50+
pip3 install androidviewclient --upgrade
51+
```
52+
53+
2. **Start CulebraTester2 on your device:**
54+
```bash
55+
# Install the APK
56+
adb install -r culebratester2.apk
57+
58+
# Start the service
59+
adb shell am instrument -w com.dtmilano.android.culebratester2/.CulebraTester2Instrumentation
60+
61+
# Forward the port
62+
adb forward tcp:9987 tcp:9987
63+
```
64+
65+
3. **Configure your AI assistant:**
66+
67+
Add to `.kiro/settings/mcp.json` or `~/.kiro/settings/mcp.json`:
68+
```json
69+
{
70+
"mcpServers": {
71+
"culebratester2": {
72+
"command": "culebra-mcp",
73+
"env": {
74+
"CULEBRATESTER2_URL": "http://localhost:9987"
75+
}
76+
}
77+
}
78+
}
79+
```
80+
81+
4. **Start testing with natural language:**
82+
- "Get the device screen size"
83+
- "Launch the Calculator app"
84+
- "Find the button with text Submit and click it"
85+
- "Take a screenshot"
86+
- "Swipe up to scroll"
87+
88+
## MCP Tools Available
89+
90+
The MCP server provides 20 tools for Android automation:
91+
92+
**Element-based interactions:**
93+
- Find elements by text or resource ID
94+
- Click, long-click, enter text, clear text
95+
- Navigate with back/home buttons
96+
- Launch applications
97+
98+
**Coordinate-based interactions:**
99+
- Click/long-click at coordinates
100+
- Swipe gestures
101+
102+
**Device actions:**
103+
- Wake/sleep device
104+
- Get current app
105+
- Force stop apps
106+
- Take screenshots
107+
108+
## Configuration
109+
110+
For detailed MCP configuration options, see the [MCP Configuration Guide](docs/MCP_CONFIGURATION.md).
111+
112+
Quick reference:
113+
- **User-level config** (kiro-cli): `~/.kiro/settings/mcp.json`
114+
- **Workspace config** (Kiro IDE): `.kiro/settings/mcp.json`
115+
- **Examples:** `examples/mcp_config.json`
116+
- **Usage examples:** `examples/test_calculator_mcp.py`
117+
118+
## Environment Variables
119+
120+
- `CULEBRATESTER2_URL`: Base URL for CulebraTester2 (default: `http://localhost:9987`)
121+
- `CULEBRATESTER2_TIMEOUT`: HTTP timeout in seconds (default: `30`)
122+
- `CULEBRATESTER2_DEBUG`: Enable debug logging (`1`, `true`, or `yes`)
123+
42124
# Want to learn more?
43125

44126
> 🚀 Check [Examples](https://github.com/dtmilano/AndroidViewClient/wiki/Resources#examples) and [Screencasts and videos](https://github.com/dtmilano/AndroidViewClient/wiki/Resources#screencasts-and-videos) page to see it in action.

0 commit comments

Comments
 (0)