@sealgate/android-adb-mcp 0.1.0 → 0.2.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0
4
+
5
+ - Moved from `@modelcontextprotocol/sdk` 1.x to MCP TS SDK 2.x
6
+ (`@modelcontextprotocol/server`). The server now speaks the 2026-07-28
7
+ protocol and still serves 2025-era clients that send `initialize`.
8
+ - Every tool's input schema now declares `additionalProperties: false`.
9
+ - Requires Node 20 or newer (`engines.node`).
10
+
3
11
  ## 0.1.0
4
12
 
5
13
  Initial release.
package/README.md CHANGED
@@ -32,7 +32,7 @@ adb passthrough, the gateway in front is what governs it.
32
32
  ```jsonc
33
33
  {
34
34
  "mcpServers": {
35
- "android-adb": {
35
+ "adb": {
36
36
  "command": "npx",
37
37
  "args": ["-y", "@sealgate/android-adb-mcp"]
38
38
  }
@@ -59,7 +59,7 @@ error listing the connected serials rather than guessing.
59
59
  `execute_adb_command` is effectively arbitrary `adb shell`: it can read app
60
60
  data, dump databases, and move files off the device. Behind SealGate it should
61
61
  be classified `SECRET` and gated. The catalog entry ships that classification;
62
- see `tools_configurations` in the marketplace `servers/android-adb-mcp.json`.
62
+ see `tools_configurations` in this server's `catalog-entry.json`.
63
63
 
64
64
  ## Development
65
65
 
package/dist/index.js CHANGED
@@ -15,12 +15,12 @@
15
15
  * e.g. `npx -y @sealgate/android-adb-mcp`. Pick a device on a multi-device host
16
16
  * with `--serial <serial>` or the `ANDROID_ADB_SERIAL` env var.
17
17
  */
18
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
19
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
18
+ import { McpServer } from '@modelcontextprotocol/server';
19
+ import { serveStdio } from '@modelcontextprotocol/server/stdio';
20
20
  import { z } from 'zod';
21
21
  import { parseActionIntents, parsePackages, parseUiLayout, resolveSerial, runAdb, runAdbBinary, tokenizeCommand, withSerial } from './adb.js';
22
22
  import { parseServerConfig } from './config.js';
23
- const VERSION = '0.1.0';
23
+ const VERSION = '0.2.0';
24
24
  /** A validated Android package name (also guards the dumpsys shell argument). */
25
25
  const PACKAGE_NAME = /^[A-Za-z0-9_][A-Za-z0-9_.]*$/;
26
26
  /** Where `uiautomator dump` writes on the device before we cat it back. */
@@ -51,7 +51,7 @@ function registerTools(server, resolve) {
51
51
  server.registerTool('get_packages', {
52
52
  title: 'List installed packages',
53
53
  description: 'List all packages installed on the connected Android device.',
54
- inputSchema: {}
54
+ inputSchema: z.object({}).meta({ additionalProperties: false })
55
55
  }, async () => {
56
56
  const serial = await resolve();
57
57
  const res = await runAdb(withSerial(serial, ['shell', 'pm', 'list', 'packages']));
@@ -65,12 +65,12 @@ function registerTools(server, resolve) {
65
65
  description: 'Run an arbitrary adb command against the connected device and return its output. ' +
66
66
  'The command is everything after `adb` (e.g. "shell ls /sdcard", "pm list packages", ' +
67
67
  '"logcat -d"). The target device is selected automatically.',
68
- inputSchema: {
68
+ inputSchema: z.object({
69
69
  command: z
70
70
  .string()
71
71
  .min(1)
72
72
  .describe('The adb command to run, without the leading `adb` (e.g. "shell ls /sdcard").')
73
- }
73
+ }).meta({ additionalProperties: false })
74
74
  }, async ({ command }) => {
75
75
  const args = tokenizeCommand(command);
76
76
  if (args.length === 0)
@@ -93,7 +93,7 @@ function registerTools(server, resolve) {
93
93
  title: 'Get UI layout',
94
94
  description: 'Dump the current screen UI hierarchy and return the clickable/labelled elements with ' +
95
95
  'their text, content description, class, bounds, and centre tap coordinates.',
96
- inputSchema: {}
96
+ inputSchema: z.object({}).meta({ additionalProperties: false })
97
97
  }, async () => {
98
98
  const serial = await resolve();
99
99
  const dump = await runAdb(withSerial(serial, ['shell', 'uiautomator', 'dump', UI_DUMP_PATH]));
@@ -111,7 +111,7 @@ function registerTools(server, resolve) {
111
111
  server.registerTool('get_screenshot', {
112
112
  title: 'Take a screenshot',
113
113
  description: 'Capture a PNG screenshot of the connected device screen.',
114
- inputSchema: {}
114
+ inputSchema: z.object({}).meta({ additionalProperties: false })
115
115
  }, async () => {
116
116
  const serial = await resolve();
117
117
  const res = await runAdbBinary(withSerial(serial, ['exec-out', 'screencap', '-p']));
@@ -128,12 +128,12 @@ function registerTools(server, resolve) {
128
128
  title: 'Get package action intents',
129
129
  description: 'List the non-data intent actions a package advertises in its Activity Resolver Table ' +
130
130
  '(useful for launching specific screens of an app).',
131
- inputSchema: {
131
+ inputSchema: z.object({
132
132
  package_name: z
133
133
  .string()
134
134
  .min(1)
135
135
  .describe('The package name to inspect, e.g. "com.android.settings".')
136
- }
136
+ }).meta({ additionalProperties: false })
137
137
  }, async ({ package_name }) => {
138
138
  if (!PACKAGE_NAME.test(package_name)) {
139
139
  return textResult(`Invalid package name: ${JSON.stringify(package_name)}`, true);
@@ -149,10 +149,16 @@ function registerTools(server, resolve) {
149
149
  }
150
150
  async function main() {
151
151
  const config = parseServerConfig(process.argv.slice(2));
152
- const server = new McpServer({ name: 'sealgate-android-adb', version: VERSION });
153
- registerTools(server, makeSerialResolver(config));
154
- const transport = new StdioServerTransport();
155
- await server.connect(transport);
152
+ const resolve = makeSerialResolver(config);
153
+ // serveStdio owns the era decision per connection: a 2026-07-28 opening
154
+ // (server/discover or a per-request envelope) and a 2025-era `initialize`
155
+ // handshake are both served from the same factory. The serial resolver is
156
+ // shared so its cache survives across the (single) pinned instance.
157
+ serveStdio(() => {
158
+ const server = new McpServer({ name: 'sealgate-android-adb', version: VERSION });
159
+ registerTools(server, resolve);
160
+ return server;
161
+ }, { onerror: (err) => process.stderr.write(`android-adb-mcp: ${err.message}\n`) });
156
162
  }
157
163
  main().catch((err) => {
158
164
  process.stderr.write(`fatal: ${err instanceof Error ? (err.stack ?? err.message) : String(err)}\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sealgate/android-adb-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "SealGate stdio MCP server that exposes Android Debug Bridge (adb) on the local machine: packages, UI layout, screenshots, action intents, and raw adb commands.",
