diff --git a/README.md b/README.md index 095e3ec..c24d939 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ After install, set your credentials from [TestingBot account settings](https://t ## Prerequisites -- **Node.js** >= 18 (recommended: 22.15.0 or later) +- **Node.js** >= 20 (recommended: 22.15.0 or later) - **TestingBot Account** with API credentials - An MCP-compatible client (Claude Desktop, VS Code with Continue, Cursor, etc.) @@ -856,7 +856,7 @@ If you see authentication errors: If the MCP server won't connect: 1. Restart your MCP client (Claude Desktop, VS Code, etc.) 2. Check the MCP client logs for errors -3. Verify Node.js version is >= 18 +3. Verify Node.js version is >= 20 ### Tool Execution Errors diff --git a/package.json b/package.json index 241d5a6..aa5b8ea 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "LICENSE" ], "engines": { - "node": ">=18" + "node": ">=20" }, "keywords": [ "mcp", diff --git a/src/server-factory.ts b/src/server-factory.ts index 13954aa..eefa397 100644 --- a/src/server-factory.ts +++ b/src/server-factory.ts @@ -213,7 +213,9 @@ export class TestingBotMcpServer { // traffic. Throws on any blocking issue so the entry point can exit with a // clear error instead of letting the first tool call fail mysteriously. public async preflight(): Promise { - const required = 18; + // Must match `engines.node` in package.json, and the floor enforced by + // @testingbot/automation-mcp, which hard-fails its own preflight below 20. + const required = 20; const major = Number(process.versions.node.split(".")[0]); if (!Number.isFinite(major) || major < required) { throw new Error( diff --git a/tests/server-factory.test.ts b/tests/server-factory.test.ts index f4f729e..c6e050e 100644 --- a/tests/server-factory.test.ts +++ b/tests/server-factory.test.ts @@ -40,10 +40,18 @@ describe("TestingBotMcpServer.preflight", () => { it("rejects unsupported Node versions before hitting the API", async () => { setNodeVersion("16.20.0"); const server = new TestingBotMcpServer(testingBotApiMock, configMock); - await expect(server.preflight()).rejects.toThrow(/Node.js 18\+ is required/); + await expect(server.preflight()).rejects.toThrow(/Node.js 20\+ is required/); expect(testingBotApiMock.getUserInfo).not.toHaveBeenCalled(); }); + it("rejects Node 18, which @testingbot/automation-mcp no longer supports", async () => { + // The bundled automation tools hard-fail their own preflight below 20, so + // accepting 18 here would install cleanly and then die at startup. + setNodeVersion("18.20.0"); + const server = new TestingBotMcpServer(testingBotApiMock, configMock); + await expect(server.preflight()).rejects.toThrow(/Node.js 20\+ is required/); + }); + it("starts in degraded mode (no throw) when api_key is missing", async () => { setNodeVersion("20.10.0"); const server = new TestingBotMcpServer(testingBotApiMock, {