@nbakka/mcp-appium 2.0.64 → 2.0.66

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.
Files changed (2) hide show
  1. package/lib/server.js +64 -1
  2. package/package.json +4 -2
package/lib/server.js CHANGED
@@ -17,6 +17,8 @@ const image_utils_1 = require("./image-utils");
17
17
  const { google } = require('googleapis');
18
18
  const axios = require('axios');
19
19
  const OpenAI = require("openai");
20
+ const express = require('express');
21
+ const open = require('open');
20
22
  const getAgentVersion = () => {
21
23
  const json = require("../package.json");
22
24
  return json.version;
@@ -30,7 +32,6 @@ const createMcpServer = () => {
30
32
  resources: {},
31
33
  tools: {},
32
34
  },
33
- timeout: 300000,
34
35
  });
35
36
 
36
37
  const tool = (name, description, paramsSchema, cb) => {
@@ -650,6 +651,68 @@ tool(
650
651
  }
651
652
  );
652
653
 
654
+ tool(
655
+ "review_testcases",
656
+ "Open JSON test cases in browser for manual approval",
657
+ {
658
+ testCases: zod_1.z.array(zod_1.z.object({
659
+ id: zod_1.z.string(),
660
+ title: zod_1.z.string(),
661
+ description: zod_1.z.string(),
662
+ })).describe("Array of test cases to review")
663
+ },
664
+ async ({ testCases }) => {
665
+ const express = require('express');
666
+ const open = require('open');
667
+
668
+ return new Promise((resolve, reject) => {
669
+ try {
670
+ const app = express();
671
+ const port = 3001;
672
+
673
+ // Serve a simple HTML page with test cases
674
+ app.get("/", (req, res) => {
675
+ let html = `
676
+ <html>
677
+ <head><title>Test Case Approval</title></head>
678
+ <body>
679
+ <h1>Review Test Cases</h1>
680
+ <ul>
681
+ `;
682
+
683
+ testCases.forEach(tc => {
684
+ html += `<li><strong>${tc.id} - ${tc.title}</strong><p>${tc.description}</p></li>`;
685
+ });
686
+
687
+ html += `
688
+ </ul>
689
+ <button onclick="fetch('/approve').then(()=>window.close())">Approve</button>
690
+ </body>
691
+ </html>
692
+ `;
693
+ res.send(html);
694
+ });
695
+
696
+ // Approval endpoint
697
+ app.get("/approve", (req, res) => {
698
+ res.send("Approved!");
699
+ server.close();
700
+ resolve("Approved by user");
701
+ });
702
+
703
+ const server = app.listen(port, async () => {
704
+ await open(`http://localhost:${port}`);
705
+ });
706
+
707
+ } catch (err) {
708
+ reject(`Error: ${err.message}`);
709
+ }
710
+ });
711
+ }
712
+ );
713
+
714
+
715
+
653
716
  return server;
654
717
  };
655
718
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nbakka/mcp-appium",
3
- "version": "2.0.64",
3
+ "version": "2.0.66",
4
4
  "description": "Appium MCP",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -23,7 +23,9 @@
23
23
  "googleapis": "^149.0.0",
24
24
  "zod-to-json-schema": "^3.24.4",
25
25
  "axios": "^1.6.0",
26
- "openai": "^5.20.0"
26
+ "openai": "^5.20.0",
27
+ "express": "5.1.0",
28
+ "open": "10.2.0"
27
29
  },
28
30
  "devDependencies": {
29
31
  "@eslint/eslintrc": "^3.2.0",