Environment
- OS: Linux x64 / macOS / Windows
- Runtime / Node: Node.js v20.x, npm / pnpm
- TypeScript Version:
^5.x
- atomic-agent version:
v0.4.x (main branch)
Summary
When attempting to dynamically import external Model Context Protocol (MCP) server modules or user-defined tool plugins configured via atomic.config.ts, the module loader fails with an ERR_REQUIRE_ESM or ERR_UNKNOWN_FILE_EXTENSION error.
This happens because the dynamic import pipeline in src/mcp/loader.ts assumes all plugin dependencies follow ES Modules ("type": "module"), failing when encountering legacy CommonJS packages or TypeScript files compiled to standard CJS formats.
Steps to Reproduce
- Define a custom local tool or install a third-party CJS-formatted MCP tool package.
- Register the tool in your configuration file:
// atomic.config.ts
export default {
tools: [
{
name: 'custom-tool',
path: './plugins/my-cjs-tool.js'
}
]
};
Environment
^5.xv0.4.x(main branch)Summary
When attempting to dynamically import external Model Context Protocol (MCP) server modules or user-defined tool plugins configured via
atomic.config.ts, the module loader fails with anERR_REQUIRE_ESMorERR_UNKNOWN_FILE_EXTENSIONerror.This happens because the dynamic import pipeline in
src/mcp/loader.tsassumes all plugin dependencies follow ES Modules ("type": "module"), failing when encountering legacy CommonJS packages or TypeScript files compiled to standard CJS formats.Steps to Reproduce