Skip to content

MCP tools

This page is the reference entry point for Jugg MCP tool names, input and output conventions, and public availability. Use the capability pages when choosing a workflow; use this page when confirming an exact tool contract.

Authoritative runtime source: MCP tools/list.

Service information

ItemValue
Port range12320..12329
HTTP path/jugg-mcp
ProtocolJSON-RPC 2.0
Supported request headerMCP-Protocol-Version, supporting 2025-06-18 and 2025-11-25

Return structure

The structuredContent returned by tools/call always contains the following fields:

json
{
  "status": "OK|ERROR",
  "message": "string",
  "data": {},
  "artifacts": [],
  "errorCode": "string|null"
}

Compilation tools may return isFinal=false and a jobId. In that case, continue calling get-compile-status until the task reaches a final state.

Public tools

There are currently 18 registered public MCP tools.

ToolMain parametersPurpose
versionNoneReturns the Jugg plugin version.
list-projectsNoneLists projects initialized in the current IDE.
restartprojectDir, waitAppReadyAfterSuccessRestarts the target app.
compileprojectDirCompiles without deployment.
deployprojectDir, alwaysRestartApp, waitAppReadyAfterSuccessCompiles and deploys.
clean-reinstallprojectDir, waitAppReadyAfterSuccessClears app data and reinstalls the APK.
gradle-buildprojectDir, waitAppReadyAfterSuccessForces a Gradle build, followed by the installation and launch flow.
instrumentprojectDir, sourcePath, class, method, runner, extrasRuns tests from an androidTest source file anchor.
get-compile-statusprojectDir, jobId, waitTimeoutMsQueries the status of an asynchronous compilation task.
ssh-infoprojectDir, reason, requestedByRequests remote SSH troubleshooting information.
devicesprojectDirLists devices and marks the selected device.
layout-dumpprojectDir, rootLayout, includeGone, allWindowsExports the UI hierarchy as HTML.
view-locateprojectDir, targetFinds the location of a UI element.
view-inspectprojectDir, target, expressionsReads read-only View properties through reflection, including getters, Kotlin properties, and public fields.
activity-stackprojectDirReads the Activity stack.
tapprojectDir, coordinate/percentage/element selectorPerforms a tap, long-press, or swipe.
statusprojectDir, refreshChangesQueries deployment status and a summary of uncompiled files.
wait-logsprojectDir, marker, tags, timeoutMsWaits for an app log marker, crash, or timeout.

version and list-projects do not require projectDir. All other tools require an absolute project path.

Asynchronous behavior of compilation tools

deploy, gradle-build, and instrument may first return a running state:

json
{
  "data": {
    "isFinal": false,
    "jobId": "..."
  }
}

The client should call get-compile-status with:

json
{
  "projectDir": "/path/to/project",
  "jobId": "...",
  "waitTimeoutMs": 5000
}

Continue until data.status is success, failed, canceled, or unknown. The final state returns isCompileSuccess and isDeploySuccess. Failures may also include detail, detailLength, and detailTruncated.

UI tool behavior

ToolKey boundaries
layout-dumpOutputs an HTML artifact. The internal JSON is not part of the public contract.
view-locateCoordinates and dimensions use dp. When multiple elements match, the first result is not a safe click target.
view-inspectAllows only read-only expressions. An explicit foo() uses the getter/query allowlist. A name without parentheses reads a public field first, then resolves getXxx() / isXxx().
tapMode priority is coordinate > percent > element. It does not act when multiple elements match.
activity-stackConfirms the foreground Activity and page stability.

ViewHierarchy tools wait for the app to be online before running. A screen that is off or locked returns DEVICE_NOT_INTERACTIVE. If the target app is not in the foreground, they return APP_NOT_FOREGROUND.

Common error codes

Error codeMeaning
INVALID_JSON_RPCInvalid JSON-RPC format.
METHOD_NOT_SUPPORTEDUnsupported method.
TOOL_NOT_FOUNDTool is not registered.
INVALID_PARAMSInvalid parameters.
INVALID_REGEXInvalid log marker regular expression.
PROJECT_NOT_INITIALIZEDThe project has not completed Jugg initialization. The error message includes the requested path and the currently initialized projects.
NO_DEPLOY_BASELINENo deployment or full build baseline.
NO_DEVICENo available device.
DEVICE_NOT_INTERACTIVEThe device screen is off or the device is not interactive.
APP_NOT_FOREGROUNDThe target app is not in the foreground.
INTERNAL_ERRORInternal error.

Non-public actions

Actions that exist in the code but are not registered cannot be called by external MCP clients. These include screenshot, record, start activity, start app, emulator, and layout verify actions. Use tools/list and the public tools table on this page to determine whether a tool is public.