Skip to content

Commit a8ab387

Browse files
authored
Merge pull request #9 from freema/claude/session-011CUZAR8cgKFG1T2jAw79nQ
claude/session-011CUZAR8cgKFG1T2jAw79nQ
2 parents 2fa941b + 62b6d52 commit a8ab387

File tree

3 files changed

+14
-24
lines changed

3 files changed

+14
-24
lines changed

package-lock.json

Lines changed: 5 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "firefox-devtools-mcp",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "Model Context Protocol (MCP) server for Firefox DevTools automation",
55
"author": "freema",
66
"license": "MIT",

src/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ if (process.env.NODE_ENV !== 'production') {
1919
}
2020

2121
import { version } from 'node:process';
22+
import { fileURLToPath } from 'node:url';
23+
import { resolve } from 'node:path';
2224
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
2325
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
2426
import {
@@ -236,7 +238,12 @@ async function main() {
236238

237239
// Only run main() if this file is executed directly (not imported)
238240
// In ES modules, check if import.meta.url matches the executed file
239-
if (import.meta.url === `file://${process.argv[1]}`) {
241+
// We need to normalize both paths to handle different execution contexts (npx, node, etc.)
242+
const modulePath = fileURLToPath(import.meta.url);
243+
const scriptPath = process.argv[1] ? resolve(process.argv[1]) : '';
244+
const isMainModule = modulePath === scriptPath;
245+
246+
if (isMainModule) {
240247
main().catch((error) => {
241248
logError('Fatal error in main', error);
242249
process.exit(1);

0 commit comments

Comments
 (0)