Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { AuthManager } from './core/auth.js';
import { SERVER_VERSION } from './mcp-server.js';
import { spawn } from 'child_process';
import { fileURLToPath } from 'url';
import { fileURLToPath, pathToFileURL } from 'url';
import { dirname, join } from 'path';
import readline from 'readline/promises';

Expand Down Expand Up @@ -175,10 +175,11 @@ async function startServer() {
} else {
// Production mode - run compiled JavaScript
const serverPath = join(__dirname, 'index.js');
const serverUrl = pathToFileURL(serverPath).href;

// Dynamic import to run the server
try {
await import(serverPath);
await import(serverUrl);
} catch (error) {
console.error('Failed to start server:', error);
process.exit(1);
Expand Down Expand Up @@ -216,4 +217,4 @@ if (args.includes('--auth') || args.includes('-a')) {
console.error('Failed to start:', error);
process.exit(1);
});
}
}