appium-mcp 1.86.12 → 1.87.0
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.
- package/CHANGELOG.md +32 -0
- package/README.md +1 -1
- package/dist/tools/interactions/screenshot.d.ts +1 -0
- package/dist/tools/interactions/screenshot.d.ts.map +1 -1
- package/dist/tools/interactions/screenshot.js +23 -1
- package/dist/tools/interactions/screenshot.js.map +1 -1
- package/package.json +2 -2
- package/server.json +2 -2
- package/src/tools/interactions/screenshot.ts +33 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [1.87.0](https://github.com/appium/appium-mcp/compare/v1.86.13...v1.87.0) (2026-07-02)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **screenshot:** add returnRawBase64 param to return inline image ([#440](https://github.com/appium/appium-mcp/issues/440)) ([91c7aa2](https://github.com/appium/appium-mcp/commit/91c7aa2dbc970d9f869316072a1c63bb59bd4e95))
|
|
6
|
+
|
|
7
|
+
## [1.86.13](https://github.com/appium/appium-mcp/compare/v1.86.12...v1.86.13) (2026-07-02)
|
|
8
|
+
|
|
9
|
+
### Miscellaneous Chores
|
|
10
|
+
|
|
11
|
+
* **deps:** bump appium-uiautomator2-driver from 7.6.2 to 8.0.0 ([#426](https://github.com/appium/appium-mcp/issues/426)) ([62e04d5](https://github.com/appium/appium-mcp/commit/62e04d5c5d3183fdf0be705b40720984e572faa4))
|
|
12
|
+
|
|
1
13
|
## [1.86.12](https://github.com/appium/appium-mcp/compare/v1.86.11...v1.86.12) (2026-07-02)
|
|
2
14
|
|
|
3
15
|
### Miscellaneous Chores
|
|
@@ -6,14 +18,34 @@
|
|
|
6
18
|
|
|
7
19
|
## [1.86.11](https://github.com/appium/appium-mcp/compare/v1.86.10...v1.86.11) (2026-07-01)
|
|
8
20
|
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* more escapes ([#433](https://github.com/appium/appium-mcp/issues/433)) ([f59cba1](https://github.com/appium/appium-mcp/commit/f59cba177484101ce0babc4bacd615de0987bdf9))
|
|
24
|
+
|
|
9
25
|
## [1.86.10](https://github.com/appium/appium-mcp/compare/v1.86.9...v1.86.10) (2026-07-01)
|
|
10
26
|
|
|
27
|
+
### Miscellaneous Chores
|
|
28
|
+
|
|
29
|
+
* **prepare-ios-simulator:** create wdaBaseUrl ([#432](https://github.com/appium/appium-mcp/issues/432)) ([6c0e578](https://github.com/appium/appium-mcp/commit/6c0e578bbaec8210c52e649df5241677a0d2e68f))
|
|
30
|
+
|
|
11
31
|
## [1.86.9](https://github.com/appium/appium-mcp/compare/v1.86.8...v1.86.9) (2026-06-30)
|
|
12
32
|
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* **session:** allow multiple sessions on simulator ([#430](https://github.com/appium/appium-mcp/issues/430)) ([aee9241](https://github.com/appium/appium-mcp/commit/aee92419351061245a3948c690f62a56036b8c9f))
|
|
36
|
+
|
|
13
37
|
## [1.86.8](https://github.com/appium/appium-mcp/compare/v1.86.7...v1.86.8) (2026-06-30)
|
|
14
38
|
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* allow SSE version to handle unique ports ([#429](https://github.com/appium/appium-mcp/issues/429)) ([5acb2d6](https://github.com/appium/appium-mcp/commit/5acb2d6826ec86cfb335e1d2794f1eba67a5ad4f))
|
|
42
|
+
|
|
15
43
|
## [1.86.7](https://github.com/appium/appium-mcp/compare/v1.86.6...v1.86.7) (2026-06-29)
|
|
16
44
|
|
|
45
|
+
### Bug Fixes
|
|
46
|
+
|
|
47
|
+
* remote no such element error code ([#424](https://github.com/appium/appium-mcp/issues/424)) ([51bf42c](https://github.com/appium/appium-mcp/commit/51bf42c056b8e9172a671421d5c36338b0d1eb52))
|
|
48
|
+
|
|
17
49
|
## [1.86.6](https://github.com/appium/appium-mcp/compare/v1.86.5...v1.86.6) (2026-06-29)
|
|
18
50
|
|
|
19
51
|
### Miscellaneous Chores
|
package/README.md
CHANGED
|
@@ -578,7 +578,7 @@ The default regex pattern allows any URL that starts with `http://` or `https://
|
|
|
578
578
|
|
|
579
579
|
| Tool | Description |
|
|
580
580
|
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
581
|
-
| `appium_screenshot` | Take a screenshot and save as PNG. Optionally provide `elementUUID` to capture a specific element.
|
|
581
|
+
| `appium_screenshot` | Take a screenshot and save as PNG. Optionally provide `elementUUID` to capture a specific element. Pass `returnRawBase64: true` (default `false`) to return the raw base64 PNG inline instead of saving to disk — useful when the server runs on a remote machine where the saved file is not accessible. Intended for manual use only; an LLM should keep this `false`. |
|
|
582
582
|
| `appium_get_window_size` | Get the width and height of the device screen in pixels |
|
|
583
583
|
| `appium_get_page_source` | Get the page source (XML) from the current screen |
|
|
584
584
|
| `appium_orientation` | Get or set device/screen orientation with `action` = `get` or `set` (requires `orientation` for set). |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../../src/tools/interactions/screenshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAUrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAQ5D,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAEhC,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,sBAAsB,CAAC;IAC1D,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChE,KAAK,EAAE,CACL,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAA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AAM,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,GAAG,CAAC,CA+Ef;AA8BD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAkBxD"}
|
|
@@ -16,7 +16,7 @@ const defaultDeps = {
|
|
|
16
16
|
dateNow: () => Date.now(),
|
|
17
17
|
};
|
|
18
18
|
export async function executeScreenshot(opts) {
|
|
19
|
-
const { deps = defaultDeps, elementId, maxWidth, sessionId } = opts;
|
|
19
|
+
const { deps = defaultDeps, elementId, maxWidth, returnRawBase64, sessionId, } = opts;
|
|
20
20
|
const driver = deps.getDriver(sessionId);
|
|
21
21
|
if (!driver) {
|
|
22
22
|
return noActiveDriverSessionResult(sessionId);
|
|
@@ -40,6 +40,19 @@ export async function executeScreenshot(opts) {
|
|
|
40
40
|
displayBase64 = screenshotBuffer.toString('base64');
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
// Return the raw base64 image without touching the disk. Useful when the
|
|
44
|
+
// server runs on a remote machine where the saved file is not reachable.
|
|
45
|
+
if (returnRawBase64) {
|
|
46
|
+
return {
|
|
47
|
+
content: [
|
|
48
|
+
{
|
|
49
|
+
type: 'image',
|
|
50
|
+
data: displayBase64,
|
|
51
|
+
mimeType: 'image/png',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
43
56
|
// Generate filename with timestamp
|
|
44
57
|
const timestamp = deps.dateNow();
|
|
45
58
|
const filename = `screenshot_${timestamp}.png`;
|
|
@@ -66,6 +79,14 @@ const screenshotSchema = z.object({
|
|
|
66
79
|
.number()
|
|
67
80
|
.optional()
|
|
68
81
|
.describe('Optional maximum width in pixels to resize the screenshot. The aspect ratio is preserved. Useful for reducing token usage when sending screenshots to LLMs.'),
|
|
82
|
+
returnRawBase64: z
|
|
83
|
+
.boolean()
|
|
84
|
+
.default(false)
|
|
85
|
+
.describe('When true, returns the raw base64-encoded PNG image instead of saving it to disk. ' +
|
|
86
|
+
'This should only be enabled when a human explicitly invokes the tool manually, ' +
|
|
87
|
+
'typically to view the screenshot on a different machine (e.g. when the server runs ' +
|
|
88
|
+
'on a remote machine and the saved file is not accessible). ' +
|
|
89
|
+
'An LLM must always keep this false and rely on the saved file path.'),
|
|
69
90
|
sessionId: z
|
|
70
91
|
.string()
|
|
71
92
|
.optional()
|
|
@@ -83,6 +104,7 @@ export default function screenshot(server) {
|
|
|
83
104
|
execute: async (args, _context) => executeScreenshot({
|
|
84
105
|
elementId: args.elementUUID,
|
|
85
106
|
maxWidth: args.maxWidth,
|
|
107
|
+
returnRawBase64: args.returnRawBase64,
|
|
86
108
|
sessionId: args.sessionId,
|
|
87
109
|
}),
|
|
88
110
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../../src/tools/interactions/screenshot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACL,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAahC,MAAM,WAAW,GAAmB;IAClC,SAAS;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CAAC;SACd,QAAQ,CACP,oFAAoF;QAClF,iFAAiF;QACjF,qFAAqF;QACrF,6DAA6D;QAC7D,qEAAqE,CACxE;IACH,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,4DAA4D,CAAC;CAC1E,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAe;IAChD,MAAM,CAAC,OAAO,CAAC;QACb,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACT,iGAAiG;QACnG,UAAU,EAAE,gBAAgB;QAC5B,WAAW,EAAE;YACX,YAAY,EAAE,KAAK;YACnB,aAAa,EAAE,KAAK;SACrB;QACD,OAAO,EAAE,KAAK,EAAE,IAAsC,EAAE,QAAa,EAAE,EAAE,CACvE,iBAAiB,CAAC;YAChB,SAAS,EAAE,IAAI,CAAC,WAAW;YAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC;KACL,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium-mcp",
|
|
3
3
|
"mcpName": "io.github.appium/appium-mcp",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.87.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@xmldom/xmldom": "^0.9.8",
|
|
63
63
|
"appium-adb": "^15.0.0",
|
|
64
64
|
"appium-ios-device": "^3.1.0",
|
|
65
|
-
"appium-uiautomator2-driver": "^
|
|
65
|
+
"appium-uiautomator2-driver": "^8.0.0",
|
|
66
66
|
"appium-webdriveragent": "^12.1.1",
|
|
67
67
|
"appium-xcuitest-driver": "^11.0.0",
|
|
68
68
|
"applesign": "^5.0.0",
|
package/server.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"name": "io.github.appium/appium-mcp",
|
|
4
4
|
"title": "MCP Appium - Mobile Development and Automation Server",
|
|
5
5
|
"description": "MCP server for Appium mobile automation on iOS and Android devices with test creation tools.",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.87.0",
|
|
7
7
|
"packages": [
|
|
8
8
|
{
|
|
9
9
|
"registryType": "npm",
|
|
10
10
|
"identifier": "appium-mcp",
|
|
11
|
-
"version": "1.
|
|
11
|
+
"version": "1.87.0",
|
|
12
12
|
"transport": {
|
|
13
13
|
"type": "stdio"
|
|
14
14
|
}
|
|
@@ -44,9 +44,16 @@ export async function executeScreenshot(opts: {
|
|
|
44
44
|
deps?: ScreenshotDeps;
|
|
45
45
|
elementId?: string;
|
|
46
46
|
maxWidth?: number;
|
|
47
|
+
returnRawBase64?: boolean;
|
|
47
48
|
sessionId?: string;
|
|
48
49
|
}): Promise<any> {
|
|
49
|
-
const {
|
|
50
|
+
const {
|
|
51
|
+
deps = defaultDeps,
|
|
52
|
+
elementId,
|
|
53
|
+
maxWidth,
|
|
54
|
+
returnRawBase64,
|
|
55
|
+
sessionId,
|
|
56
|
+
} = opts;
|
|
50
57
|
|
|
51
58
|
const driver = deps.getDriver(sessionId);
|
|
52
59
|
if (!driver) {
|
|
@@ -75,6 +82,20 @@ export async function executeScreenshot(opts: {
|
|
|
75
82
|
}
|
|
76
83
|
}
|
|
77
84
|
|
|
85
|
+
// Return the raw base64 image without touching the disk. Useful when the
|
|
86
|
+
// server runs on a remote machine where the saved file is not reachable.
|
|
87
|
+
if (returnRawBase64) {
|
|
88
|
+
return {
|
|
89
|
+
content: [
|
|
90
|
+
{
|
|
91
|
+
type: 'image',
|
|
92
|
+
data: displayBase64,
|
|
93
|
+
mimeType: 'image/png',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
78
99
|
// Generate filename with timestamp
|
|
79
100
|
const timestamp = deps.dateNow();
|
|
80
101
|
const filename = `screenshot_${timestamp}.png`;
|
|
@@ -118,6 +139,16 @@ const screenshotSchema = z.object({
|
|
|
118
139
|
.describe(
|
|
119
140
|
'Optional maximum width in pixels to resize the screenshot. The aspect ratio is preserved. Useful for reducing token usage when sending screenshots to LLMs.'
|
|
120
141
|
),
|
|
142
|
+
returnRawBase64: z
|
|
143
|
+
.boolean()
|
|
144
|
+
.default(false)
|
|
145
|
+
.describe(
|
|
146
|
+
'When true, returns the raw base64-encoded PNG image instead of saving it to disk. ' +
|
|
147
|
+
'This should only be enabled when a human explicitly invokes the tool manually, ' +
|
|
148
|
+
'typically to view the screenshot on a different machine (e.g. when the server runs ' +
|
|
149
|
+
'on a remote machine and the saved file is not accessible). ' +
|
|
150
|
+
'An LLM must always keep this false and rely on the saved file path.'
|
|
151
|
+
),
|
|
121
152
|
sessionId: z
|
|
122
153
|
.string()
|
|
123
154
|
.optional()
|
|
@@ -138,6 +169,7 @@ export default function screenshot(server: FastMCP): void {
|
|
|
138
169
|
executeScreenshot({
|
|
139
170
|
elementId: args.elementUUID,
|
|
140
171
|
maxWidth: args.maxWidth,
|
|
172
|
+
returnRawBase64: args.returnRawBase64,
|
|
141
173
|
sessionId: args.sessionId,
|
|
142
174
|
}),
|
|
143
175
|
});
|