firefox-devtools-mcp 0.2.2 → 0.2.5

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 (3) hide show
  1. package/README.md +1 -0
  2. package/dist/index.js +42 -37
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  [![CI](https://github.com/freema/firefox-devtools-mcp/workflows/CI/badge.svg)](https://github.com/freema/firefox-devtools-mcp/actions/workflows/ci.yml)
5
5
  [![codecov](https://codecov.io/gh/freema/firefox-devtools-mcp/branch/main/graph/badge.svg)](https://codecov.io/gh/freema/firefox-devtools-mcp)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
7
8
  <a href="https://glama.ai/mcp/servers/@freema/firefox-devtools-mcp"><img src="https://glama.ai/mcp/servers/@freema/firefox-devtools-mcp/badge" height="223" alt="Glama"></a>
8
9
 
9
10
  Model Context Protocol server for automating Firefox via WebDriver BiDi (through Selenium WebDriver). Works with Claude Code, Claude Desktop, Cursor, Cline and other MCP clients.
package/dist/index.js CHANGED
@@ -5346,7 +5346,7 @@ var init_protocol = __esm({
5346
5346
  */
5347
5347
  request(request, resultSchema, options) {
5348
5348
  const { relatedRequestId, resumptionToken, onresumptiontoken } = options !== null && options !== void 0 ? options : {};
5349
- return new Promise((resolve2, reject) => {
5349
+ return new Promise((resolve3, reject) => {
5350
5350
  var _a, _b, _c, _d, _e, _f;
5351
5351
  if (!this._transport) {
5352
5352
  reject(new Error("Not connected"));
@@ -5397,7 +5397,7 @@ var init_protocol = __esm({
5397
5397
  }
5398
5398
  try {
5399
5399
  const result = resultSchema.parse(response.result);
5400
- resolve2(result);
5400
+ resolve3(result);
5401
5401
  } catch (error) {
5402
5402
  reject(error);
5403
5403
  }
@@ -6238,7 +6238,7 @@ var require_uri_all = __commonJS({
6238
6238
  target.fragment = relative.fragment;
6239
6239
  return target;
6240
6240
  }
6241
- function resolve2(baseURI, relativeURI, options) {
6241
+ function resolve3(baseURI, relativeURI, options) {
6242
6242
  var schemelessOptions = assign({ scheme: "null" }, options);
6243
6243
  return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
6244
6244
  }
@@ -6503,7 +6503,7 @@ var require_uri_all = __commonJS({
6503
6503
  exports2.removeDotSegments = removeDotSegments;
6504
6504
  exports2.serialize = serialize;
6505
6505
  exports2.resolveComponents = resolveComponents;
6506
- exports2.resolve = resolve2;
6506
+ exports2.resolve = resolve3;
6507
6507
  exports2.normalize = normalize;
6508
6508
  exports2.equal = equal;
6509
6509
  exports2.escapeComponent = escapeComponent;
@@ -6856,18 +6856,18 @@ var require_resolve = __commonJS({
6856
6856
  var util2 = require_util();
6857
6857
  var SchemaObject = require_schema_obj();
6858
6858
  var traverse = require_json_schema_traverse();
6859
- module.exports = resolve2;
6860
- resolve2.normalizeId = normalizeId;
6861
- resolve2.fullPath = getFullPath;
6862
- resolve2.url = resolveUrl;
6863
- resolve2.ids = resolveIds;
6864
- resolve2.inlineRef = inlineRef;
6865
- resolve2.schema = resolveSchema;
6866
- function resolve2(compile, root, ref) {
6859
+ module.exports = resolve3;
6860
+ resolve3.normalizeId = normalizeId;
6861
+ resolve3.fullPath = getFullPath;
6862
+ resolve3.url = resolveUrl;
6863
+ resolve3.ids = resolveIds;
6864
+ resolve3.inlineRef = inlineRef;
6865
+ resolve3.schema = resolveSchema;
6866
+ function resolve3(compile, root, ref) {
6867
6867
  var refVal = this._refs[ref];
6868
6868
  if (typeof refVal == "string") {
6869
6869
  if (this._refs[refVal]) refVal = this._refs[refVal];
6870
- else return resolve2.call(this, compile, root, refVal);
6870
+ else return resolve3.call(this, compile, root, refVal);
6871
6871
  }
6872
6872
  refVal = refVal || this._schemas[ref];
6873
6873
  if (refVal instanceof SchemaObject) {
@@ -7072,7 +7072,7 @@ var require_resolve = __commonJS({
7072
7072
  var require_error_classes = __commonJS({
7073
7073
  "node_modules/ajv/lib/compile/error_classes.js"(exports, module) {
7074
7074
  "use strict";
7075
- var resolve2 = require_resolve();
7075
+ var resolve3 = require_resolve();
7076
7076
  module.exports = {
7077
7077
  Validation: errorSubclass(ValidationError),
7078
7078
  MissingRef: errorSubclass(MissingRefError)
@@ -7087,8 +7087,8 @@ var require_error_classes = __commonJS({
7087
7087
  };
7088
7088
  function MissingRefError(baseId, ref, message) {
7089
7089
  this.message = message || MissingRefError.message(baseId, ref);
7090
- this.missingRef = resolve2.url(baseId, ref);
7091
- this.missingSchema = resolve2.normalizeId(resolve2.fullPath(this.missingRef));
7090
+ this.missingRef = resolve3.url(baseId, ref);
7091
+ this.missingSchema = resolve3.normalizeId(resolve3.fullPath(this.missingRef));
7092
7092
  }
7093
7093
  function errorSubclass(Subclass) {
7094
7094
  Subclass.prototype = Object.create(Error.prototype);
@@ -7616,7 +7616,7 @@ var require_validate = __commonJS({
7616
7616
  var require_compile = __commonJS({
7617
7617
  "node_modules/ajv/lib/compile/index.js"(exports, module) {
7618
7618
  "use strict";
7619
- var resolve2 = require_resolve();
7619
+ var resolve3 = require_resolve();
7620
7620
  var util2 = require_util();
7621
7621
  var errorClasses = require_error_classes();
7622
7622
  var stableStringify = require_fast_json_stable_stringify();
@@ -7674,7 +7674,7 @@ var require_compile = __commonJS({
7674
7674
  RULES,
7675
7675
  validate: validateGenerator,
7676
7676
  util: util2,
7677
- resolve: resolve2,
7677
+ resolve: resolve3,
7678
7678
  resolveRef,
7679
7679
  usePattern,
7680
7680
  useDefault,
@@ -7734,7 +7734,7 @@ var require_compile = __commonJS({
7734
7734
  return validate;
7735
7735
  }
7736
7736
  function resolveRef(baseId2, ref, isRoot) {
7737
- ref = resolve2.url(baseId2, ref);
7737
+ ref = resolve3.url(baseId2, ref);
7738
7738
  var refIndex = refs[ref];
7739
7739
  var _refVal, refCode;
7740
7740
  if (refIndex !== void 0) {
@@ -7751,11 +7751,11 @@ var require_compile = __commonJS({
7751
7751
  }
7752
7752
  }
7753
7753
  refCode = addLocalRef(ref);
7754
- var v2 = resolve2.call(self, localCompile, root, ref);
7754
+ var v2 = resolve3.call(self, localCompile, root, ref);
7755
7755
  if (v2 === void 0) {
7756
7756
  var localSchema = localRefs && localRefs[ref];
7757
7757
  if (localSchema) {
7758
- v2 = resolve2.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self, localSchema, root, localRefs, baseId2);
7758
+ v2 = resolve3.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self, localSchema, root, localRefs, baseId2);
7759
7759
  }
7760
7760
  }
7761
7761
  if (v2 === void 0) {
@@ -11365,7 +11365,7 @@ var require_ajv = __commonJS({
11365
11365
  "node_modules/ajv/lib/ajv.js"(exports, module) {
11366
11366
  "use strict";
11367
11367
  var compileSchema = require_compile();
11368
- var resolve2 = require_resolve();
11368
+ var resolve3 = require_resolve();
11369
11369
  var Cache = require_cache();
11370
11370
  var SchemaObject = require_schema_obj();
11371
11371
  var stableStringify = require_fast_json_stable_stringify();
@@ -11447,7 +11447,7 @@ var require_ajv = __commonJS({
11447
11447
  var id = this._getId(schema);
11448
11448
  if (id !== void 0 && typeof id != "string")
11449
11449
  throw new Error("schema id must be string");
11450
- key = resolve2.normalizeId(key || id);
11450
+ key = resolve3.normalizeId(key || id);
11451
11451
  checkUnique(this, key);
11452
11452
  this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true);
11453
11453
  return this;
@@ -11491,7 +11491,7 @@ var require_ajv = __commonJS({
11491
11491
  }
11492
11492
  }
11493
11493
  function _getSchemaFragment(self, ref) {
11494
- var res = resolve2.schema.call(self, { schema: {} }, ref);
11494
+ var res = resolve3.schema.call(self, { schema: {} }, ref);
11495
11495
  if (res) {
11496
11496
  var schema = res.schema, root = res.root, baseId = res.baseId;
11497
11497
  var v = compileSchema.call(self, schema, root, void 0, baseId);
@@ -11507,7 +11507,7 @@ var require_ajv = __commonJS({
11507
11507
  }
11508
11508
  }
11509
11509
  function _getSchemaObj(self, keyRef) {
11510
- keyRef = resolve2.normalizeId(keyRef);
11510
+ keyRef = resolve3.normalizeId(keyRef);
11511
11511
  return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];
11512
11512
  }
11513
11513
  function removeSchema(schemaKeyRef) {
@@ -11534,7 +11534,7 @@ var require_ajv = __commonJS({
11534
11534
  this._cache.del(cacheKey);
11535
11535
  var id = this._getId(schemaKeyRef);
11536
11536
  if (id) {
11537
- id = resolve2.normalizeId(id);
11537
+ id = resolve3.normalizeId(id);
11538
11538
  delete this._schemas[id];
11539
11539
  delete this._refs[id];
11540
11540
  }
@@ -11558,13 +11558,13 @@ var require_ajv = __commonJS({
11558
11558
  var cached = this._cache.get(cacheKey);
11559
11559
  if (cached) return cached;
11560
11560
  shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;
11561
- var id = resolve2.normalizeId(this._getId(schema));
11561
+ var id = resolve3.normalizeId(this._getId(schema));
11562
11562
  if (id && shouldAddSchema) checkUnique(this, id);
11563
11563
  var willValidate = this._opts.validateSchema !== false && !skipValidation;
11564
11564
  var recursiveMeta;
11565
- if (willValidate && !(recursiveMeta = id && id == resolve2.normalizeId(schema.$schema)))
11565
+ if (willValidate && !(recursiveMeta = id && id == resolve3.normalizeId(schema.$schema)))
11566
11566
  this.validateSchema(schema, true);
11567
- var localRefs = resolve2.ids.call(this, schema);
11567
+ var localRefs = resolve3.ids.call(this, schema);
11568
11568
  var schemaObj = new SchemaObject({
11569
11569
  id,
11570
11570
  schema,
@@ -12036,12 +12036,12 @@ var init_stdio2 = __esm({
12036
12036
  (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this);
12037
12037
  }
12038
12038
  send(message) {
12039
- return new Promise((resolve2) => {
12039
+ return new Promise((resolve3) => {
12040
12040
  const json = serializeMessage(message);
12041
12041
  if (this._stdout.write(json)) {
12042
- resolve2();
12042
+ resolve3();
12043
12043
  } else {
12044
- this._stdout.once("drain", resolve2);
12044
+ this._stdout.once("drain", resolve3);
12045
12045
  }
12046
12046
  });
12047
12047
  }
@@ -12055,7 +12055,7 @@ var init_constants = __esm({
12055
12055
  "src/config/constants.ts"() {
12056
12056
  "use strict";
12057
12057
  SERVER_NAME = "firefox-devtools";
12058
- SERVER_VERSION = "0.2.1";
12058
+ SERVER_VERSION = "0.2.5";
12059
12059
  }
12060
12060
  });
12061
12061
 
@@ -12824,7 +12824,7 @@ var init_dom = __esm({
12824
12824
  */
12825
12825
  async waitForEventsAfterAction() {
12826
12826
  await this.driver.executeScript("return new Promise(r => requestAnimationFrame(() => r()))");
12827
- await new Promise((resolve2) => setTimeout(resolve2, 50));
12827
+ await new Promise((resolve3) => setTimeout(resolve3, 50));
12828
12828
  }
12829
12829
  // ============================================================================
12830
12830
  // Screenshot
@@ -12853,7 +12853,7 @@ var init_dom = __esm({
12853
12853
  'arguments[0].scrollIntoView({block: "center", inline: "center"});',
12854
12854
  el
12855
12855
  );
12856
- await new Promise((resolve2) => setTimeout(resolve2, 100));
12856
+ await new Promise((resolve3) => setTimeout(resolve3, 100));
12857
12857
  return await el.takeScreenshot();
12858
12858
  }
12859
12859
  };
@@ -15644,6 +15644,8 @@ __export(index_exports, {
15644
15644
  getFirefox: () => getFirefox
15645
15645
  });
15646
15646
  import { version } from "process";
15647
+ import { fileURLToPath as fileURLToPath2 } from "url";
15648
+ import { resolve as resolve2 } from "path";
15647
15649
  async function getFirefox() {
15648
15650
  if (!firefox2) {
15649
15651
  log("Initializing Firefox DevTools connection...");
@@ -15715,7 +15717,7 @@ async function main() {
15715
15717
  log("Firefox DevTools MCP server running on stdio");
15716
15718
  log("Ready to accept tool requests");
15717
15719
  }
15718
- var major, args, firefox2, toolHandlers, allTools;
15720
+ var major, args, firefox2, toolHandlers, allTools, modulePath, scriptPath, isMainModule;
15719
15721
  var init_index = __esm({
15720
15722
  async "src/index.ts"() {
15721
15723
  init_server();
@@ -15805,7 +15807,10 @@ var init_index = __esm({
15805
15807
  navigateHistoryTool,
15806
15808
  setViewportSizeTool
15807
15809
  ];
15808
- if (import.meta.url === `file://${process.argv[1]}`) {
15810
+ modulePath = fileURLToPath2(import.meta.url);
15811
+ scriptPath = process.argv[1] ? resolve2(process.argv[1]) : "";
15812
+ isMainModule = modulePath === scriptPath;
15813
+ if (isMainModule) {
15809
15814
  main().catch((error) => {
15810
15815
  logError("Fatal error in main", error);
15811
15816
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firefox-devtools-mcp",
3
- "version": "0.2.2",
3
+ "version": "0.2.5",
4
4
  "description": "Model Context Protocol (MCP) server for Firefox DevTools automation",
5
5
  "author": "freema",
6
6
  "license": "MIT",
@@ -58,6 +58,7 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@modelcontextprotocol/sdk": "^1.17.1",
61
+ "geckodriver": "^6.0.2",
61
62
  "selenium-webdriver": "^4.36.0",
62
63
  "ws": "^8.18.3",
63
64
  "yargs": "^17.7.2"
@@ -75,7 +76,6 @@
75
76
  "eslint": "^8.57.1",
76
77
  "eslint-config-prettier": "^10.1.5",
77
78
  "eslint-plugin-prettier": "^5.4.0",
78
- "geckodriver": "^6.0.2",
79
79
  "prettier": "^3.5.3",
80
80
  "tsup": "^8.0.0",
81
81
  "tsx": "^4.7.0",