refactor: reorganize documentation and configuration files for improved clarity
This commit is contained in:
@@ -3,12 +3,45 @@
|
||||
import { N8NDocumentationMCPServer } from './server-update';
|
||||
import { logger } from '../utils/logger';
|
||||
|
||||
// Add error details to stderr for Claude Desktop debugging
|
||||
process.on('uncaughtException', (error) => {
|
||||
console.error('Uncaught Exception:', error);
|
||||
logger.error('Uncaught Exception:', error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
process.on('unhandledRejection', (reason, promise) => {
|
||||
console.error('Unhandled Rejection at:', promise, 'reason:', reason);
|
||||
logger.error('Unhandled Rejection:', reason);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
console.error('Starting n8n Documentation MCP Server...');
|
||||
console.error('Current directory:', process.cwd());
|
||||
console.error('Script directory:', __dirname);
|
||||
console.error('Node version:', process.version);
|
||||
|
||||
const server = new N8NDocumentationMCPServer();
|
||||
await server.run();
|
||||
} catch (error) {
|
||||
console.error('Failed to start MCP server:', error);
|
||||
logger.error('Failed to start MCP server', error);
|
||||
|
||||
// Provide helpful error messages
|
||||
if (error instanceof Error && error.message.includes('nodes.db not found')) {
|
||||
console.error('\nTo fix this issue:');
|
||||
console.error('1. cd to the n8n-mcp directory');
|
||||
console.error('2. Run: npm run build');
|
||||
console.error('3. Run: npm run rebuild');
|
||||
} else if (error instanceof Error && error.message.includes('NODE_MODULE_VERSION')) {
|
||||
console.error('\nTo fix this Node.js version mismatch:');
|
||||
console.error('1. cd to the n8n-mcp directory');
|
||||
console.error('2. Run: npm rebuild better-sqlite3');
|
||||
console.error('3. If that doesn\'t work, try: rm -rf node_modules && npm install');
|
||||
}
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user