Describe the bug
Seeing a module resolution bug implementing in Cursor, it looks like the package imports ES modules as named imports from what Node treats as CommonJS modules.
import {AgentFocus} from '../../node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/performance/AIContext.js';
^^^^^^^^^^
SyntaxError: Named export 'AgentFocus' not found. The requested module '../../node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/performance/AIContext.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '../../node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/performance/AIContext.js';
const {AgentFocus} = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)
To Reproduce
Steps to reproduce the behavior:
- Add
"chrome-devtools": {
"command": "npx",
"args": ["chrome-devtools-mcp@latest"]
}
to mcp file for Cursor
- or run npx chrome-devtools-mcp@latest --help
- See error
Expected behavior
MCP server has tools available
Chrome version: 140.0.7339.133
Coding agent version: latest
Node version: v20.16.0
Cursor version: v1.6.45
Describe the bug
Seeing a module resolution bug implementing in Cursor, it looks like the package imports ES modules as named imports from what Node treats as CommonJS modules.
To Reproduce
Steps to reproduce the behavior:
to mcp file for Cursor
Expected behavior
MCP server has tools available
Chrome version: 140.0.7339.133
Coding agent version: latest
Node version: v20.16.0
Cursor version: v1.6.45