minitap-mcp 0.7.0__py3-none-any.whl → 0.8.1__py3-none-any.whl
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.
- minitap/mcp/core/config.py +52 -3
- {minitap_mcp-0.7.0.dist-info → minitap_mcp-0.8.1.dist-info}/METADATA +1 -1
- {minitap_mcp-0.7.0.dist-info → minitap_mcp-0.8.1.dist-info}/RECORD +5 -5
- {minitap_mcp-0.7.0.dist-info → minitap_mcp-0.8.1.dist-info}/WHEEL +0 -0
- {minitap_mcp-0.7.0.dist-info → minitap_mcp-0.8.1.dist-info}/entry_points.txt +0 -0
minitap/mcp/core/config.py
CHANGED
|
@@ -1,13 +1,35 @@
|
|
|
1
1
|
"""Configuration for the MCP server."""
|
|
2
2
|
|
|
3
|
+
from urllib.parse import urlparse
|
|
4
|
+
|
|
3
5
|
from dotenv import load_dotenv
|
|
4
|
-
from pydantic import Field, SecretStr
|
|
6
|
+
from pydantic import Field, SecretStr, model_validator
|
|
5
7
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
6
8
|
|
|
7
9
|
# Load environment variables from .env file
|
|
8
10
|
load_dotenv(verbose=True)
|
|
9
11
|
|
|
10
12
|
|
|
13
|
+
def _derive_mcp_url_from_base(base_url: str) -> str:
|
|
14
|
+
"""Derive the MCP URL from the API base URL.
|
|
15
|
+
|
|
16
|
+
Extracts the scheme and host from the base URL and appends /api/mcp.
|
|
17
|
+
Example: https://dev.platform.minitap.ai/api/v1 -> https://dev.platform.minitap.ai/api/mcp/
|
|
18
|
+
"""
|
|
19
|
+
parsed = urlparse(base_url)
|
|
20
|
+
return f"{parsed.scheme}://{parsed.netloc}/api/mcp/"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _derive_daas_url_from_base(base_url: str) -> str:
|
|
24
|
+
"""Derive the DaaS API URL from the API base URL.
|
|
25
|
+
|
|
26
|
+
Extracts the scheme and host from the base URL and appends /api/daas.
|
|
27
|
+
Example: https://dev.platform.minitap.ai/api/v1 -> https://dev.platform.minitap.ai/api/daas/
|
|
28
|
+
"""
|
|
29
|
+
parsed = urlparse(base_url)
|
|
30
|
+
return f"{parsed.scheme}://{parsed.netloc}/api/daas/"
|
|
31
|
+
|
|
32
|
+
|
|
11
33
|
class MCPSettings(BaseSettings):
|
|
12
34
|
"""Configuration class for MCP server."""
|
|
13
35
|
|
|
@@ -16,8 +38,11 @@ class MCPSettings(BaseSettings):
|
|
|
16
38
|
# Minitap API configuration
|
|
17
39
|
MINITAP_API_KEY: SecretStr | None = Field(default=None)
|
|
18
40
|
MINITAP_API_BASE_URL: str = Field(default="https://platform.minitap.ai/api/v1")
|
|
19
|
-
|
|
20
|
-
|
|
41
|
+
|
|
42
|
+
# These URLs can be set explicitly, or will be derived from MINITAP_API_BASE_URL
|
|
43
|
+
MINITAP_DAAS_API: str | None = Field(default=None)
|
|
44
|
+
MINITAP_API_MCP_BASE_URL: str | None = Field(default=None)
|
|
45
|
+
|
|
21
46
|
OPEN_ROUTER_API_KEY: SecretStr | None = Field(default=None)
|
|
22
47
|
|
|
23
48
|
VISION_MODEL: str = Field(default="google/gemini-3-flash-preview")
|
|
@@ -32,5 +57,29 @@ class MCPSettings(BaseSettings):
|
|
|
32
57
|
# Create cloud mobiles at https://platform.minitap.ai/cloud-mobiles
|
|
33
58
|
CLOUD_MOBILE_NAME: str | None = Field(default=None)
|
|
34
59
|
|
|
60
|
+
@model_validator(mode="after")
|
|
61
|
+
def derive_urls_from_base(self) -> "MCPSettings":
|
|
62
|
+
"""Derive MCP and DaaS URLs from base URL if not explicitly set.
|
|
63
|
+
|
|
64
|
+
This ensures that setting MINITAP_API_BASE_URL to a different environment
|
|
65
|
+
(e.g., dev) automatically updates all related URLs.
|
|
66
|
+
"""
|
|
67
|
+
if self.MINITAP_API_MCP_BASE_URL is None:
|
|
68
|
+
# Use object.__setattr__ to bypass Pydantic's frozen model protection
|
|
69
|
+
object.__setattr__(
|
|
70
|
+
self,
|
|
71
|
+
"MINITAP_API_MCP_BASE_URL",
|
|
72
|
+
_derive_mcp_url_from_base(self.MINITAP_API_BASE_URL),
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
if self.MINITAP_DAAS_API is None:
|
|
76
|
+
object.__setattr__(
|
|
77
|
+
self,
|
|
78
|
+
"MINITAP_DAAS_API",
|
|
79
|
+
_derive_daas_url_from_base(self.MINITAP_API_BASE_URL),
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
return self
|
|
83
|
+
|
|
35
84
|
|
|
36
85
|
settings = MCPSettings() # type: ignore
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: minitap-mcp
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: Model Context Protocol server for controlling Android & iOS devices with natural language
|
|
5
5
|
Author: Pierre-Louis Favreau, Jean-Pierre Lo, Clément Guiguet
|
|
6
6
|
Requires-Dist: fastmcp>=2.12.4
|
|
@@ -8,7 +8,7 @@ minitap/mcp/core/agents/compare_screenshots/eval/scenario_1_add_cartoon_img_and_
|
|
|
8
8
|
minitap/mcp/core/agents/compare_screenshots/eval/scenario_1_add_cartoon_img_and_move_button/prompt_1/output.md,sha256=Q0_5w9x5WAMqx6-I7KgjlS-tt7HnWKIunP43J7F0W_o,3703
|
|
9
9
|
minitap/mcp/core/agents/compare_screenshots/prompt.md,sha256=qAyqOroSJROgrvlbsLCtiwFyBKuIMCQ-720A5cwgwPY,3563
|
|
10
10
|
minitap/mcp/core/cloud_apk.py,sha256=Xeg1jrycm50UC72J4qVZ2NS9qs20oXKhvBcmBRs4rEA,3896
|
|
11
|
-
minitap/mcp/core/config.py,sha256=
|
|
11
|
+
minitap/mcp/core/config.py,sha256=aX4dGz-tZ88AVX6AeoBcEMUT-iVlabgtcwsCf47dSgY,3113
|
|
12
12
|
minitap/mcp/core/decorators.py,sha256=ipzR7kbMXacG91f6CliN-nl9unRTtjmANrfueaOXJ2s,3591
|
|
13
13
|
minitap/mcp/core/device.py,sha256=0AU8qGi26axC6toqHrPIzNeDbNDtll0YRwkspHouPmM,8198
|
|
14
14
|
minitap/mcp/core/llm.py,sha256=tI5m5rFDLeMkXE5WExnzYSzHU3nTIEiSC9nAsPzVMaU,1144
|
|
@@ -28,7 +28,7 @@ minitap/mcp/tools/read_swift_logs.py,sha256=Wc1XqQWWuNuPEIBioYD2geVd1p9Yq2USik6S
|
|
|
28
28
|
minitap/mcp/tools/screen_analyzer.md,sha256=TTO80JQWusbA9cKAZn-9cqhgVHm6F_qJh5w152hG3YM,734
|
|
29
29
|
minitap/mcp/tools/take_screenshot.py,sha256=gGySPSeVnx8lHiseGF_Wat82JLF-D8GuQIJ_hCaLZlQ,1730
|
|
30
30
|
minitap/mcp/tools/upload_screenshot.py,sha256=kwh8Q46LWF3nyKbKlvnlf-CtGrPkctXSnLyeebQGNFI,2959
|
|
31
|
-
minitap_mcp-0.
|
|
32
|
-
minitap_mcp-0.
|
|
33
|
-
minitap_mcp-0.
|
|
34
|
-
minitap_mcp-0.
|
|
31
|
+
minitap_mcp-0.8.1.dist-info/WHEEL,sha256=XV0cjMrO7zXhVAIyyc8aFf1VjZ33Fen4IiJk5zFlC3g,80
|
|
32
|
+
minitap_mcp-0.8.1.dist-info/entry_points.txt,sha256=rYVoXm7tSQCqQTtHx4Lovgn1YsjwtEEHfddKrfEVHuY,55
|
|
33
|
+
minitap_mcp-0.8.1.dist-info/METADATA,sha256=KTCif4x5DUhUq3yhquy4XzZ2N03qkiVUp-aOxC12GSs,10619
|
|
34
|
+
minitap_mcp-0.8.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|