quash-mcp 0.2.14__tar.gz → 0.2.17__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.14 → quash_mcp-0.2.17}/PKG-INFO +1 -1
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/local_test.py +1 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/pyproject.toml +1 -1
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/tools/execute_v3.py +2 -1
- quash_mcp-0.2.14/test_backend_integration.py +0 -100
- quash_mcp-0.2.14/test_tools_loading.py +0 -81
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/.gitignore +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/README.md +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/SETUP_CLAUDE_CODE.md +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/__init__.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/__main__.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/backend_client.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/device/__init__.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/device/adb_tools.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/device/portal.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/device/state_capture.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/models.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/server.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/state.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/tools/__init__.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/tools/build.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/tools/build_old.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/tools/configure.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/tools/connect.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/tools/execute.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/tools/execute_v2_backup.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/tools/runsuite.py +0 -0
- {quash_mcp-0.2.14 → quash_mcp-0.2.17}/quash_mcp/tools/usage.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: quash-mcp
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.17
|
|
4
4
|
Summary: Model Context Protocol server for Quash - AI-powered mobile automation agent
|
|
5
5
|
Project-URL: Homepage, https://quashbugs.com
|
|
6
6
|
Project-URL: Repository, https://github.com/quash/quash-mcp
|
|
@@ -20,6 +20,7 @@ async def main():
|
|
|
20
20
|
# Define the task
|
|
21
21
|
# task = "Open the google search app and search for bakeries."
|
|
22
22
|
task = "Open settings and scroll 3 times."
|
|
23
|
+
# task = "Open settings"
|
|
23
24
|
# task = "Go home"
|
|
24
25
|
# task = "Open chrome, search for quashbugs.com and scroll down."
|
|
25
26
|
|
|
@@ -414,7 +414,8 @@ async def execute_v3(
|
|
|
414
414
|
|
|
415
415
|
# 3. Execute action locally FIRST (if provided)
|
|
416
416
|
# NOTE: Backend should have already removed complete() from the code
|
|
417
|
-
if code and action_type == "execute_code":
|
|
417
|
+
if code and (action_type == "execute_code" or action_type == "complete"):
|
|
418
|
+
|
|
418
419
|
log_progress(f"⚡ Executing action...")
|
|
419
420
|
|
|
420
421
|
log_progress(f"```python\n{code}\n```") # Log the code
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
Test script to verify MCP -> Backend integration.
|
|
4
|
-
Tests API key validation and execution logging with real backend.
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
import asyncio
|
|
8
|
-
import os
|
|
9
|
-
import sys
|
|
10
|
-
from pathlib import Path
|
|
11
|
-
from dotenv import load_dotenv
|
|
12
|
-
|
|
13
|
-
# Load .env file from project root
|
|
14
|
-
project_root = Path(__file__).parent.parent
|
|
15
|
-
env_file = project_root / ".env"
|
|
16
|
-
load_dotenv(env_file)
|
|
17
|
-
|
|
18
|
-
# Add src to path
|
|
19
|
-
sys.path.insert(0, str(Path(__file__).parent / "src"))
|
|
20
|
-
|
|
21
|
-
from backend_client import get_backend_client
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
async def test_integration():
|
|
25
|
-
"""Test MCP backend integration."""
|
|
26
|
-
|
|
27
|
-
print("=" * 60)
|
|
28
|
-
print("🧪 Testing Mahoraga MCP -> Backend Integration")
|
|
29
|
-
print("=" * 60)
|
|
30
|
-
|
|
31
|
-
# Check environment
|
|
32
|
-
mock_mode = os.getenv("MAHORAGA_MOCK_BACKEND", "true")
|
|
33
|
-
backend_url = os.getenv("MAHORAGA_BACKEND_URL", "http://localhost:8000")
|
|
34
|
-
|
|
35
|
-
print(f"\n📋 Configuration:")
|
|
36
|
-
print(f" Mock Mode: {mock_mode}")
|
|
37
|
-
print(f" Backend URL: {backend_url}")
|
|
38
|
-
|
|
39
|
-
# Get backend client
|
|
40
|
-
client = get_backend_client()
|
|
41
|
-
|
|
42
|
-
# Test API key from database
|
|
43
|
-
test_api_key = "mah_test1234567890abcdef"
|
|
44
|
-
|
|
45
|
-
print(f"\n🔑 Testing API Key Validation...")
|
|
46
|
-
print(f" API Key: {test_api_key}")
|
|
47
|
-
|
|
48
|
-
# Test validation
|
|
49
|
-
result = await client.validate_api_key(test_api_key)
|
|
50
|
-
|
|
51
|
-
if result.get("valid"):
|
|
52
|
-
print(" ✅ API Key Valid!")
|
|
53
|
-
user = result.get("user", {})
|
|
54
|
-
print(f" 👤 User: {user.get('name')} ({user.get('email')})")
|
|
55
|
-
print(f" 💰 Credits: ${user.get('credits', 0):.2f}")
|
|
56
|
-
else:
|
|
57
|
-
print(f" ❌ API Key Invalid: {result.get('error')}")
|
|
58
|
-
return False
|
|
59
|
-
|
|
60
|
-
# Test execution logging
|
|
61
|
-
print(f"\n📊 Testing Execution Logging...")
|
|
62
|
-
|
|
63
|
-
log_result = await client.log_execution(
|
|
64
|
-
api_key=test_api_key,
|
|
65
|
-
execution_id="test_exec_integration_001",
|
|
66
|
-
status="completed",
|
|
67
|
-
tokens={"prompt": 150, "completion": 75, "total": 225},
|
|
68
|
-
cost=0.05
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
if log_result.get("logged"):
|
|
72
|
-
print(" ✅ Execution Logged!")
|
|
73
|
-
print(f" 💸 Credits Deducted: ${log_result.get('credits_deducted', 0):.2f}")
|
|
74
|
-
print(f" 💰 New Balance: ${log_result.get('new_balance', 0):.2f}")
|
|
75
|
-
else:
|
|
76
|
-
print(f" ❌ Logging Failed: {log_result.get('error')}")
|
|
77
|
-
return False
|
|
78
|
-
|
|
79
|
-
# Verify credits were deducted
|
|
80
|
-
print(f"\n🔍 Verifying Credit Deduction...")
|
|
81
|
-
|
|
82
|
-
verify_result = await client.validate_api_key(test_api_key)
|
|
83
|
-
if verify_result.get("valid"):
|
|
84
|
-
new_credits = verify_result.get("user", {}).get("credits", 0)
|
|
85
|
-
print(f" ✅ Credits Updated: ${new_credits:.2f}")
|
|
86
|
-
|
|
87
|
-
print(f"\n" + "=" * 60)
|
|
88
|
-
print("✅ All Integration Tests Passed!")
|
|
89
|
-
print("=" * 60)
|
|
90
|
-
print("\n💡 Next Steps:")
|
|
91
|
-
print(" 1. MCP is now connected to real backend")
|
|
92
|
-
print(" 2. Test with actual MCP execute command")
|
|
93
|
-
print(" 3. Build web portal for user management")
|
|
94
|
-
|
|
95
|
-
return True
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if __name__ == "__main__":
|
|
99
|
-
success = asyncio.run(test_integration())
|
|
100
|
-
sys.exit(0 if success else 1)
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Test script to verify tool functions are loaded correctly.
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
import sys
|
|
6
|
-
sys.path.insert(0, '/Users/abhinavsai/POC/mahoraga-mac/quash-mcp')
|
|
7
|
-
sys.path.insert(0, '/Users/abhinavsai/POC/mahoraga-mac/mahoraga')
|
|
8
|
-
|
|
9
|
-
def test_tool_loading():
|
|
10
|
-
print("Testing tool loading...")
|
|
11
|
-
|
|
12
|
-
try:
|
|
13
|
-
# Import mahoraga components
|
|
14
|
-
from mahoraga.tools import Tools, describe_tools
|
|
15
|
-
from mahoraga.tools.adb import AdbTools as MahoragaAdbTools
|
|
16
|
-
from mahoraga.agent.context.personas import DEFAULT
|
|
17
|
-
from mahoraga.agent.utils.async_utils import async_to_sync
|
|
18
|
-
|
|
19
|
-
print("✅ All imports successful")
|
|
20
|
-
|
|
21
|
-
# Create a mahoraga AdbTools instance
|
|
22
|
-
print("\nCreating mahoraga AdbTools instance...")
|
|
23
|
-
mahoraga_tools = MahoragaAdbTools(
|
|
24
|
-
serial="emulator-5554", # Use your device serial
|
|
25
|
-
use_tcp=True,
|
|
26
|
-
remote_tcp_port=8080
|
|
27
|
-
)
|
|
28
|
-
print(f"✅ Created mahoraga AdbTools instance")
|
|
29
|
-
print(f" - Serial: {mahoraga_tools.device.serial}")
|
|
30
|
-
print(f" - TCP forwarded: {mahoraga_tools.tcp_forwarded}")
|
|
31
|
-
|
|
32
|
-
# Get tool list
|
|
33
|
-
print("\nGetting tool list...")
|
|
34
|
-
tool_list = describe_tools(mahoraga_tools, exclude_tools=None)
|
|
35
|
-
print(f"✅ Got {len(tool_list)} tools:")
|
|
36
|
-
for tool_name, tool_func in tool_list.items():
|
|
37
|
-
print(f" - {tool_name}: {tool_func}")
|
|
38
|
-
|
|
39
|
-
# Filter by allowed tools
|
|
40
|
-
print(f"\nFiltering by DEFAULT persona allowed tools...")
|
|
41
|
-
allowed_tool_names = DEFAULT.allowed_tools
|
|
42
|
-
print(f" Allowed tools: {allowed_tool_names}")
|
|
43
|
-
|
|
44
|
-
filtered_tools = {name: func for name, func in tool_list.items() if name in allowed_tool_names}
|
|
45
|
-
print(f"✅ Filtered to {len(filtered_tools)} tools:")
|
|
46
|
-
for tool_name in filtered_tools.keys():
|
|
47
|
-
print(f" - {tool_name}")
|
|
48
|
-
|
|
49
|
-
# Test executor globals setup
|
|
50
|
-
print("\nSetting up executor globals...")
|
|
51
|
-
executor_globals = {"__builtins__": __builtins__}
|
|
52
|
-
|
|
53
|
-
for tool_name, tool_function in filtered_tools.items():
|
|
54
|
-
import asyncio
|
|
55
|
-
if asyncio.iscoroutinefunction(tool_function):
|
|
56
|
-
tool_function = async_to_sync(tool_function)
|
|
57
|
-
executor_globals[tool_name] = tool_function
|
|
58
|
-
|
|
59
|
-
print(f"✅ Executor globals set up with {len(executor_globals)} items")
|
|
60
|
-
|
|
61
|
-
# Test that functions are callable
|
|
62
|
-
print("\nTesting function availability...")
|
|
63
|
-
test_functions = ['start_app', 'swipe', 'press_key', 'tap_by_index']
|
|
64
|
-
for func_name in test_functions:
|
|
65
|
-
if func_name in executor_globals:
|
|
66
|
-
print(f" ✅ {func_name} is available")
|
|
67
|
-
else:
|
|
68
|
-
print(f" ❌ {func_name} is NOT available")
|
|
69
|
-
|
|
70
|
-
print("\n✅ All tests passed!")
|
|
71
|
-
return True
|
|
72
|
-
|
|
73
|
-
except Exception as e:
|
|
74
|
-
print(f"\n❌ Test failed: {e}")
|
|
75
|
-
import traceback
|
|
76
|
-
traceback.print_exc()
|
|
77
|
-
return False
|
|
78
|
-
|
|
79
|
-
if __name__ == "__main__":
|
|
80
|
-
success = test_tool_loading()
|
|
81
|
-
sys.exit(0 if success else 1)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|