fix(mcp): auto-register tools on startup and support cross-platform setup for all major AI IDEs

- Fix missing mcp_server.tools import on server initialization so mobile_run_task, mobile_manage_task, mobile_get_device_state, and mobile_inspect_trace are automatically registered.

- Inject PYTHONPATH in generated and installed MCP configurations to guarantee Python module resolution across Windows, macOS, and Linux regardless of IDE CWD.

- Expand artemis mcp --install and --generate-config to support VS Code, Cline, Roo Code, Claude Code CLI (~/.claude.json), Cursor, Windsurf, Antigravity, and OpenClaw.

- Enhance config file merging with robust exception handling and fallback initialization.
This commit is contained in:
somew1nd committed 2026-08-18 17:49:47 -07:00
1 parent fc6ddad655
commit 9e5aee85c8
12 files changed
+202 -67

No files matched your search

+4 -4
View File
@@ -62,7 +62,7 @@ The included [`rules.md`](./rules.md) file contains the **Mobile Testing Mindset
python -m mcp_server
# Or via Artemis CLI
artemis mcp
uv run artemis mcp
```
### IDE Configuration
@@ -70,10 +70,10 @@ artemis mcp
#### One-Click Auto Install (Recommended)
Run the automated installer to detect and configure your IDE (Antigravity, Cursor, Claude Code/Desktop, OpenClaw):
```bash
artemis mcp --install all
uv run artemis mcp --install all
# Or install specifically for Antigravity:
artemis mcp --install antigravity
uv run artemis mcp --install antigravity
```
#### Manual JSON Config Generation
Run `artemis mcp --generate-config antigravity` (or `all`) to output ready-to-use configuration JSON with resolved `.venv` Python and project paths.
Run `uv run artemis mcp --generate-config antigravity` (or `all`) to output ready-to-use configuration JSON with resolved `.venv` Python and project paths.
+1
View File
@@ -16,5 +16,6 @@
from mcp_server.base import mcp
from mcp_server.server import main
import mcp_server.tools # noqa: F401
__all__ = ["mcp", "main"]
+10
View File
@@ -16,6 +16,13 @@
from mcp.server.fastmcp import FastMCP
try:
from mcp.server.fastmcp.server import Settings as FastMCPSettings
FastMCPSettings.model_rebuild()
except Exception:
pass
# Define the shared FastMCP instance for external IDE and agent clients.
mcp = FastMCP(
"artemis",
@@ -27,3 +34,6 @@ mcp = FastMCP(
"and mobile_inspect_trace to inspect detailed execution steps and visual action overlays."
),
)
# Import tools so they are registered with the mcp instance upon module load
import mcp_server.tools # noqa: E402, F401
+1
View File
@@ -55,6 +55,7 @@ except Exception:
from mcp_server.base import mcp
# 2. Import tools to register them
import mcp_server.tools # noqa: F401
def main(transport: str = "stdio", host: str = "127.0.0.1", port: int = 8001):