refactor: drop n8n meta + n8n-core dev deps (v2.47.2)#707
Merged
Conversation
…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>
Contributor
Test Results Summary📊 ArtifactsGenerated at Tue, 07 Apr 2026 20:25:02 GMT |
Codecov Report❌ Patch coverage is
📢 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>
7 tasks
8 tasks
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The MCP server reads node metadata from a prebuilt SQLite database and never executes n8n nodes, so depending on the full
n8nmeta package (editor backend, task runner, queue, typeorm, AI workflow builder, etc.) was pure dev-tree overhead. The loader only actually needsn8n-nodes-baseand@n8n/n8n-nodes-langchainat rebuild time.This PR:
n8n(meta) andn8n-corefrompackage.jsonn8n-nodes-baseas a direct dep (the packagesrc/loaders/node-loader.tsalreadyrequire()s)n8n-workflow(type imports only) and@n8n/n8n-nodes-langchainscripts/update-n8n-deps.jsto check each tracked package against its ownlatestdist-tag instead of deriving peer versions from the n8n meta depscripts/update-and-publish-prep.sh,src/mcp/tools-documentation.ts, anddocs/DEPENDENCY_UPDATES.mdto point atn8n-nodes-baseas the primary version referenceImpact
npm installgoes from 2674 → 2179 audited packages.package.runtime.json(8 deps, zero n8n) anddata/nodes.db. End users runningnpx n8n-mcpnever install n8n in the first place.data/nodes.dbwas rebuilt from freshn8n-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.package.json) will now show the dev tree without the n8n meta dep's bloat — drops things likebull,@n8n/typeorm,@n8n/ai-workflow-builder,@n8n/task-runner.Why we can't drop more
n8n-workflowstays for type imports (erased at compile time, but TypeScript needs them).n8n-nodes-baseand@n8n/n8n-nodes-langchainarerequire()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 cleanlynpm run build— cleannpm run typecheck— cleannpm run rebuild— 755 base nodes loaded + community restored = 1339 totaln8n-nodes-baseversion)search_nodes,get_node_essentials,validate_node_operationagainst a few community nodes post-mergeConceived by Romuald Członkowski - https://www.aiadvisors.pl/en