5
5
  "keywords": [
6
6
  "mcp",
@@ -13,11 +13,11 @@
13
13
  ],
14
14
  "license": "MIT",
15
15
  "author": "SealGate",
16
- "homepage": "https://github.com/Edison-Watch/custom-mcps/tree/main/servers/android-adb",
16
+ "homepage": "https://github.com/Edison-Watch/custom-mcps/tree/main/servers/adb",
17
17
  "repository": {
18
18
  "type": "git",
19
19
  "url": "https://github.com/Edison-Watch/custom-mcps.git",
20
- "directory": "servers/android-adb"
20
+ "directory": "servers/adb"
21
21
  },
22
22
  "type": "module",
23
23
  "bin": {
@@ -29,7 +29,7 @@
29
29
  "CHANGELOG.md"
30
30
  ],
31
31
  "engines": {
32
- "node": ">=18"
32
+ "node": ">=20"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public"
@@ -41,12 +41,17 @@
41
41
  "prepublishOnly": "npm run build"
42
42
  },
43
43
  "dependencies": {
44
- "@modelcontextprotocol/sdk": "^1.19.1",
45
- "zod": "^4.3.6"
44
+ "@modelcontextprotocol/server": "^2.4.0",
45
+ "hono": "4.13.16",
46
+ "zod": "^4.6.7"
46
47
  },
47
48
  "devDependencies": {
49
+ "@modelcontextprotocol/client": "^2.4.0",
48
50
  "@types/node": "^22.10.0",
49
51
  "typescript": "^5.9.2",
50
52
  "vitest": "^4.0.18"
53
+ },
54
+ "overrides": {
55
+ "hono": "4.13.16"
51
56
  }
52
57
  }