Files
chenmingxuan fac4ccb760 feat: prepare 2.2.0 with UI and execution fixes
Add dark theme, richer Markdown and readable plugin results.
Improve Android input evidence, response integrity and diagnostics.
Unify lifecycle, guidance receipts and evidence sources across clients.
Keep direct action dispatch without an added AI quota approval layer.
Align version metadata at 2.2.0 and bundle Helper 1.2.2.

Validation: 3063 backend tests before the version bump; 44 after.
Frontend: 317 tests and production build passed.
2026-10-26 00:44:13 +08:00

57 lines
2.9 KiB
Python

# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Shared FastMCP instance definition for the mobile automation MCP server."""
import logging
from artemis.mcp.tool_server import ArtemisFastMCP
logger = logging.getLogger(__name__)
try:
from mcp.server.fastmcp.server import Settings as FastMCPSettings
FastMCPSettings.model_rebuild()
except Exception as exc:
# Version-compat shim: older/newer FastMCP releases may not expose
# Settings or need the rebuild; the server works without it.
logger.debug("FastMCP Settings.model_rebuild skipped: %s", exc, exc_info=True)
# Define the shared FastMCP instance for external IDE and agent clients.
mcp = ArtemisFastMCP(
"artemis",
strict_inputs=True,
instructions=(
"ARTEMIS executes Android, computer and mixed tests with Flash, Pro or interactive exploration. The user starts the service; MCP only connects. Use the official artemis-use Skill for workflows and plugin development. "
"For the full workflow use mobile_workspace (devices/queue), mobile_config (non-secret saved defaults), "
"mobile_task_file (XLSX template/preview), mobile_batch (JSON cases + execution), "
"mobile_search_history and mobile_export_report (Word/Excel/ZIP). "
"For interactive test design use mobile_exploration: one conversation, user guidance, "
"recorded demonstrations, resumable active-time limits and versioned cases for Flash/Pro. "
"Task action replay is unavailable; trace inspection is read-only. "
"Use mobile_run_task to launch autonomous UI workflows on connected Android devices or emulators, "
"mobile_manage_task to check status or steer execution, "
"mobile_get_device_state to inspect real-time device screen/hierarchy, "
"mobile_inspect_trace for bounded report/usage/request/log/evidence inspection and step screenshots; use stable request_id for task submission and lookup uncertain replies, "
"and mobile_diagnose whenever a tool errors, no device is found, or the user says "
"ARTEMIS is not working: it checks the environment and returns ordered fix steps."
),
)
# Tool registration is intentionally NOT done here: mcp_server/__init__.py
# imports mcp_server.tools (which imports this module), so importing this
# module from anywhere already registers every tool. Importing tools here as
# well would create a circular import (base -> tools -> base).