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>
This commit is contained in:
czlonkowski
2025-06-29 17:43:29 +02:00
parent a1e3f9cb39
commit 91386b2d02
23 changed files with 369 additions and 631 deletions

View File

@@ -3,7 +3,7 @@
* Debug the essentials implementation
*/
const { N8NDocumentationMCPServer } = require('../dist/mcp/server-update');
const { N8NDocumentationMCPServer } = require('../dist/mcp/server');
const { PropertyFilter } = require('../dist/services/property-filter');
const { ExampleGenerator } = require('../dist/services/example-generator');

View File

@@ -3,7 +3,7 @@
* Debug script to check node data structure
*/
const { N8NDocumentationMCPServer } = require('../dist/mcp/server-update');
const { N8NDocumentationMCPServer } = require('../dist/mcp/server');
async function debugNode() {
console.log('🔍 Debugging node data\n');

40
scripts/sync-runtime-version.js Executable file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/env node
/**
* Sync version from package.json to package.runtime.json
* This ensures both files always have the same version
*/
const fs = require('fs');
const path = require('path');
const packageJsonPath = path.join(__dirname, '..', 'package.json');
const packageRuntimePath = path.join(__dirname, '..', 'package.runtime.json');
try {
// Read package.json
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
const version = packageJson.version;
// Read package.runtime.json
const packageRuntime = JSON.parse(fs.readFileSync(packageRuntimePath, 'utf-8'));
// Update version if different
if (packageRuntime.version !== version) {
packageRuntime.version = version;
// Write back with proper formatting
fs.writeFileSync(
packageRuntimePath,
JSON.stringify(packageRuntime, null, 2) + '\n',
'utf-8'
);
console.log(`✅ Updated package.runtime.json version to ${version}`);
} else {
console.log(`✓ package.runtime.json already at version ${version}`);
}
} catch (error) {
console.error('❌ Error syncing version:', error.message);
process.exit(1);
}

View File

@@ -3,7 +3,7 @@
* Direct test of the server functionality without MCP protocol
*/
const { N8NDocumentationMCPServer } = require('../dist/mcp/server-update');
const { N8NDocumentationMCPServer } = require('../dist/mcp/server');
async function testDirect() {
console.log('🧪 Direct server test\n');

View File

@@ -9,7 +9,7 @@
* 4. Tests the property search functionality
*/
import { N8NDocumentationMCPServer } from '../src/mcp/server-update';
import { N8NDocumentationMCPServer } from '../src/mcp/server';
import { readFileSync, writeFileSync } from 'fs';
import { join } from 'path';

View File

@@ -3,7 +3,7 @@
* Final validation test
*/
const { N8NDocumentationMCPServer } = require('../dist/mcp/server-update');
const { N8NDocumentationMCPServer } = require('../dist/mcp/server');
const colors = {
green: '\x1b[32m',

View File

@@ -3,7 +3,7 @@
* Test get_node_info to diagnose timeout issues
*/
const { N8NDocumentationMCPServer } = require('../dist/mcp/server-update');
const { N8NDocumentationMCPServer } = require('../dist/mcp/server');
async function testNodeInfo() {
console.log('🔍 Testing get_node_info...\n');