diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 4da0ea4..89d4a2a 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v6.3.0 with: - node-version: 22.x + node-version: '24' cache: npm - name: Install dependencies run: npm ci diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 93d1dfc..3864507 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -13,7 +13,7 @@ jobs: contents: read strategy: matrix: - node-version: [20.x, 22.x, 24.x] + node-version: [22.x, 24.x] steps: - uses: actions/checkout@v6 - name: Setup Node.js ${{ matrix.node-version }} diff --git a/.github/workflows/publishing.yml b/.github/workflows/publishing.yml index 34ed9da..f9a0671 100644 --- a/.github/workflows/publishing.yml +++ b/.github/workflows/publishing.yml @@ -10,16 +10,12 @@ jobs: permissions: contents: read id-token: write - strategy: - matrix: - node: [22.x] steps: - uses: actions/checkout@v6 - - name: Setup Node.js ${{ matrix.node-version }} + - name: Setup Node.js uses: actions/setup-node@v6.3.0 with: - node-version: ${{ matrix.node-version }} - cache: npm + node-version: '24' registry-url: 'https://registry.npmjs.org' - name: Install dependencies run: npm ci diff --git a/README.md b/README.md index 0a7aeeb..8606187 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ It is intended to be extensible to meet the needs of different teams and project [Read more about our roadmap and how we've structured the server in our architecture docs](./docs/architecture.md). ## Requirements -- [Node.js 20+](https://nodejs.org/) +- [Node.js 22+](https://nodejs.org/) - NPM (or equivalent package manager) ## Quick start diff --git a/docs/development.md b/docs/development.md index 2ec5ed6..1a63785 100644 --- a/docs/development.md +++ b/docs/development.md @@ -154,7 +154,7 @@ The documentation catalog `src/docs.json` pins remote resources to specific comm #### Programmatic runtime requirements -- **Node.js 20+**: Required to run the core MCP server. +- **Node.js 22+**: Required to run the core MCP server. - **Node.js 22+**: Required for loading external tool plugins (`--tool`) and for developers working on advanced process isolation features. **Example: Programmatic test mode** @@ -395,7 +395,7 @@ These terms describe **how tools and their related properties are represented** ### Tool plugins -- **Plugins don't appear**: Verify the Node version (requires Node.js >= 20; >= 22 for tool plugins) and check logs (enable `--log-stderr`). +- **Plugins don't appear**: Verify the Node version (requires Node.js >= 22 for tool plugins) and check logs (enable `--log-stderr`). - **Startup warnings/errors**: Startup `load:ack` warnings/errors from tool plugins are logged when stderr/protocol logging is enabled. - **Schema errors**: If `tools/call` rejects with schema errors, ensure `inputSchema` is valid. See [Authoring tools](#authoring-tools) for details. - **Network access issues**: If the tool is having network access issues, you may need to configure `--plugin-isolation none`. This is generally discouraged for security reasons but may be necessary in some cases. @@ -408,7 +408,7 @@ These terms describe **how tools and their related properties are represented** ### General issues -- **Server won't start**: Check Node.js version (requires Node.js >= 20; >= 22 for tool plugins). +- **Server won't start**: Check Node.js version (requires Node.js >= 22 for tool plugins). - **Missing tools/resources**: Verify the server started successfully and check logs with `--log-stderr`. - **Type errors**: Ensure TypeScript types are installed: `npm install --save-dev @types/node` diff --git a/guidelines/agent_behaviors.md b/guidelines/agent_behaviors.md index 04a4da2..b609ddf 100644 --- a/guidelines/agent_behaviors.md +++ b/guidelines/agent_behaviors.md @@ -45,7 +45,7 @@ For a detailed overview of the system design and roadmap, see [docs/architecture - **Validation Required**: Follow checklists; verify requirements; test thoroughly. Review [pull request warning signs](../CONTRIBUTING.md#pull-requests) to avoid common pitfalls. - **Confirmation Required**: Confirm success; summarize changes; explain impact; verify understanding. - **Guidance Review Scope**: Unless the user explicitly asks, do not make recommendations on improving guidance if all you're asked to do is review guidance. -- **Environment Awareness**: +- **Environment Awareness**: - Server and plugin execution requirements are defined in `package.json`. - Always verify environment compatibility by checking `patternfly://context` or `package.json`. - Proactively check for environment mismatches (e.g., Node.js version) if tools fail to load. diff --git a/package.json b/package.json index 21440c7..d2c930a 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "typescript-eslint": "^8.58.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" }, "repository": { "type": "git", diff --git a/src/__tests__/__snapshots__/options.defaults.test.ts.snap b/src/__tests__/__snapshots__/options.defaults.test.ts.snap index 4b202a0..ef48ff4 100644 --- a/src/__tests__/__snapshots__/options.defaults.test.ts.snap +++ b/src/__tests__/__snapshots__/options.defaults.test.ts.snap @@ -45,7 +45,7 @@ exports[`options defaults should return specific properties: defaults 1`] = ` "test": {}, }, "name": "@patternfly/patternfly-mcp", - "nodeEngine": ">=20.0.0", + "nodeEngine": ">=22.0.0", "nodeVersion": 22, "nodeVersionPreferred": 22, "patternflyOptions": { diff --git a/src/__tests__/__snapshots__/server.tools.test.ts.snap b/src/__tests__/__snapshots__/server.tools.test.ts.snap index cab35b5..0fe70b8 100644 --- a/src/__tests__/__snapshots__/server.tools.test.ts.snap +++ b/src/__tests__/__snapshots__/server.tools.test.ts.snap @@ -14,17 +14,14 @@ exports[`composeTools should attempt to setup creators, file package creators 1` } `; -exports[`composeTools should attempt to setup creators, file package creators, Node.js 20 1`] = ` +exports[`composeTools should attempt to setup creators, file package creators, Node.js 22 1`] = ` { "log": [ [ "Existing Tools Host session detected test-session-id. Shutting down the existing host before creating a new one.", ], - [ - "External tool plugins require Node >= 22; skipping file-based tools.", - ], ], - "toolsCount": 3, + "toolsCount": 5, } `; @@ -112,17 +109,20 @@ exports[`composeTools should attempt to setup creators, inline and file package } `; -exports[`composeTools should attempt to setup creators, inline and file package creators, duplicates, Node.js 20 1`] = ` +exports[`composeTools should attempt to setup creators, inline and file package creators, duplicates, Node.js 22 1`] = ` { "log": [ [ "Existing Tools Host session detected test-session-id. Shutting down the existing host before creating a new one.", ], [ - "External tool plugins require Node >= 22; skipping file-based tools.", + "Skipping tool plugin "@patternfly/tools" – name already used by built-in/inline tool.", + ], + [ + "Skipping tool plugin "DOLOR " – name already used by built-in/inline tool.", ], ], - "toolsCount": 5, + "toolsCount": 6, } `; diff --git a/src/__tests__/server.tools.test.ts b/src/__tests__/server.tools.test.ts index b2398c7..cd5c1ad 100644 --- a/src/__tests__/server.tools.test.ts +++ b/src/__tests__/server.tools.test.ts @@ -700,10 +700,10 @@ describe('composeTools', () => { expectedModuleCount: 5 }, { - description: 'file package creators, Node.js 20', - nodeVersion: 20, + description: 'file package creators, Node.js 22', + nodeVersion: 22, modules: ['file:///test/module.js', '@patternfly/tools'], - expectedModuleCount: 3 + expectedModuleCount: 5 }, { description: 'file package creators, Node.js 24', @@ -756,8 +756,8 @@ describe('composeTools', () => { expectedModuleCount: 6 }, { - description: 'inline and file package creators, duplicates, Node.js 20', - nodeVersion: 20, + description: 'inline and file package creators, duplicates, Node.js 22', + nodeVersion: 22, modules: [ { name: '@patternfly/tools', description: 'lorem ipsum', inputSchema: {}, handler: () => {} }, { name: 'dolor', description: 'sit amet', inputSchema: z.object({}), handler: () => {} }, @@ -765,7 +765,7 @@ describe('composeTools', () => { '@patternfly/tools', 'DOLOR ' ], - expectedModuleCount: 5 + expectedModuleCount: 6 } ])('should attempt to setup creators, $description', async ({ modules, nodeVersion, expectedModuleCount }) => { const mockChild = { diff --git a/tests/e2e/stdioTransport.test.ts b/tests/e2e/stdioTransport.test.ts index 8907206..52fcf85 100644 --- a/tests/e2e/stdioTransport.test.ts +++ b/tests/e2e/stdioTransport.test.ts @@ -443,7 +443,7 @@ describe('Tools', () => { afterEach(async () => CLIENT.stop()); - itSkip(envNodeVersion >= 22)('should access new tools', async () => { + it('should access new tools', async () => { const req = { method: 'tools/list', params: {} @@ -461,18 +461,7 @@ describe('Tools', () => { expect(names).toContain('echo_createMcp_tool'); }); - itSkip(envNodeVersion <= 20)('should fail to access a new tool', async () => { - const req = { - method: 'tools/list', - params: {} - }; - - await CLIENT.send(req); - - expect(CLIENT.logs().join(',')).toContain('External tool plugins require Node >= 22; skipping file-based tools.'); - }); - - itSkip(envNodeVersion >= 22).each([ + it.each([ { description: 'echo basic tool', name: 'echo_basic_tool', @@ -497,29 +486,4 @@ describe('Tools', () => { expect(resp.result).toMatchSnapshot(); expect(resp.result.isError).toBeUndefined(); }); - - itSkip(envNodeVersion <= 20).each([ - { - description: 'echo basic tool', - name: 'echo_basic_tool', - args: { type: 'echo', lorem: 'ipsum', dolor: 'sit amet' } - }, - { - description: 'echo create MCP tool', - name: 'echo_createMcp_tool', - args: { type: 'echo', lorem: 'ipsum', dolor: 'sit amet' } - } - ])('should fail to interact with a tool, $description', async ({ name, args }) => { - const req = { - method: 'tools/call', - params: { - name, - arguments: args - } - }; - - const resp: any = await CLIENT.send(req); - - expect(resp.result.isError).toBe(true); - }); });