@nbakka/mcp-appium 2.0.63 → 2.0.65

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 +63 -0
  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;
@@ -649,6 +651,67 @@ tool(
649
651
  }
650
652
  );
651
653
 
654
+ tool(
655
+ "review_testcases",
656
+ "Open JSON test cases in browser for manual approval",
657
+ {
658
+ testCases: z.array(z.object({
659
+ id: z.string(),
660
+ title: z.string(),
661
+ description: 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
+
652
715
  return server;
653
716
  };
654
717
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nbakka/mcp-appium",
3
- "version": "2.0.63",
3
+ "version": "2.0.65",
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",