Skip to content

Commit 589a390

Browse files
authored
build(node.js)!: pf-3843 remove 20 support (#169)
* audit, move dep audit, publishing baselines moved to Node.js 24 * build, engine, moved to Node.js 22 minimum * cli, Node.js version copy, pin server version to support older Node.js * docs, references moved to Node.js 22 * package, min engine version, cleaned test scripts * src, drop Node.js 20 reference * e2e, cleaned Node.js 20 checks, left itSkip, envNodeVersion BREAKING CHANGE: Minimum supported Node.js is now 22, previously 20. MCP clients and integrations running Node.js 20 will fail to start on `@latest`. To migrate: - Either upgrade Node.js to a minimum of 22 LTS. - Or pin the server configuration to a Node.js 20-compatible release See usage docs for pinned configuration examples.
1 parent 0a3420d commit 589a390

16 files changed

Lines changed: 98 additions & 97 deletions

.github/workflows/audit.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
name: Data Audit
1+
name: Security & Data Audit
22

33
on:
44
pull_request:
55
paths:
66
- 'src/docs.json'
77
- 'tests/audit/**'
8+
- 'package.json'
9+
- 'package-lock.json'
810
schedule:
911
- cron: '0 0 * * *' # Daily at midnight
1012
workflow_dispatch:
1113

1214
jobs:
13-
audit-links:
15+
documentation-audit:
16+
name: Documentation Audit
1417
runs-on: ubuntu-latest
1518
permissions:
1619
contents: read
@@ -19,7 +22,7 @@ jobs:
1922
- name: Setup Node.js
2023
uses: actions/setup-node@v6.3.0
2124
with:
22-
node-version: 22.x
25+
node-version: '24'
2326
cache: npm
2427
- name: Install dependencies
2528
run: npm ci
@@ -30,3 +33,20 @@ jobs:
3033
DOCS_AUDIT_MAX_TOTAL: ${{ github.event_name == 'schedule' && '0' || '50' }}
3134
# Advisories are non-blocking for PRs
3235
continue-on-error: ${{ github.event_name == 'pull_request' }}
36+
37+
dependency-audit:
38+
name: Dependency Audit
39+
runs-on: ubuntu-latest
40+
permissions:
41+
contents: read
42+
steps:
43+
- uses: actions/checkout@v6
44+
- name: Setup Node.js
45+
uses: actions/setup-node@v6.3.0
46+
with:
47+
node-version: '24'
48+
cache: npm
49+
- name: Run npm audit
50+
run: npm audit --omit=dev --audit-level=critical
51+
# Advisories are non-blocking for PRs
52+
continue-on-error: ${{ github.event_name == 'pull_request' }}

.github/workflows/integration.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,21 @@ jobs:
1313
contents: read
1414
strategy:
1515
matrix:
16-
node-version: [20.x, 22.x, 24.x]
16+
node-version: [22.x, 24.x]
1717
steps:
1818
- uses: actions/checkout@v6
19+
1920
- name: Setup Node.js ${{ matrix.node-version }}
2021
uses: actions/setup-node@v6.3.0
2122
with:
2223
node-version: ${{ matrix.node-version }}
2324
cache: npm
24-
- name: Node.js modules cache
25-
uses: actions/cache@v5
26-
id: modules-cache
27-
with:
28-
path: ${{ github.workspace }}/node_modules
29-
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/package-lock.json') }}
30-
restore-keys: |
31-
${{ runner.os }}-${{ matrix.node-version }}-modules
25+
3226
- name: Install Node.js packages
33-
if: ${{ steps.modules-cache.outputs.cache-hit != 'true' }}
3427
run: npm ci
35-
- name: Audit packages
36-
run: npm audit --audit-level=high
37-
continue-on-error: true
28+
3829
- name: Lint and test
3930
run: npm run test:ci
31+
4032
- name: Confirm integration
41-
if: ${{ success() }}
4233
run: npm run test:integration

.github/workflows/publishing.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,12 @@ jobs:
1010
permissions:
1111
contents: read
1212
id-token: write
13-
strategy:
14-
matrix:
15-
node: [22.x]
1613
steps:
1714
- uses: actions/checkout@v6
18-
- name: Setup Node.js ${{ matrix.node-version }}
15+
- name: Setup Node.js
1916
uses: actions/setup-node@v6.3.0
2017
with:
21-
node-version: ${{ matrix.node-version }}
22-
cache: npm
18+
node-version: '24'
2319
registry-url: 'https://registry.npmjs.org'
2420
- name: Install dependencies
2521
run: npm ci

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ It is intended to be extensible to meet the needs of different teams and project
77
[Read more about our roadmap and how we've structured the server in our architecture docs](./docs/architecture.md).
88

99
## Requirements
10-
- [Node.js 20+](https://nodejs.org/)
10+
- [Node.js 22+](https://nodejs.org/)
1111
- NPM (or equivalent package manager)
1212

1313
## Quick start
@@ -18,6 +18,8 @@ The PatternFly MCP Server supports multiple configurations; see the [usage docum
1818

1919
#### Set a basic MCP configuration
2020

21+
> Unable to update to the required Node.js version? [See pinned MCP configuration examples for earlier Node.js versions.](./docs/usage.md#pinned-mcp-package-version)
22+
2123
Minimal configuration
2224
```json
2325
{

docs/development.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ The documentation catalog `src/docs.json` pins remote resources to specific comm
158158

159159
#### Programmatic runtime requirements
160160

161-
- **Node.js 20+**: Required to run the core MCP server.
162-
- **Node.js 22+**: Required for loading external tool plugins (`--tool`) and for developers working on advanced process isolation features.
161+
- **Node.js 22+**: Required to run the MCP server, load external tool plugins (`--tool`), and use advanced process isolation features.
163162

164163
**Example: Programmatic test mode**
165164
```typescript
@@ -411,7 +410,7 @@ These terms describe **how tools and their related properties are represented**
411410

412411
### Tool plugins
413412

414-
- **Plugins don't appear**: Verify the Node version (requires Node.js >= 20; >= 22 for tool plugins) and check logs (enable `--log-stderr`).
413+
- **Plugins don't appear**: Verify the Node version (requires Node.js >= 22 for tool plugins) and check logs (enable `--log-stderr`).
415414
- **Startup warnings/errors**: Startup `load:ack` warnings/errors from tool plugins are logged when stderr/protocol logging is enabled.
416415
- **Schema errors**: If `tools/call` rejects with schema errors, ensure `inputSchema` is valid. See [Authoring tools](#authoring-tools) for details.
417416
- **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.
@@ -424,7 +423,7 @@ These terms describe **how tools and their related properties are represented**
424423

425424
### General issues
426425

427-
- **Server won't start**: Check Node.js version (requires Node.js >= 20; >= 22 for tool plugins).
426+
- **Server won't start**: Check Node.js version (requires Node.js >= 22 to run the server).
428427
- **Missing tools/resources**: Verify the server started successfully and check logs with `--log-stderr`.
429428
- **Type errors**: Ensure TypeScript types are installed: `npm install --save-dev @types/node`
430429

docs/usage.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,33 @@ Access specific component documentation or technical specifications using the fo
9797

9898
Most MCP clients use JSON configuration to specify how the server is started. Below are examples you can adapt for your client.
9999

100+
### Pinned MCP package version
101+
102+
Depending on your environment, you may have to delay updating to the minimum Node.js version required by the server. If you are unable to upgrade your Node.js version and must remain on a previous Node.js version, you can pin your MCP configuration to the last compatible version of the server.
103+
104+
> **Note**: Currently, pinning to an older PatternFly MCP version means you will not receive updated documentation or new features until you "update" your pinned version. In the future, pinning a version may still make an allowance for documentation updates. [See our planned architecture.](./architecture.md#hybrid-documentation-in-progress)
105+
106+
#### When to choose `@latest` or a pinned version for configuration
107+
108+
| Node.js version | Package spec | Feature notes |
109+
|-----------------|-------------------------------------|--------------------------------------------------------------------------------------------------------------------|
110+
| **>=22** | `@patternfly/patternfly-mcp@latest` | Newest PatternFly features and rules. Includes **enhanced security isolation** for custom tool plugins. |
111+
| **>=20** | `@patternfly/patternfly-mcp@1.1.0` | Standard features and rules. Lacks **custom tool plugins**; compatible with all default PatternFly configurations. |
112+
113+
##### Node.js 20 compatible pin
114+
115+
```json
116+
{
117+
"mcpServers": {
118+
"patternfly-mcp": {
119+
"command": "npx",
120+
"args": ["-y", "@patternfly/patternfly-mcp@1.1.0"],
121+
"description": "PatternFly rules and documentation (Node.js 20 compatible)"
122+
}
123+
}
124+
}
125+
```
126+
100127
### Minimal client config (stdio)
101128

102129
```json
@@ -182,14 +209,16 @@ These are **first-step checks** for common setup problems, not full diagnostics.
182209
183210
> **Agents**: PatternFly MCP server information is available internally through the `patternfly://context` MCP resource.
184211
185-
### 1. Verify Node.js Version
186-
The PatternFly MCP server requires **Node.js 20 or higher**.
212+
### 1. Verify Node.js version
213+
The PatternFly MCP server requires **Node.js 22 or higher**.
187214

188215
- **How to check**:
189216
- **macOS/Linux**: Open **Terminal** and type `node -v`.
190217
- **Windows**: Open **PowerShell** or **Command Prompt** and type `node -v`.
191-
- **Requirement**: You should see a version starting with `v20`, `v22`, or higher.
192-
- **Solution**: If your version is lower than 20, please download and install the latest "LTS" (Long Term Support) version from [nodejs.org](https://nodejs.org/).
218+
- **Requirement**: You should see a version starting with `v22`, or higher.
219+
- **Solution**: If your version is lower than 22, please download and install the latest "LTS" (Long Term Support) version from [nodejs.org](https://nodejs.org/).
220+
221+
> **Unable to update your Node.js version?** [See pinned configuration examples for earlier Node.js versions.](#pinned-mcp-package-version)
193222
194223
### 2. Reset the npx Cache
195224
If you encounter an `ERR_MODULE_NOT_FOUND` error or don't see the latest features, your system may be using a "stale" or corrupted version in its cache.

guidelines/agent_behaviors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ For a detailed overview of the system design and roadmap, see [docs/architecture
4545
- **Validation Required**: Follow checklists; verify requirements; test thoroughly. Review [pull request warning signs](../CONTRIBUTING.md#pull-requests) to avoid common pitfalls.
4646
- **Confirmation Required**: Confirm success; summarize changes; explain impact; verify understanding.
4747
- **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.
48-
- **Environment Awareness**:
48+
- **Environment Awareness**:
4949
- Server and plugin execution requirements are defined in `package.json`.
5050
- Always verify environment compatibility by checking `patternfly://context` or `package.json`.
5151
- Proactively check for environment mismatches (e.g., Node.js version) if tools fail to load.

jest.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default {
3636
projects: [
3737
{
3838
displayName: 'unit',
39-
roots: ['src'],
39+
roots: ['<rootDir>/src'],
4040
testMatch: ['<rootDir>/src/**/*.test.ts'],
4141
setupFilesAfterEnv: ['<rootDir>/jest.setupTests.ts'],
4242
...baseConfig,
@@ -64,7 +64,7 @@ export default {
6464
},
6565
{
6666
displayName: 'e2e',
67-
roots: ['tests/e2e'],
67+
roots: ['<rootDir>/tests/e2e'],
6868
testMatch: ['<rootDir>/tests/e2e/**/*.test.ts'],
6969
setupFilesAfterEnv: ['<rootDir>/tests/e2e/jest.setupTests.ts'],
7070
transformIgnorePatterns: [
@@ -74,7 +74,7 @@ export default {
7474
},
7575
{
7676
displayName: 'audit',
77-
roots: ['tests/audit'],
77+
roots: ['<rootDir>/tests/audit'],
7878
testMatch: ['<rootDir>/tests/audit/**/*.test.ts'],
7979
...baseConfig
8080
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
"release": "changelog --non-cc --link-url https://github.com/patternfly/patternfly-mcp.git",
3232
"start": "node dist/cli.js --log-stderr",
3333
"start:dev": "tsx watch src/cli.ts --verbose --log-stderr",
34-
"test": "npm run test:spell && npm run test:spell-docs && npm run test:lint && npm run test:types && jest --selectProjects unit --roots=src/",
35-
"test:audit": "jest --selectProjects audit --roots=tests/audit/",
34+
"test": "npm run test:spell && npm run test:spell-docs && npm run test:lint && npm run test:types && jest --selectProjects unit",
35+
"test:audit": "jest --selectProjects audit",
3636
"test:ci": "npm test -- --coverage",
3737
"test:dev": "npm test -- --watchAll",
38-
"test:integration": "npm run build && NODE_OPTIONS='--experimental-vm-modules' jest --selectProjects e2e --roots=tests/e2e/",
38+
"test:integration": "npm run build && NODE_OPTIONS='--experimental-vm-modules' jest --selectProjects e2e",
3939
"test:integration-dev": "npm run test:integration -- --watchAll",
4040
"test:lint": "eslint .",
4141
"test:lint-fix": "eslint . --fix",
@@ -84,7 +84,7 @@
8484
"typescript-eslint": "^8.59.1"
8585
},
8686
"engines": {
87-
"node": ">=20.0.0"
87+
"node": ">=22.0.0"
8888
},
8989
"repository": {
9090
"type": "git",

0 commit comments

Comments
 (0)