Files
n8n-mcp/scripts/test-node-info.js
czlonkowski 91386b2d02 refactor: clean up file names and fix version management
- Renamed files to remove unnecessary suffixes:
  - tools-update.ts → tools.ts
  - server-update.ts → server.ts
  - http-server-fixed.ts → http-server.ts
- Created version utility to read from package.json as single source of truth
- Updated all imports across 21+ files
- Removed legacy files:
  - src/http-server.ts (legacy HTTP server with known issues)
  - src/utils/n8n-client.ts (unused legacy API client)
- Added n8n_diagnostic tool to help troubleshoot management tools visibility
- Added script to sync package.runtime.json version
- Fixed version mismatch issue (was hardcoded 2.4.1, now reads 2.7.0 from package.json)

This addresses GitHub issue #5 regarding version mismatch and provides better diagnostics for users.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-29 17:43:29 +02:00

59 lines
1.7 KiB
JavaScript

#!/usr/bin/env node
/**
* Test get_node_info to diagnose timeout issues
*/
const { N8NDocumentationMCPServer } = require('../dist/mcp/server');
async function testNodeInfo() {
console.log('🔍 Testing get_node_info...\n');
try {
const server = new N8NDocumentationMCPServer();
await new Promise(resolve => setTimeout(resolve, 500));
const nodes = [
'nodes-base.httpRequest',
'nodes-base.webhook',
'nodes-langchain.agent'
];
for (const nodeType of nodes) {
console.log(`Testing ${nodeType}...`);
const start = Date.now();
try {
const result = await server.executeTool('get_node_info', { nodeType });
const elapsed = Date.now() - start;
const size = JSON.stringify(result).length;
console.log(`✅ Success in ${elapsed}ms`);
console.log(` Size: ${(size / 1024).toFixed(1)}KB`);
console.log(` Properties: ${result.properties?.length || 0}`);
console.log(` Operations: ${result.operations?.length || 0}`);
// Check for issues
if (size > 50000) {
console.log(` ⚠️ WARNING: Response over 50KB!`);
}
// Check property quality
const propsWithoutDesc = result.properties?.filter(p => !p.description && !p.displayName).length || 0;
if (propsWithoutDesc > 0) {
console.log(` ⚠️ ${propsWithoutDesc} properties without descriptions`);
}
} catch (error) {
const elapsed = Date.now() - start;
console.log(`❌ Failed after ${elapsed}ms: ${error.message}`);
}
console.log('');
}
} catch (error) {
console.error('Fatal error:', error);
}
}
testNodeInfo().catch(console.error);