quash-mcp 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of quash-mcp might be problematic. Click here for more details.
- quash_mcp-0.2.0/.gitignore +43 -0
- quash_mcp-0.2.0/PKG-INFO +271 -0
- quash_mcp-0.2.0/README.md +239 -0
- quash_mcp-0.2.0/SETUP_CLAUDE_CODE.md +133 -0
- quash_mcp-0.2.0/pyproject.toml +50 -0
- quash_mcp-0.2.0/quash_mcp/__init__.py +1 -0
- quash_mcp-0.2.0/quash_mcp/__main__.py +10 -0
- quash_mcp-0.2.0/quash_mcp/backend_client.py +203 -0
- quash_mcp-0.2.0/quash_mcp/server.py +399 -0
- quash_mcp-0.2.0/quash_mcp/state.py +137 -0
- quash_mcp-0.2.0/quash_mcp/tools/__init__.py +9 -0
- quash_mcp-0.2.0/quash_mcp/tools/build.py +739 -0
- quash_mcp-0.2.0/quash_mcp/tools/build_old.py +185 -0
- quash_mcp-0.2.0/quash_mcp/tools/configure.py +140 -0
- quash_mcp-0.2.0/quash_mcp/tools/connect.py +153 -0
- quash_mcp-0.2.0/quash_mcp/tools/execute.py +177 -0
- quash_mcp-0.2.0/quash_mcp/tools/runsuite.py +209 -0
- quash_mcp-0.2.0/quash_mcp/tools/usage.py +31 -0
- quash_mcp-0.2.0/test_backend_integration.py +100 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
node_modules/
|
|
2
|
+
dist/
|
|
3
|
+
release/
|
|
4
|
+
.env
|
|
5
|
+
.env.local
|
|
6
|
+
.DS_Store
|
|
7
|
+
# IDE and editor settings
|
|
8
|
+
.idea/
|
|
9
|
+
.vscode/
|
|
10
|
+
|
|
11
|
+
# Build artifacts
|
|
12
|
+
*.iml
|
|
13
|
+
*.tsbuildinfo
|
|
14
|
+
|
|
15
|
+
# Large local artifacts/binaries
|
|
16
|
+
*.apk
|
|
17
|
+
|
|
18
|
+
*.log
|
|
19
|
+
npm-debug.log*
|
|
20
|
+
yarn-debug.log*
|
|
21
|
+
yarn-error.log*
|
|
22
|
+
|
|
23
|
+
# Python cache files
|
|
24
|
+
__pycache__/
|
|
25
|
+
*.py[cod]
|
|
26
|
+
*$py.class
|
|
27
|
+
*.so
|
|
28
|
+
.Python
|
|
29
|
+
build/
|
|
30
|
+
develop-eggs/
|
|
31
|
+
downloads/
|
|
32
|
+
eggs/
|
|
33
|
+
.eggs/
|
|
34
|
+
lib/
|
|
35
|
+
lib64/
|
|
36
|
+
parts/
|
|
37
|
+
sdist/
|
|
38
|
+
var/
|
|
39
|
+
wheels/
|
|
40
|
+
*.egg-info/
|
|
41
|
+
.installed.cfg
|
|
42
|
+
*.egg
|
|
43
|
+
MANIFEST
|
quash_mcp-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: quash-mcp
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Model Context Protocol server for Quash - AI-powered mobile automation agent
|
|
5
|
+
Project-URL: Homepage, https://quashbugs.com
|
|
6
|
+
Project-URL: Repository, https://github.com/quash/quash-mcp
|
|
7
|
+
Project-URL: Documentation, https://docs.quashbugs.com
|
|
8
|
+
Project-URL: Issues, https://github.com/quash/quash-mcp/issues
|
|
9
|
+
Author-email: Quash Team <hello@quashbugs.com>
|
|
10
|
+
License: MIT
|
|
11
|
+
Keywords: ai,android,mcp,mobile-automation,quash,testing
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Software Development :: Testing
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Requires-Dist: adbutils==2.10.0
|
|
21
|
+
Requires-Dist: apkutils==2.0.0
|
|
22
|
+
Requires-Dist: click>=8.1.0
|
|
23
|
+
Requires-Dist: httpx>=0.27.0
|
|
24
|
+
Requires-Dist: mcp>=0.9.0
|
|
25
|
+
Requires-Dist: pydantic>=2.0.0
|
|
26
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
27
|
+
Requires-Dist: rich>=13.0.0
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# Quash MCP - AI-Powered Mobile Automation
|
|
34
|
+
|
|
35
|
+
A Model Context Protocol (MCP) server for mobile automation testing with Quash. Control Android devices and run automated tests from **any MCP-compatible host** using natural language.
|
|
36
|
+
|
|
37
|
+
## Features
|
|
38
|
+
|
|
39
|
+
- 🤖 **AI-Powered Automation**: Control your Android device using plain English
|
|
40
|
+
- 📱 **Device Connection**: Works with emulators and physical devices
|
|
41
|
+
- ⚙️ **Flexible Configuration**: Customize AI model, temperature, vision, reasoning, and more
|
|
42
|
+
- 🔄 **Real-Time Execution**: Live progress streaming during task execution
|
|
43
|
+
- 🎯 **Suite Execution**: Run multiple tasks in sequence with retry logic
|
|
44
|
+
- 📊 **Usage Tracking**: Monitor API costs and token usage
|
|
45
|
+
- 🔐 **Secure**: API key authentication via Quash platform
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install quash-mcp
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
All dependencies (including ADB tools and device connectivity) are automatically installed. **AI execution happens on the Quash backend**, keeping the client lightweight and proprietary logic protected.
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
### 1. Get Your API Key
|
|
58
|
+
|
|
59
|
+
1. Visit [quashbugs.com](https://quashbugs.com) (or your deployment URL)
|
|
60
|
+
2. Sign in with Google
|
|
61
|
+
3. Go to Dashboard → API Keys
|
|
62
|
+
4. Create a new API key
|
|
63
|
+
|
|
64
|
+
### 2. Add to Your MCP Host
|
|
65
|
+
|
|
66
|
+
Quash MCP works with any MCP-compatible host. Configure it to use `python3 -m quash_mcp` which works across all Python environments:
|
|
67
|
+
|
|
68
|
+
#### Manual Configuration (Recommended)
|
|
69
|
+
|
|
70
|
+
Add to your MCP host's config file:
|
|
71
|
+
|
|
72
|
+
**Config file locations:**
|
|
73
|
+
- **Claude Desktop (macOS)**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
74
|
+
- **Claude Desktop (Linux)**: `~/.config/claude/claude_desktop_config.json`
|
|
75
|
+
- **Claude Desktop (Windows)**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
76
|
+
- **Claude Code**: `~/.claude.json` (project-specific under `projects.<path>.mcpServers`)
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"mcpServers": {
|
|
81
|
+
"quash": {
|
|
82
|
+
"command": "python3",
|
|
83
|
+
"args": ["-m", "quash_mcp"]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Why `python3 -m quash_mcp`?**
|
|
90
|
+
- Works in any Python environment (conda, venv, system)
|
|
91
|
+
- No PATH configuration needed
|
|
92
|
+
- Uses whichever Python has quash-mcp installed
|
|
93
|
+
|
|
94
|
+
#### Alternative: Direct Command (if in PATH)
|
|
95
|
+
|
|
96
|
+
If `quash-mcp` is in your PATH:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"mcpServers": {
|
|
101
|
+
"quash": {
|
|
102
|
+
"command": "quash-mcp"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Then restart your MCP host.
|
|
109
|
+
|
|
110
|
+
### 3. Start Automating
|
|
111
|
+
|
|
112
|
+
Ask your AI assistant (via your MCP host):
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
"Setup Quash and connect to my Android device"
|
|
116
|
+
"Configure with my API key: mhg_xxxx..."
|
|
117
|
+
"Execute task: Open Settings and enable WiFi"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Available Tools
|
|
121
|
+
|
|
122
|
+
### 1. `build`
|
|
123
|
+
Setup and verify all dependencies.
|
|
124
|
+
|
|
125
|
+
**Example:**
|
|
126
|
+
```
|
|
127
|
+
Can you run the build tool to setup my system for Quash?
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 2. `connect`
|
|
131
|
+
Connect to an Android device or emulator.
|
|
132
|
+
|
|
133
|
+
**Parameters:**
|
|
134
|
+
- `device_serial` (optional): Device serial number
|
|
135
|
+
|
|
136
|
+
**Example:**
|
|
137
|
+
```
|
|
138
|
+
Connect to my Android device
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 3. `configure`
|
|
142
|
+
Configure agent execution parameters.
|
|
143
|
+
|
|
144
|
+
**Parameters:**
|
|
145
|
+
- `quash_api_key`: Your Quash API key from the web portal
|
|
146
|
+
- `model`: LLM model (e.g., "anthropic/claude-sonnet-4", "openai/gpt-4o")
|
|
147
|
+
- `temperature`: 0-2 (default: 0.2)
|
|
148
|
+
- `max_steps`: Maximum execution steps (default: 15)
|
|
149
|
+
- `vision`: Enable screenshots (default: false)
|
|
150
|
+
- `reasoning`: Enable multi-step planning (default: false)
|
|
151
|
+
- `reflection`: Enable self-improvement (default: false)
|
|
152
|
+
- `debug`: Verbose logging (default: false)
|
|
153
|
+
|
|
154
|
+
**Example:**
|
|
155
|
+
```
|
|
156
|
+
Configure Quash with my API key mhg_xxx, use Claude Sonnet 4, and enable vision
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### 4. `execute`
|
|
160
|
+
Run an automation task on the device.
|
|
161
|
+
|
|
162
|
+
**Parameters:**
|
|
163
|
+
- `task`: Natural language task description
|
|
164
|
+
|
|
165
|
+
**Example:**
|
|
166
|
+
```
|
|
167
|
+
Execute task: Open Settings and navigate to WiFi settings
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### 5. `runsuite`
|
|
171
|
+
Execute multiple tasks in sequence with retry logic.
|
|
172
|
+
|
|
173
|
+
**Parameters:**
|
|
174
|
+
- `suite_name`: Name of the test suite
|
|
175
|
+
- `tasks`: Array of tasks with retry and failure handling options
|
|
176
|
+
|
|
177
|
+
**Example:**
|
|
178
|
+
```
|
|
179
|
+
Run a test suite with these tasks: [
|
|
180
|
+
{"prompt": "Open Settings", "type": "setup"},
|
|
181
|
+
{"prompt": "Enable WiFi", "type": "test", "retries": 2},
|
|
182
|
+
{"prompt": "Close Settings", "type": "teardown"}
|
|
183
|
+
]
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### 6. `usage`
|
|
187
|
+
View API usage statistics and costs.
|
|
188
|
+
|
|
189
|
+
**Example:**
|
|
190
|
+
```
|
|
191
|
+
Show me my Quash usage statistics
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Complete Workflow Example
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
User: "Setup Quash on my machine"
|
|
198
|
+
→ Runs build tool
|
|
199
|
+
→ Returns: All dependencies installed ✓
|
|
200
|
+
|
|
201
|
+
User: "Connect to my Android emulator"
|
|
202
|
+
→ Runs connect tool
|
|
203
|
+
→ Returns: Connected to emulator-5554 ✓
|
|
204
|
+
|
|
205
|
+
User: "Configure to use Claude Sonnet 4 with vision and my API key is mhg_xxx..."
|
|
206
|
+
→ Runs configure tool
|
|
207
|
+
→ Returns: Configuration set ✓
|
|
208
|
+
|
|
209
|
+
User: "Execute task: Open Instagram and go to my profile"
|
|
210
|
+
→ Runs execute tool with live streaming
|
|
211
|
+
→ Returns: Task completed ✓
|
|
212
|
+
|
|
213
|
+
User: "Show me my usage statistics"
|
|
214
|
+
→ Runs usage tool
|
|
215
|
+
→ Returns: Total cost: $0.15, 10 executions ✓
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Requirements
|
|
219
|
+
|
|
220
|
+
- **Python 3.11+** - Required for the MCP server
|
|
221
|
+
- **Android Device** - Emulator or physical device with USB debugging enabled
|
|
222
|
+
- **Quash API Key** - Get from [quashbugs.com](https://quashbugs.com)
|
|
223
|
+
|
|
224
|
+
Dependencies automatically installed:
|
|
225
|
+
- Android Debug Bridge (ADB) - via `adbutils`
|
|
226
|
+
- Quash Portal APK - via `apkutils`
|
|
227
|
+
- MCP protocol support - via `mcp`
|
|
228
|
+
- HTTP client - via `httpx`
|
|
229
|
+
|
|
230
|
+
## Architecture
|
|
231
|
+
|
|
232
|
+
**v0.2.0 uses a client-server architecture:**
|
|
233
|
+
- **Client (quash-mcp)**: Lightweight MCP server handling device connections and API calls
|
|
234
|
+
- **Server (Quash backend)**: Proprietary AI execution engine (LLMs, agents, pricing logic)
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
quash-mcp/
|
|
238
|
+
├── quash_mcp/
|
|
239
|
+
│ ├── __main__.py # Module entry point for python -m
|
|
240
|
+
│ ├── server.py # Main MCP server entry point
|
|
241
|
+
│ ├── backend_client.py # API communication with Quash backend
|
|
242
|
+
│ ├── state.py # Session state management
|
|
243
|
+
│ └── tools/
|
|
244
|
+
│ ├── build.py # Dependency checker and installer
|
|
245
|
+
│ ├── connect.py # Device connectivity
|
|
246
|
+
│ ├── configure.py # Agent configuration
|
|
247
|
+
│ ├── execute.py # Task execution (calls backend API)
|
|
248
|
+
│ ├── runsuite.py # Suite execution (calls backend API)
|
|
249
|
+
│ └── usage.py # Usage statistics (from backend)
|
|
250
|
+
└── pyproject.toml
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Troubleshooting
|
|
254
|
+
|
|
255
|
+
**"No devices found"**
|
|
256
|
+
- Start Android emulator via Android Studio > AVD Manager
|
|
257
|
+
- Connect physical device with USB debugging enabled
|
|
258
|
+
- For WiFi debugging: `adb tcpip 5555 && adb connect <device-ip>:5555`
|
|
259
|
+
|
|
260
|
+
**"Portal not ready"**
|
|
261
|
+
- The `connect` tool automatically installs the Portal APK
|
|
262
|
+
- If it fails, manually enable the Quash Portal accessibility service in Settings > Accessibility
|
|
263
|
+
|
|
264
|
+
**"Invalid API key"**
|
|
265
|
+
- Make sure you've run `configure` with a valid API key from quashbugs.com
|
|
266
|
+
- API keys start with `mhg_` prefix
|
|
267
|
+
- Check your API key hasn't been revoked in the web portal
|
|
268
|
+
|
|
269
|
+
## License
|
|
270
|
+
|
|
271
|
+
MIT
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# Quash MCP - AI-Powered Mobile Automation
|
|
2
|
+
|
|
3
|
+
A Model Context Protocol (MCP) server for mobile automation testing with Quash. Control Android devices and run automated tests from **any MCP-compatible host** using natural language.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🤖 **AI-Powered Automation**: Control your Android device using plain English
|
|
8
|
+
- 📱 **Device Connection**: Works with emulators and physical devices
|
|
9
|
+
- ⚙️ **Flexible Configuration**: Customize AI model, temperature, vision, reasoning, and more
|
|
10
|
+
- 🔄 **Real-Time Execution**: Live progress streaming during task execution
|
|
11
|
+
- 🎯 **Suite Execution**: Run multiple tasks in sequence with retry logic
|
|
12
|
+
- 📊 **Usage Tracking**: Monitor API costs and token usage
|
|
13
|
+
- 🔐 **Secure**: API key authentication via Quash platform
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install quash-mcp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
All dependencies (including ADB tools and device connectivity) are automatically installed. **AI execution happens on the Quash backend**, keeping the client lightweight and proprietary logic protected.
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
### 1. Get Your API Key
|
|
26
|
+
|
|
27
|
+
1. Visit [quashbugs.com](https://quashbugs.com) (or your deployment URL)
|
|
28
|
+
2. Sign in with Google
|
|
29
|
+
3. Go to Dashboard → API Keys
|
|
30
|
+
4. Create a new API key
|
|
31
|
+
|
|
32
|
+
### 2. Add to Your MCP Host
|
|
33
|
+
|
|
34
|
+
Quash MCP works with any MCP-compatible host. Configure it to use `python3 -m quash_mcp` which works across all Python environments:
|
|
35
|
+
|
|
36
|
+
#### Manual Configuration (Recommended)
|
|
37
|
+
|
|
38
|
+
Add to your MCP host's config file:
|
|
39
|
+
|
|
40
|
+
**Config file locations:**
|
|
41
|
+
- **Claude Desktop (macOS)**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
42
|
+
- **Claude Desktop (Linux)**: `~/.config/claude/claude_desktop_config.json`
|
|
43
|
+
- **Claude Desktop (Windows)**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
44
|
+
- **Claude Code**: `~/.claude.json` (project-specific under `projects.<path>.mcpServers`)
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"mcpServers": {
|
|
49
|
+
"quash": {
|
|
50
|
+
"command": "python3",
|
|
51
|
+
"args": ["-m", "quash_mcp"]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Why `python3 -m quash_mcp`?**
|
|
58
|
+
- Works in any Python environment (conda, venv, system)
|
|
59
|
+
- No PATH configuration needed
|
|
60
|
+
- Uses whichever Python has quash-mcp installed
|
|
61
|
+
|
|
62
|
+
#### Alternative: Direct Command (if in PATH)
|
|
63
|
+
|
|
64
|
+
If `quash-mcp` is in your PATH:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"mcpServers": {
|
|
69
|
+
"quash": {
|
|
70
|
+
"command": "quash-mcp"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Then restart your MCP host.
|
|
77
|
+
|
|
78
|
+
### 3. Start Automating
|
|
79
|
+
|
|
80
|
+
Ask your AI assistant (via your MCP host):
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
"Setup Quash and connect to my Android device"
|
|
84
|
+
"Configure with my API key: mhg_xxxx..."
|
|
85
|
+
"Execute task: Open Settings and enable WiFi"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Available Tools
|
|
89
|
+
|
|
90
|
+
### 1. `build`
|
|
91
|
+
Setup and verify all dependencies.
|
|
92
|
+
|
|
93
|
+
**Example:**
|
|
94
|
+
```
|
|
95
|
+
Can you run the build tool to setup my system for Quash?
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 2. `connect`
|
|
99
|
+
Connect to an Android device or emulator.
|
|
100
|
+
|
|
101
|
+
**Parameters:**
|
|
102
|
+
- `device_serial` (optional): Device serial number
|
|
103
|
+
|
|
104
|
+
**Example:**
|
|
105
|
+
```
|
|
106
|
+
Connect to my Android device
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 3. `configure`
|
|
110
|
+
Configure agent execution parameters.
|
|
111
|
+
|
|
112
|
+
**Parameters:**
|
|
113
|
+
- `quash_api_key`: Your Quash API key from the web portal
|
|
114
|
+
- `model`: LLM model (e.g., "anthropic/claude-sonnet-4", "openai/gpt-4o")
|
|
115
|
+
- `temperature`: 0-2 (default: 0.2)
|
|
116
|
+
- `max_steps`: Maximum execution steps (default: 15)
|
|
117
|
+
- `vision`: Enable screenshots (default: false)
|
|
118
|
+
- `reasoning`: Enable multi-step planning (default: false)
|
|
119
|
+
- `reflection`: Enable self-improvement (default: false)
|
|
120
|
+
- `debug`: Verbose logging (default: false)
|
|
121
|
+
|
|
122
|
+
**Example:**
|
|
123
|
+
```
|
|
124
|
+
Configure Quash with my API key mhg_xxx, use Claude Sonnet 4, and enable vision
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 4. `execute`
|
|
128
|
+
Run an automation task on the device.
|
|
129
|
+
|
|
130
|
+
**Parameters:**
|
|
131
|
+
- `task`: Natural language task description
|
|
132
|
+
|
|
133
|
+
**Example:**
|
|
134
|
+
```
|
|
135
|
+
Execute task: Open Settings and navigate to WiFi settings
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 5. `runsuite`
|
|
139
|
+
Execute multiple tasks in sequence with retry logic.
|
|
140
|
+
|
|
141
|
+
**Parameters:**
|
|
142
|
+
- `suite_name`: Name of the test suite
|
|
143
|
+
- `tasks`: Array of tasks with retry and failure handling options
|
|
144
|
+
|
|
145
|
+
**Example:**
|
|
146
|
+
```
|
|
147
|
+
Run a test suite with these tasks: [
|
|
148
|
+
{"prompt": "Open Settings", "type": "setup"},
|
|
149
|
+
{"prompt": "Enable WiFi", "type": "test", "retries": 2},
|
|
150
|
+
{"prompt": "Close Settings", "type": "teardown"}
|
|
151
|
+
]
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 6. `usage`
|
|
155
|
+
View API usage statistics and costs.
|
|
156
|
+
|
|
157
|
+
**Example:**
|
|
158
|
+
```
|
|
159
|
+
Show me my Quash usage statistics
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Complete Workflow Example
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
User: "Setup Quash on my machine"
|
|
166
|
+
→ Runs build tool
|
|
167
|
+
→ Returns: All dependencies installed ✓
|
|
168
|
+
|
|
169
|
+
User: "Connect to my Android emulator"
|
|
170
|
+
→ Runs connect tool
|
|
171
|
+
→ Returns: Connected to emulator-5554 ✓
|
|
172
|
+
|
|
173
|
+
User: "Configure to use Claude Sonnet 4 with vision and my API key is mhg_xxx..."
|
|
174
|
+
→ Runs configure tool
|
|
175
|
+
→ Returns: Configuration set ✓
|
|
176
|
+
|
|
177
|
+
User: "Execute task: Open Instagram and go to my profile"
|
|
178
|
+
→ Runs execute tool with live streaming
|
|
179
|
+
→ Returns: Task completed ✓
|
|
180
|
+
|
|
181
|
+
User: "Show me my usage statistics"
|
|
182
|
+
→ Runs usage tool
|
|
183
|
+
→ Returns: Total cost: $0.15, 10 executions ✓
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Requirements
|
|
187
|
+
|
|
188
|
+
- **Python 3.11+** - Required for the MCP server
|
|
189
|
+
- **Android Device** - Emulator or physical device with USB debugging enabled
|
|
190
|
+
- **Quash API Key** - Get from [quashbugs.com](https://quashbugs.com)
|
|
191
|
+
|
|
192
|
+
Dependencies automatically installed:
|
|
193
|
+
- Android Debug Bridge (ADB) - via `adbutils`
|
|
194
|
+
- Quash Portal APK - via `apkutils`
|
|
195
|
+
- MCP protocol support - via `mcp`
|
|
196
|
+
- HTTP client - via `httpx`
|
|
197
|
+
|
|
198
|
+
## Architecture
|
|
199
|
+
|
|
200
|
+
**v0.2.0 uses a client-server architecture:**
|
|
201
|
+
- **Client (quash-mcp)**: Lightweight MCP server handling device connections and API calls
|
|
202
|
+
- **Server (Quash backend)**: Proprietary AI execution engine (LLMs, agents, pricing logic)
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
quash-mcp/
|
|
206
|
+
├── quash_mcp/
|
|
207
|
+
│ ├── __main__.py # Module entry point for python -m
|
|
208
|
+
│ ├── server.py # Main MCP server entry point
|
|
209
|
+
│ ├── backend_client.py # API communication with Quash backend
|
|
210
|
+
│ ├── state.py # Session state management
|
|
211
|
+
│ └── tools/
|
|
212
|
+
│ ├── build.py # Dependency checker and installer
|
|
213
|
+
│ ├── connect.py # Device connectivity
|
|
214
|
+
│ ├── configure.py # Agent configuration
|
|
215
|
+
│ ├── execute.py # Task execution (calls backend API)
|
|
216
|
+
│ ├── runsuite.py # Suite execution (calls backend API)
|
|
217
|
+
│ └── usage.py # Usage statistics (from backend)
|
|
218
|
+
└── pyproject.toml
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Troubleshooting
|
|
222
|
+
|
|
223
|
+
**"No devices found"**
|
|
224
|
+
- Start Android emulator via Android Studio > AVD Manager
|
|
225
|
+
- Connect physical device with USB debugging enabled
|
|
226
|
+
- For WiFi debugging: `adb tcpip 5555 && adb connect <device-ip>:5555`
|
|
227
|
+
|
|
228
|
+
**"Portal not ready"**
|
|
229
|
+
- The `connect` tool automatically installs the Portal APK
|
|
230
|
+
- If it fails, manually enable the Quash Portal accessibility service in Settings > Accessibility
|
|
231
|
+
|
|
232
|
+
**"Invalid API key"**
|
|
233
|
+
- Make sure you've run `configure` with a valid API key from quashbugs.com
|
|
234
|
+
- API keys start with `mhg_` prefix
|
|
235
|
+
- Check your API key hasn't been revoked in the web portal
|
|
236
|
+
|
|
237
|
+
## License
|
|
238
|
+
|
|
239
|
+
MIT
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Setting up Mahoraga MCP with Claude Code
|
|
2
|
+
|
|
3
|
+
## Step 1: Install Dependencies
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
cd /Users/abhinavsai/POC/mahoraga-mac/mahoraga-mcp
|
|
7
|
+
pip install -e .
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Step 2: Add MCP Server to Claude Code
|
|
11
|
+
|
|
12
|
+
Run this command to add the Mahoraga MCP server:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
claude mcp add mahoraga python3 /Users/abhinavsai/POC/mahoraga-mac/mahoraga-mcp/server.py
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Verify it's connected:
|
|
19
|
+
```bash
|
|
20
|
+
claude mcp list
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
You should see: `mahoraga: ... - ✓ Connected`
|
|
24
|
+
|
|
25
|
+
## Step 3: Verify Installation
|
|
26
|
+
|
|
27
|
+
In Claude Code, you should now see 4 new tools available:
|
|
28
|
+
- `mahoraga__build`
|
|
29
|
+
- `mahoraga__connect`
|
|
30
|
+
- `mahoraga__configure`
|
|
31
|
+
- `mahoraga__execute`
|
|
32
|
+
|
|
33
|
+
## Step 4: First Time Usage
|
|
34
|
+
|
|
35
|
+
### 4.1 Setup Dependencies
|
|
36
|
+
```
|
|
37
|
+
Setup my system for Mahoraga mobile testing
|
|
38
|
+
```
|
|
39
|
+
This will:
|
|
40
|
+
- Check Python version
|
|
41
|
+
- Install ADB if missing
|
|
42
|
+
- Install Mahoraga package
|
|
43
|
+
- Verify Portal APK
|
|
44
|
+
|
|
45
|
+
### 4.2 Connect Device
|
|
46
|
+
Make sure you have an Android emulator running or device connected, then:
|
|
47
|
+
```
|
|
48
|
+
Connect to my Android device
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 4.3 Configure Agent
|
|
52
|
+
```
|
|
53
|
+
Configure Mahoraga with:
|
|
54
|
+
- API key: sk-or-YOUR_KEY_HERE
|
|
55
|
+
- Model: openai/gpt-4o
|
|
56
|
+
- Enable vision
|
|
57
|
+
- Enable reasoning
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 4.4 Run Your First Test
|
|
61
|
+
```
|
|
62
|
+
Execute this task: Open Settings and navigate to About Phone
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Example Session
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
You: "I want to test my Android app with Mahoraga"
|
|
69
|
+
|
|
70
|
+
Claude: "I'll help you set up Mahoraga for mobile testing. Let me start by
|
|
71
|
+
checking if your system has all the required dependencies."
|
|
72
|
+
[calls mahoraga__build]
|
|
73
|
+
|
|
74
|
+
You: "Great! Now connect to my emulator"
|
|
75
|
+
|
|
76
|
+
Claude: [calls mahoraga__connect with no device_serial to auto-detect]
|
|
77
|
+
|
|
78
|
+
You: "Configure it to use Claude 3.5 Sonnet with vision enabled.
|
|
79
|
+
My API key is sk-or-..."
|
|
80
|
+
|
|
81
|
+
Claude: [calls mahoraga__configure with the settings]
|
|
82
|
+
|
|
83
|
+
You: "Now open Instagram and navigate to the profile page"
|
|
84
|
+
|
|
85
|
+
Claude: [calls mahoraga__execute with live streaming of the execution]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Troubleshooting
|
|
89
|
+
|
|
90
|
+
### Tools not showing up
|
|
91
|
+
- Make sure you've restarted Claude Code completely
|
|
92
|
+
- Check the config file path is correct for your OS
|
|
93
|
+
- Verify the server.py path is absolute and correct
|
|
94
|
+
|
|
95
|
+
### "No device found" error
|
|
96
|
+
- Start Android Studio emulator
|
|
97
|
+
- Or connect physical device with USB debugging enabled
|
|
98
|
+
- Run `adb devices` in terminal to verify device is visible
|
|
99
|
+
|
|
100
|
+
### "Portal not ready" error
|
|
101
|
+
- The `connect` tool will automatically try to install it
|
|
102
|
+
- If it fails, manually run: `mahoraga setup --device <serial>`
|
|
103
|
+
|
|
104
|
+
### API key errors
|
|
105
|
+
- Make sure you've run `configure` with a valid OpenRouter API key
|
|
106
|
+
- Key should start with `sk-or-`
|
|
107
|
+
|
|
108
|
+
## Advanced Usage
|
|
109
|
+
|
|
110
|
+
### Using with multiple devices
|
|
111
|
+
```
|
|
112
|
+
Connect to device emulator-5556
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Adjusting execution parameters
|
|
116
|
+
```
|
|
117
|
+
Configure with max_steps: 25 and reasoning: true
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Debug mode
|
|
121
|
+
```
|
|
122
|
+
Configure with debug: true
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
This will show verbose logs during execution.
|
|
126
|
+
|
|
127
|
+
## Next Steps
|
|
128
|
+
|
|
129
|
+
Once you've verified everything works:
|
|
130
|
+
1. Test with your own Android apps
|
|
131
|
+
2. Create reusable test scenarios
|
|
132
|
+
3. Explore reasoning and reflection modes for complex tasks
|
|
133
|
+
4. Consider hosting the MCP server for team access
|