mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-08 22:33:08 +00:00
feat: add n8n_deploy_template tool for one-click template deployment (v2.27.0) (#453)
* feat: add n8n_deploy_template tool for one-click template deployment (v2.27.0) Add new MCP tool that deploys n8n.io workflow templates directly to user's n8n instance in a single operation. Features: - Fetch template from local database - Extract and report required credentials - Optionally strip credentials (default: true) - Optionally auto-upgrade node typeVersions (default: true) - Optionally validate before deployment (default: true) - Return workflow ID, URL, and setup guidance Parameters: - templateId (required): Template ID from n8n.io - name (optional): Custom workflow name - autoUpgradeVersions (default: true) - validate (default: true) - stripCredentials (default: true) Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: address code review findings for n8n_deploy_template - Fix health check tool count (12 → 13) to include new tool - Add templateId validation (must be positive integer) - Use deep copy of workflow to prevent template mutation - Expand unit tests with negative/zero/decimal validation cases Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: update README with n8n_deploy_template tool - Update management tools count from 12 to 13 - Add n8n_deploy_template to the tools list Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: prevent workflow validator from mutating node types The validator was incorrectly mutating node types from full form (n8n-nodes-base.*) to short form (nodes-base.*) during validation. This caused deployed workflows to show "?" icons in n8n UI because the API requires full form node types. Also updated SplitInBatches detection to check both node type forms since workflows may contain either format. Conceived by Romuald Członkowski - www.aiadvisors.pl/en 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * test: update tool counts in handlers-n8n-manager test Update expected managementTools count from 12 to 13 and totalAvailable from 19 to 20 to account for the new n8n_deploy_template tool. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: pin MCP SDK and Zod versions to prevent Zod v4 resolution Fixes #440, #444, #446, #447, #450 Root cause: package.json declared `"@modelcontextprotocol/sdk": "^1.20.1"` which allowed npm to resolve to SDK 1.23.0. That version accepts `"zod": "^3.25 || ^4.0"`, causing npm to deduplicate to Zod v4. SDK 1.23.0's `isZ4Schema()` function crashes when called with undefined, which happens for plain JSON Schema objects. Changes: - Pin SDK to exact version 1.20.1 (removes ^ prefix) - Pin Zod to exact version 3.24.1 (removes ^ prefix) - Add CI workflow to verify fresh installs get compatible versions The new CI workflow: - Packs and installs package fresh (without lockfile) - Verifies SDK is exactly 1.20.1 - Verifies Zod is NOT v4 (blocks 4.x.x) - Runs weekly to catch upstream dependency changes Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: improve dependency-check workflow based on code review - Add workflow_dispatch for manual triggering/debugging - Add explicit "not found" handling for version detection failures - Use regex pattern for Zod v4 check to catch pre-release versions - Add Zod error pattern detection in functionality test - Capture stderr output for comprehensive error checking Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
c7e7bda505
commit
e7dd04b471
@@ -383,14 +383,11 @@ export class WorkflowValidator {
|
||||
});
|
||||
}
|
||||
}
|
||||
// Normalize node type FIRST to ensure consistent lookup
|
||||
// Normalize node type for database lookup (DO NOT mutate the original workflow)
|
||||
// The normalizer converts to short form (nodes-base.*) for database queries,
|
||||
// but n8n API requires full form (n8n-nodes-base.*). Never modify the input workflow.
|
||||
const normalizedType = NodeTypeNormalizer.normalizeToFullForm(node.type);
|
||||
|
||||
// Update node type in place if it was normalized
|
||||
if (normalizedType !== node.type) {
|
||||
node.type = normalizedType;
|
||||
}
|
||||
|
||||
// Get node definition using normalized type (needed for typeVersion validation)
|
||||
const nodeInfo = this.nodeRepository.getNode(normalizedType);
|
||||
|
||||
@@ -684,7 +681,12 @@ export class WorkflowValidator {
|
||||
}
|
||||
|
||||
// Special validation for SplitInBatches node
|
||||
if (sourceNode && sourceNode.type === 'nodes-base.splitInBatches') {
|
||||
// Check both full form (n8n-nodes-base.*) and short form (nodes-base.*)
|
||||
const isSplitInBatches = sourceNode && (
|
||||
sourceNode.type === 'n8n-nodes-base.splitInBatches' ||
|
||||
sourceNode.type === 'nodes-base.splitInBatches'
|
||||
);
|
||||
if (isSplitInBatches) {
|
||||
this.validateSplitInBatchesConnection(
|
||||
sourceNode,
|
||||
outputIndex,
|
||||
@@ -696,8 +698,8 @@ export class WorkflowValidator {
|
||||
|
||||
// Check for self-referencing connections
|
||||
if (connection.node === sourceName) {
|
||||
// This is only a warning for non-loop nodes
|
||||
if (sourceNode && sourceNode.type !== 'nodes-base.splitInBatches') {
|
||||
// This is only a warning for non-loop nodes (not SplitInBatches)
|
||||
if (sourceNode && !isSplitInBatches) {
|
||||
result.warnings.push({
|
||||
type: 'warning',
|
||||
message: `Node "${sourceName}" has a self-referencing connection. This can cause infinite loops.`
|
||||
|
||||
Reference in New Issue
Block a user