mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-09 06:43:08 +00:00
fix: use lowercase for community node names to match n8n convention (#529)
* fix: use lowercase for community node names to match n8n convention Community nodes in n8n use lowercase node class names (e.g., chatwoot not Chatwoot). The extractNodeNameFromPackage method was incorrectly capitalizing node names, causing validation failures. Changes: - Fix extractNodeNameFromPackage to use lowercase instead of capitalizing - Add case-insensitive fallback in getNode for robustness - Update tests to expect lowercase node names - Bump version to 2.32.1 Fixes the case sensitivity bug where MCP stored Chatwoot but n8n expected chatwoot. Conceived by Romuald Członkowski - www.aiadvisors.pl/en 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: rebuild community nodes database with lowercase names Rebuilt database after fixing extractNodeNameFromPackage to use lowercase node names matching n8n convention. Conceived by Romuald Członkowski - www.aiadvisors.pl/en 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Romuald Członkowski <romualdczlonkowski@MacBook-Pro-Romuald.local> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
211ae72f96
commit
28667736cd
@@ -355,9 +355,13 @@ export class CommunityNodeService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract a readable node name from npm package name.
|
||||
* e.g., "n8n-nodes-globals" -> "Globals"
|
||||
* e.g., "@company/n8n-nodes-mynode" -> "Mynode"
|
||||
* Extract node name from npm package name.
|
||||
* n8n community nodes typically use lowercase node class names.
|
||||
* e.g., "n8n-nodes-chatwoot" -> "chatwoot"
|
||||
* e.g., "@company/n8n-nodes-mynode" -> "mynode"
|
||||
*
|
||||
* Note: We use lowercase because most community nodes follow this convention.
|
||||
* Verified nodes from Strapi have the correct casing in nodeDesc.name.
|
||||
*/
|
||||
private extractNodeNameFromPackage(packageName: string): string {
|
||||
// Remove scope if present
|
||||
@@ -366,11 +370,9 @@ export class CommunityNodeService {
|
||||
// Remove n8n-nodes- prefix
|
||||
name = name.replace(/^n8n-nodes-/, '');
|
||||
|
||||
// Capitalize first letter of each word
|
||||
return name
|
||||
.split('-')
|
||||
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
||||
.join('');
|
||||
// Remove hyphens and keep lowercase (n8n community node convention)
|
||||
// e.g., "bright-data" -> "brightdata", "chatwoot" -> "chatwoot"
|
||||
return name.replace(/-/g, '').toLowerCase();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -103,6 +103,18 @@ export class NodeRepository {
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback: case-insensitive lookup for community nodes
|
||||
// Handles cases where node type casing differs (e.g., .Chatwoot vs .chatwoot)
|
||||
if (!row) {
|
||||
const caseInsensitiveRow = this.db.prepare(`
|
||||
SELECT * FROM nodes WHERE LOWER(node_type) = LOWER(?)
|
||||
`).get(nodeType) as any;
|
||||
|
||||
if (caseInsensitiveRow) {
|
||||
return this.parseNodeRow(caseInsensitiveRow);
|
||||
}
|
||||
}
|
||||
|
||||
if (!row) return null;
|
||||
|
||||
return this.parseNodeRow(row);
|
||||
|
||||
Reference in New Issue
Block a user