mobile-device-mcp 0.2.1 → 0.2.2
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/LICENSE +83 -0
- package/dist/license.d.ts +25 -0
- package/dist/license.d.ts.map +1 -0
- package/dist/license.js +68 -0
- package/dist/license.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +6 -2
- package/dist/server.js.map +1 -1
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +36 -3
- package/dist/tools/index.js.map +1 -1
- package/package.json +2 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Parameters
|
|
4
|
+
|
|
5
|
+
Licensor: Saransh Bamania
|
|
6
|
+
Licensed Work: mobile-device-mcp v0.2.1
|
|
7
|
+
The Licensed Work is (c) 2026 Saransh Bamania.
|
|
8
|
+
Additional Use Grant: You may make production use of the Licensed Work,
|
|
9
|
+
provided your use does not include offering the
|
|
10
|
+
Licensed Work to third parties as a commercial
|
|
11
|
+
product or service, or using it as part of a
|
|
12
|
+
paid device testing or automation platform.
|
|
13
|
+
Individual and non-commercial use is always permitted.
|
|
14
|
+
Change Date: 2030-03-23
|
|
15
|
+
Change License: Apache License, Version 2.0
|
|
16
|
+
|
|
17
|
+
-----------------------------------------------------------------------------
|
|
18
|
+
|
|
19
|
+
Business Source License 1.1
|
|
20
|
+
|
|
21
|
+
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
22
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
23
|
+
|
|
24
|
+
Terms
|
|
25
|
+
|
|
26
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
27
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
28
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
29
|
+
production use.
|
|
30
|
+
|
|
31
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
32
|
+
available distribution of a specific version of the Licensed Work under this
|
|
33
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
34
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
35
|
+
above terminate.
|
|
36
|
+
|
|
37
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
38
|
+
currently in effect as described in this License, you must purchase a
|
|
39
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
40
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
41
|
+
|
|
42
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
43
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
44
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
45
|
+
for each version of the Licensed Work released by Licensor.
|
|
46
|
+
|
|
47
|
+
You must conspicuously display this License on each original or modified copy
|
|
48
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
49
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
50
|
+
License apply to your use of that work.
|
|
51
|
+
|
|
52
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
53
|
+
terminate your rights under this License for the current and all other
|
|
54
|
+
versions of the Licensed Work.
|
|
55
|
+
|
|
56
|
+
This License does not grant you any right in any trademark or logo of
|
|
57
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
58
|
+
Licensor as expressly required by this License).
|
|
59
|
+
|
|
60
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
61
|
+
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
62
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
63
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
64
|
+
TITLE.
|
|
65
|
+
|
|
66
|
+
MariaDB hereby grants you permission to use this License's text to license
|
|
67
|
+
your works, and to refer to it using the trademark "Business Source License",
|
|
68
|
+
as long as you comply with the Covenants of Licensor below.
|
|
69
|
+
|
|
70
|
+
Covenants of Licensor
|
|
71
|
+
|
|
72
|
+
In consideration of the right to use this License's text and the "Business
|
|
73
|
+
Source License" name and trademark, Licensor covenants to MariaDB, and to all
|
|
74
|
+
other recipients of the licensed work to be provided under this License:
|
|
75
|
+
|
|
76
|
+
1. To specify as the Change License the Apache License, Version 2.0, which
|
|
77
|
+
is a license compatible with GPL Version 2.0 or later.
|
|
78
|
+
|
|
79
|
+
2. To specify as the Additional Use Grant the text set forth above.
|
|
80
|
+
|
|
81
|
+
3. To specify a Change Date.
|
|
82
|
+
|
|
83
|
+
4. Not to modify this License in any other way.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type LicenseTier = "free" | "pro";
|
|
2
|
+
export interface LicenseInfo {
|
|
3
|
+
tier: LicenseTier;
|
|
4
|
+
valid: boolean;
|
|
5
|
+
}
|
|
6
|
+
/** Tools included in the free tier */
|
|
7
|
+
export declare const FREE_TOOLS: Set<string>;
|
|
8
|
+
/** Upgrade message shown when a free user calls a pro tool */
|
|
9
|
+
export declare const PRO_UPGRADE_MESSAGE: {
|
|
10
|
+
content: {
|
|
11
|
+
type: "text";
|
|
12
|
+
text: string;
|
|
13
|
+
}[];
|
|
14
|
+
isError: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Validate the license key.
|
|
18
|
+
*
|
|
19
|
+
* Current implementation: presence check.
|
|
20
|
+
* Future: integrate with Keygen.sh or xPay for real validation.
|
|
21
|
+
*/
|
|
22
|
+
export declare function validateLicense(): LicenseInfo;
|
|
23
|
+
/** Log the license tier on startup */
|
|
24
|
+
export declare function logLicenseStatus(info: LicenseInfo): void;
|
|
25
|
+
//# sourceMappingURL=license.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../src/license.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,KAAK,CAAC;AAEzC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,sCAAsC;AACtC,eAAO,MAAM,UAAU,aAoBrB,CAAC;AAEH,8DAA8D;AAC9D,eAAO,MAAM,mBAAmB;;;;;;CAe/B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,WAAW,CAU7C;AAED,sCAAsC;AACtC,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAMxD"}
|
package/dist/license.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// License key validation and tier management
|
|
3
|
+
// ============================================================
|
|
4
|
+
const PREFIX = "[mobile-device-mcp]";
|
|
5
|
+
/** Tools included in the free tier */
|
|
6
|
+
export const FREE_TOOLS = new Set([
|
|
7
|
+
// Device info (3)
|
|
8
|
+
"list_devices",
|
|
9
|
+
"get_device_info",
|
|
10
|
+
"get_screen_size",
|
|
11
|
+
// Screenshots & UI tree (2)
|
|
12
|
+
"take_screenshot",
|
|
13
|
+
"get_ui_elements",
|
|
14
|
+
// Basic interaction (6)
|
|
15
|
+
"tap",
|
|
16
|
+
"double_tap",
|
|
17
|
+
"long_press",
|
|
18
|
+
"swipe",
|
|
19
|
+
"type_text",
|
|
20
|
+
"press_key",
|
|
21
|
+
// Basic app management (2)
|
|
22
|
+
"list_apps",
|
|
23
|
+
"get_current_app",
|
|
24
|
+
// Logs (1)
|
|
25
|
+
"get_logs",
|
|
26
|
+
]);
|
|
27
|
+
/** Upgrade message shown when a free user calls a pro tool */
|
|
28
|
+
export const PRO_UPGRADE_MESSAGE = {
|
|
29
|
+
content: [
|
|
30
|
+
{
|
|
31
|
+
type: "text",
|
|
32
|
+
text: [
|
|
33
|
+
"This is a Pro feature. Upgrade to unlock all 49 tools including AI vision, Flutter inspection, test generation, and more.",
|
|
34
|
+
"",
|
|
35
|
+
"Get your license key at: https://github.com/saranshbamania/mobile-device-mcp#pro",
|
|
36
|
+
"",
|
|
37
|
+
"Then add to your .mcp.json:",
|
|
38
|
+
' "MOBILE_MCP_LICENSE_KEY": "your-key-here"',
|
|
39
|
+
].join("\n"),
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
isError: true,
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Validate the license key.
|
|
46
|
+
*
|
|
47
|
+
* Current implementation: presence check.
|
|
48
|
+
* Future: integrate with Keygen.sh or xPay for real validation.
|
|
49
|
+
*/
|
|
50
|
+
export function validateLicense() {
|
|
51
|
+
const key = process.env.MOBILE_MCP_LICENSE_KEY;
|
|
52
|
+
if (!key || key.trim() === "") {
|
|
53
|
+
return { tier: "free", valid: true };
|
|
54
|
+
}
|
|
55
|
+
// TODO: Replace with Keygen.sh API validation when payment is set up
|
|
56
|
+
// For now, any non-empty key is treated as valid pro license
|
|
57
|
+
return { tier: "pro", valid: true };
|
|
58
|
+
}
|
|
59
|
+
/** Log the license tier on startup */
|
|
60
|
+
export function logLicenseStatus(info) {
|
|
61
|
+
if (info.tier === "pro") {
|
|
62
|
+
process.stderr.write(`${PREFIX} License: Pro (all 49 tools enabled)\n`);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
process.stderr.write(`${PREFIX} License: Free (14 tools — upgrade to Pro for all 49)\n`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=license.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"license.js","sourceRoot":"","sources":["../src/license.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,6CAA6C;AAC7C,+DAA+D;AAE/D,MAAM,MAAM,GAAG,qBAAqB,CAAC;AASrC,sCAAsC;AACtC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;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C"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAa/C;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG;IAClD,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAwCA"}
|
package/dist/server.js
CHANGED
|
@@ -10,8 +10,9 @@ import { registerAllTools } from "./tools/index.js";
|
|
|
10
10
|
import { AIClient } from "./ai/client.js";
|
|
11
11
|
import { ScreenAnalyzer } from "./ai/analyzer.js";
|
|
12
12
|
import { ActionRecorder } from "./recording/recorder.js";
|
|
13
|
+
import { validateLicense, logLicenseStatus } from "./license.js";
|
|
13
14
|
/** Server version — matches package.json */
|
|
14
|
-
const SERVER_VERSION = "0.1
|
|
15
|
+
const SERVER_VERSION = "0.2.1";
|
|
15
16
|
/**
|
|
16
17
|
* Create a configured MCP server ready to start.
|
|
17
18
|
*
|
|
@@ -41,7 +42,10 @@ export function createServer(config) {
|
|
|
41
42
|
}, flutterDriver);
|
|
42
43
|
}
|
|
43
44
|
const recorder = new ActionRecorder();
|
|
44
|
-
|
|
45
|
+
// Validate license and gate pro tools
|
|
46
|
+
const license = validateLicense();
|
|
47
|
+
logLicenseStatus(license);
|
|
48
|
+
registerAllTools(server, () => driver, () => analyzer, () => flutterDriver, () => driver, () => recorder, () => iosDriver, license);
|
|
45
49
|
async function start() {
|
|
46
50
|
const transport = new StdioServerTransport();
|
|
47
51
|
await server.connect(transport);
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,uDAAuD;AACvD,+DAA+D;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,uDAAuD;AACvD,+DAA+D;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC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C,CAAC;IAE1B,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAEpI,KAAK,UAAU,KAAK;QAClB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import type { ScreenAnalyzer } from "../ai/analyzer.js";
|
|
|
14
14
|
import type { FlutterDriver } from "../drivers/flutter/index.js";
|
|
15
15
|
import type { ActionRecorder } from "../recording/recorder.js";
|
|
16
16
|
import type { IOSSimulatorDriver } from "../drivers/ios/index.js";
|
|
17
|
+
import type { LicenseInfo } from "../license.js";
|
|
17
18
|
export { registerDeviceTools, registerScreenTools, registerInteractionTools, registerAppTools, registerLogTools, registerFlutterTools, registerVideoTools, registerRecordingTools, registerIOSTools, };
|
|
18
19
|
/**
|
|
19
20
|
* Register every MCP tool with the server.
|
|
@@ -26,5 +27,5 @@ export { registerDeviceTools, registerScreenTools, registerInteractionTools, reg
|
|
|
26
27
|
* if AI features are disabled.
|
|
27
28
|
* @param getFlutter — A factory/getter that returns the FlutterDriver.
|
|
28
29
|
*/
|
|
29
|
-
export declare function registerAllTools(server: McpServer, getDriver: () => DeviceDriver, getAnalyzer: () => ScreenAnalyzer | null, getFlutter: () => FlutterDriver, getAndroidDriver?: () => AndroidDriver, getRecorder?: () => ActionRecorder, getIOSDriver?: () => IOSSimulatorDriver | null): void;
|
|
30
|
+
export declare function registerAllTools(server: McpServer, getDriver: () => DeviceDriver, getAnalyzer: () => ScreenAnalyzer | null, getFlutter: () => FlutterDriver, getAndroidDriver?: () => AndroidDriver, getRecorder?: () => ActionRecorder, getIOSDriver?: () => IOSSimulatorDriver | null, license?: LicenseInfo): void;
|
|
30
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB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C;AAgFF;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,MAAM,YAAY,EAC7B,WAAW,EAAE,MAAM,cAAc,GAAG,IAAI,EACxC,UAAU,EAAE,MAAM,aAAa,EAC/B,gBAAgB,CAAC,EAAE,MAAM,aAAa,EACtC,WAAW,CAAC,EAAE,MAAM,cAAc,EAClC,YAAY,CAAC,EAAE,MAAM,kBAAkB,GAAG,IAAI,EAC9C,OAAO,CAAC,EAAE,WAAW,GACpB,IAAI,CAyBN"}
|
package/dist/tools/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { registerFlutterTools } from "./flutter-tools.js";
|
|
|
12
12
|
import { registerVideoTools } from "./video-tools.js";
|
|
13
13
|
import { registerRecordingTools } from "./recording-tools.js";
|
|
14
14
|
import { registerIOSTools } from "./ios-tools.js";
|
|
15
|
+
import { FREE_TOOLS, PRO_UPGRADE_MESSAGE } from "../license.js";
|
|
15
16
|
export { registerDeviceTools, registerScreenTools, registerInteractionTools, registerAppTools, registerLogTools, registerFlutterTools, registerVideoTools, registerRecordingTools, registerIOSTools, };
|
|
16
17
|
// Tools that are part of the recording system itself — don't record these
|
|
17
18
|
const RECORDING_TOOLS = new Set([
|
|
@@ -19,6 +20,34 @@ const RECORDING_TOOLS = new Set([
|
|
|
19
20
|
"stop_test_recording",
|
|
20
21
|
"get_recorded_actions",
|
|
21
22
|
]);
|
|
23
|
+
/**
|
|
24
|
+
* Create a proxy that intercepts registerTool calls for pro tools.
|
|
25
|
+
* If the user is on the free tier, pro tools are still registered
|
|
26
|
+
* (so they appear in the tool list) but return an upgrade message.
|
|
27
|
+
*/
|
|
28
|
+
function createLicenseProxy(server) {
|
|
29
|
+
const originalRegisterTool = server.registerTool.bind(server);
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
+
server.registerTool = (name, config, cb) => {
|
|
32
|
+
if (FREE_TOOLS.has(name)) {
|
|
33
|
+
return originalRegisterTool(name, config, cb);
|
|
34
|
+
}
|
|
35
|
+
// Pro tool on free tier: register it with [PRO] tag but gate the handler
|
|
36
|
+
const proConfig = {
|
|
37
|
+
...config,
|
|
38
|
+
title: config.title ? `${config.title} [Pro]` : undefined,
|
|
39
|
+
description: config.description
|
|
40
|
+
? `[Pro] ${config.description}`
|
|
41
|
+
: undefined,
|
|
42
|
+
};
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
|
+
const gatedCb = async (..._args) => {
|
|
45
|
+
return PRO_UPGRADE_MESSAGE;
|
|
46
|
+
};
|
|
47
|
+
return originalRegisterTool(name, proConfig, gatedCb);
|
|
48
|
+
};
|
|
49
|
+
return server;
|
|
50
|
+
}
|
|
22
51
|
/**
|
|
23
52
|
* Create a proxy around McpServer that intercepts registerTool calls
|
|
24
53
|
* to auto-record tool invocations when the ActionRecorder is active.
|
|
@@ -61,9 +90,13 @@ function createRecordingProxy(server, getRecorder) {
|
|
|
61
90
|
* if AI features are disabled.
|
|
62
91
|
* @param getFlutter — A factory/getter that returns the FlutterDriver.
|
|
63
92
|
*/
|
|
64
|
-
export function registerAllTools(server, getDriver, getAnalyzer, getFlutter, getAndroidDriver, getRecorder, getIOSDriver) {
|
|
65
|
-
// Wrap server with
|
|
66
|
-
|
|
93
|
+
export function registerAllTools(server, getDriver, getAnalyzer, getFlutter, getAndroidDriver, getRecorder, getIOSDriver, license) {
|
|
94
|
+
// Wrap server with license gating proxy if on free tier
|
|
95
|
+
let registrationServer = license && license.tier === "free"
|
|
96
|
+
? createLicenseProxy(server)
|
|
97
|
+
: server;
|
|
98
|
+
// Wrap with recording proxy if recorder is available
|
|
99
|
+
registrationServer = getRecorder ? createRecordingProxy(registrationServer, getRecorder) : registrationServer;
|
|
67
100
|
registerDeviceTools(registrationServer, getDriver);
|
|
68
101
|
registerScreenTools(registrationServer, getDriver);
|
|
69
102
|
registerInteractionTools(registrationServer, getDriver);
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,0DAA0D;AAC1D,mDAAmD;AACnD,+DAA+D;AAM/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,0DAA0D;AAC1D,mDAAmD;AACnD,+DAA+D;AAM/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kB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BAAsB,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;IAC1D,CAAC;IACD,IAAI,YAAY,EAAE,CAAC;QACjB,gBAAgB,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobile-device-mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "MCP server that gives AI coding assistants (Claude, Cursor, Windsurf) the ability to see and interact with Android mobile devices via ADB — AI-powered visual inspection, element finding, and device automation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"screen-analysis",
|
|
70
70
|
"ui-automation"
|
|
71
71
|
],
|
|
72
|
-
"license": "
|
|
72
|
+
"license": "BUSL-1.1"
|
|
73
73
|
}
|