Skip to content

refactor: drop n8n meta + n8n-core dev deps (v2.47.2)#707

Merged
czlonkowski merged 2 commits into
mainfrom
refactor/drop-n8n-meta-dep
Apr 7, 2026
Merged

refactor: drop n8n meta + n8n-core dev deps (v2.47.2)#707
czlonkowski merged 2 commits into
mainfrom
refactor/drop-n8n-meta-dep

Conversation

@czlonkowski

Copy link
Copy Markdown
Owner

Summary

The MCP server reads node metadata from a prebuilt SQLite database and never executes n8n nodes, so depending on the full n8n meta package (editor backend, task runner, queue, typeorm, AI workflow builder, etc.) was pure dev-tree overhead. The loader only actually needs n8n-nodes-base and @n8n/n8n-nodes-langchain at rebuild time.

This PR:

  • Removes n8n (meta) and n8n-core from package.json
  • Adds n8n-nodes-base as a direct dep (the package src/loaders/node-loader.ts already require()s)
  • Keeps n8n-workflow (type imports only) and @n8n/n8n-nodes-langchain
  • Rewrites scripts/update-n8n-deps.js to check each tracked package against its own latest dist-tag instead of deriving peer versions from the n8n meta dep
  • Updates scripts/update-and-publish-prep.sh, src/mcp/tools-documentation.ts, and docs/DEPENDENCY_UPDATES.md to point at n8n-nodes-base as the primary version reference

Impact

  • 495 packages removed from the dev tree (~25% reduction). npm install goes from 2674 → 2179 audited packages.
  • No runtime change. The published npm package has always used package.runtime.json (8 deps, zero n8n) and data/nodes.db. End users running npx n8n-mcp never install n8n in the first place.
  • Database preserved. data/nodes.db was rebuilt from fresh n8n-nodes-base@2.15.0, then community nodes (584) and AI documentation summaries (581) were restored from a backup using the standard n8n update procedure.
  • SBOM cleanup side-effect. GitHub-generated SBOMs (which scan package.json) will now show the dev tree without the n8n meta dep's bloat — drops things like bull, @n8n/typeorm, @n8n/ai-workflow-builder, @n8n/task-runner.

Why we can't drop more

n8n-workflow stays for type imports (erased at compile time, but TypeScript needs them). n8n-nodes-base and @n8n/n8n-nodes-langchain are require()d by the node loader at rebuild time to extract node class metadata into SQLite. Eliminating those would require rewriting metadata extraction to parse source files statically — significant project with fragility downsides.

Test plan

  • npm install — 495 packages removed cleanly
  • npm run build — clean
  • npm run typecheck — clean
  • npm run rebuild — 755 base nodes loaded + community restored = 1339 total
  • Verified FTS5 index populated (triggers auto-sync community rows)
  • All 4512 unit tests pass (1 test updated to read n8n-nodes-base version)
  • CI green
  • Spot-check search_nodes, get_node_essentials, validate_node_operation against a few community nodes post-merge

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

…ectly (v2.47.2)

The MCP server reads node metadata from a prebuilt SQLite database and never
executes n8n nodes, so depending on the full `n8n` meta package (editor backend,
task runner, queue, typeorm, AI workflow builder, etc.) was pure dev-tree
overhead. The loader only needs `n8n-nodes-base` and `@n8n/n8n-nodes-langchain`.

Changes:
- package.json: remove `n8n` and `n8n-core`, add `n8n-nodes-base` directly
- scripts/update-n8n-deps.js: check each tracked package against its own
  `latest` dist-tag instead of deriving peer versions from the n8n meta dep
- scripts/update-and-publish-prep.sh: read primary version from n8n-nodes-base,
  drop n8n-core from commit message bullets
- src/mcp/tools-documentation.ts: compatibility notice reads from n8n-nodes-base
- docs/DEPENDENCY_UPDATES.md: updated tracked packages section
- CHANGELOG.md: 2.47.2 entry
- data/nodes.db: rebuilt base nodes from fresh n8n-nodes-base@2.15.0,
  community nodes + AI documentation summaries preserved via backup/restore

Impact:
- 495 packages removed from dev tree (~25% reduction)
- No runtime change: the published npm package has always used
  package.runtime.json and shipped with zero n8n deps
- All 4512 unit tests pass

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Test Results Summary

📊 Artifacts


Generated at Tue, 07 Apr 2026 20:25:02 GMT
Commit: 69fb80e
Run: #958

@codecov

codecov Bot commented Apr 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/mcp/tools-documentation.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

…ally)

