@tgebrowser/mcp 1.1.1 → 1.1.3

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/build/server.js +47 -1
  2. package/package.json +1 -1
package/build/server.js CHANGED
@@ -76,7 +76,9 @@ var ENDPOINTS = {
76
76
  UPDATE_PROXY: (proxyId) => `/api/proxies/${proxyId}`,
77
77
  DELETE_PROXY: (proxyId) => `/api/proxies/${proxyId}`,
78
78
  WINDOW_HIDE: "/api/window/hide",
79
- WINDOW_SHOW: "/api/window/show"
79
+ WINDOW_SHOW: "/api/window/show",
80
+ UPDATE_COOKIE: "/api/browser/cookie/update",
81
+ BATCH_UPDATE: "/api/browser/batch/update"
80
82
  };
81
83
  var apiClient = import_axios.default.create({
82
84
  baseURL: BASE_URL,
@@ -257,6 +259,20 @@ To automate this browser, use connect-browser-with-ws with wsUrl="${wsUrl}"`;
257
259
  const response = await apiClient.post(ENDPOINTS.GET_BROWSER_DETAIL, body);
258
260
  assertSuccess(response.data, "get browser detail");
259
261
  return `Browser detail: ${JSON.stringify(response.data.data, null, 2)}`;
262
+ },
263
+ async updateCookie({ envId, userIndex, cookie }) {
264
+ const body = { cookie };
265
+ if (envId !== void 0) body.envId = envId;
266
+ if (userIndex !== void 0) body.userIndex = userIndex;
267
+ const response = await apiClient.post(ENDPOINTS.UPDATE_COOKIE, body);
268
+ assertSuccess(response.data, "update cookie");
269
+ return `Cookie updated for envId=${body.envId ?? ""} userIndex=${body.userIndex ?? ""}`;
270
+ },
271
+ async batchUpdate({ envIds, field, value }) {
272
+ const response = await apiClient.put(ENDPOINTS.BATCH_UPDATE, { envIds, field, value });
273
+ assertSuccess(response.data, "batch update");
274
+ const info = response.data.data || {};
275
+ return `Batch update result: total=${info.total}, success=${info.success}, failed=${info.failed}`;
260
276
  }
261
277
  };
262
278
 
@@ -269,6 +285,12 @@ var CHROME_VERSIONS = [
269
285
  "139",
270
286
  "141",
271
287
  "143",
288
+ "145",
289
+ "146",
290
+ "147",
291
+ "148",
292
+ "149",
293
+ "150",
272
294
  "ua_auto"
273
295
  ];
274
296
  var TLS_CIPHER_SUITES = {
@@ -546,6 +568,18 @@ var profileSchemas = {
546
568
  userIndex: import_zod.z.number().int().min(1).optional().describe("Environment index")
547
569
  }).refine((data) => data.envId !== void 0 || data.userIndex !== void 0, {
548
570
  message: "Either envId or userIndex must be provided"
571
+ }),
572
+ updateCookie: import_zod.z.object({
573
+ envId: import_zod.z.number().int().positive().optional().describe("Environment id"),
574
+ userIndex: import_zod.z.number().int().min(1).optional().describe("Environment index"),
575
+ cookie: import_zod.z.string().describe("Cookie string. Empty string or null clears the cookie.")
576
+ }).refine((data) => data.envId !== void 0 || data.userIndex !== void 0, {
577
+ message: "Either envId or userIndex must be provided"
578
+ }),
579
+ batchUpdate: import_zod.z.object({
580
+ envIds: import_zod.z.array(import_zod.z.number().int().positive()).describe("Array of environment ids"),
581
+ field: import_zod.z.string().describe('Field name to update, e.g. "browserName", "remark", "fingerprint"'),
582
+ value: import_zod.z.any().describe("New value for the field")
549
583
  })
550
584
  };
551
585
 
@@ -1089,6 +1123,18 @@ function registerTools(server2) {
1089
1123
  profileSchemas.detail.shape,
1090
1124
  wrapHandler(profileActions.getDetail, profileSchemas.detail)
1091
1125
  );
1126
+ server2.tool(
1127
+ "update-cookie",
1128
+ "Update the cookie for a specific environment. Pass empty string to clear.",
1129
+ schemaShape(profileSchemas.updateCookie),
1130
+ wrapHandler(profileActions.updateCookie, profileSchemas.updateCookie)
1131
+ );
1132
+ server2.tool(
1133
+ "batch-update",
1134
+ "Batch update a specific field across multiple environments",
1135
+ profileSchemas.batchUpdate.shape,
1136
+ wrapHandler(profileActions.batchUpdate, profileSchemas.batchUpdate)
1137
+ );
1092
1138
  server2.tool(
1093
1139
  "get-group-list",
1094
1140
  "Get the list of groups",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tgebrowser/mcp",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "main": "build/server.js",
5
5
  "type": "commonjs",
6
6
  "bin": {