Integration tests in CI revealed that dropping n8n-core from our deps
caused Merge, Slack, and other v3/V2 nodes to silently fail to load during
`npm run rebuild`. Root cause: n8n-nodes-base internally `require()`s
n8n-core in 7 of its compiled node files (Merge/v3, Slack/V2, sendAndWait
utilities, etc.) but only declares it as a devDependency. When n8n-nodes-base
is consumed via the `n8n` meta package n8n-core comes along for the ride;
consuming n8n-nodes-base directly leaves it missing.

Fix: add n8n-core back as an explicit direct dependency. Our source code
still never imports it, but the loader needs it present in node_modules
for `require('n8n-core')` in n8n-nodes-base's node files to resolve.

Net dev-tree savings drop from ~495 to ~440 packages — still the bulk of
the reduction, since the `n8n` meta package was the real bloat
(@n8n/ai-workflow-builder, bull, @n8n/typeorm, task-runner, editor backend).

- package.json: re-add n8n-core as direct dep
- scripts/update-n8n-deps.js: re-add n8n-core to trackedDeps
- scripts/update-and-publish-prep.sh: re-add n8n-core to commit message
- docs/DEPENDENCY_UPDATES.md: document why n8n-core stays
- CHANGELOG.md: update 2.47.2 notes to reflect the corrected scope
- data/nodes.db: rebuilt with full 812 base nodes, community nodes restored

Verified: 4512 unit tests + 699 integration tests pass locally.

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@czlonkowski czlonkowski merged commit 0ba9756 into main Apr 7, 2026
13 checks passed
@czlonkowski czlonkowski deleted the refactor/drop-n8n-meta-dep branch April 7, 2026 21:04
RenatoAscencio pushed a commit to serversmx/n8n-mcp that referenced this pull request May 6, 2026
* refactor: drop n8n meta + n8n-core dev deps, track n8n-nodes-base directly (v2.47.2)

The MCP server reads node metadata from a prebuilt SQLite database and never
executes n8n nodes, so depending on the full `n8n` meta package (editor backend,
task runner, queue, typeorm, AI workflow builder, etc.) was pure dev-tree
overhead. The loader only needs `n8n-nodes-base` and `@n8n/n8n-nodes-langchain`.

Changes:
- package.json: remove `n8n` and `n8n-core`, add `n8n-nodes-base` directly
- scripts/update-n8n-deps.js: check each tracked package against its own
  `latest` dist-tag instead of deriving peer versions from the n8n meta dep
- scripts/update-and-publish-prep.sh: read primary version from n8n-nodes-base,
  drop n8n-core from commit message bullets
- src/mcp/tools-documentation.ts: compatibility notice reads from n8n-nodes-base
- docs/DEPENDENCY_UPDATES.md: updated tracked packages section
- CHANGELOG.md: 2.47.2 entry
- data/nodes.db: rebuilt base nodes from fresh n8n-nodes-base@2.15.0,
  community nodes + AI documentation summaries preserved via backup/restore

Impact:
- 495 packages removed from dev tree (~25% reduction)
- No runtime change: the published npm package has always used
  package.runtime.json and shipped with zero n8n deps
- All 4512 unit tests pass

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: restore n8n-core dependency (Merge, Slack V3 require() it internally)

Integration tests in CI revealed that dropping n8n-core from our deps
caused Merge, Slack, and other v3/V2 nodes to silently fail to load during
`npm run rebuild`. Root cause: n8n-nodes-base internally `require()`s
n8n-core in 7 of its compiled node files (Merge/v3, Slack/V2, sendAndWait
utilities, etc.) but only declares it as a devDependency. When n8n-nodes-base
is consumed via the `n8n` meta package n8n-core comes along for the ride;
consuming n8n-nodes-base directly leaves it missing.

Fix: add n8n-core back as an explicit direct dependency. Our source code
still never imports it, but the loader needs it present in node_modules
for `require('n8n-core')` in n8n-nodes-base's node files to resolve.

Net dev-tree savings drop from ~495 to ~440 packages — still the bulk of
the reduction, since the `n8n` meta package was the real bloat
(@n8n/ai-workflow-builder, bull, @n8n/typeorm, task-runner, editor backend).

- package.json: re-add n8n-core as direct dep
- scripts/update-n8n-deps.js: re-add n8n-core to trackedDeps
- scripts/update-and-publish-prep.sh: re-add n8n-core to commit message
- docs/DEPENDENCY_UPDATES.md: document why n8n-core stays
- CHANGELOG.md: update 2.47.2 notes to reflect the corrected scope
- data/nodes.db: rebuilt with full 812 base nodes, community nodes restored

Verified: 4512 unit tests + 699 integration tests pass locally.

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant