zrald1
Version:
Advanced Graph RAG MCP Server with file location identification, graph processing, and result summarization capabilities
48 lines • 1.79 kB
JavaScript
import { GraphRAGMCPServer } from './mcp-server.js';
import { config } from 'dotenv';
// Load environment variables
config();
async function main() {
try {
console.error('DEBUG: Starting Zrald-1 Simple MCP Server...');
const server = new GraphRAGMCPServer();
console.error('DEBUG: Server instance created');
// Handle graceful shutdown
process.on('SIGINT', async () => {
console.error('DEBUG: Received SIGINT');
await server.shutdown();
process.exit(0);
});
process.on('SIGTERM', async () => {
console.error('DEBUG: Received SIGTERM');
await server.shutdown();
process.exit(0);
});
// Initialize server
console.error('DEBUG: Initializing server...');
try {
await server.initialize();
console.error('DEBUG: Server initialized successfully');
}
catch (error) {
console.error('DEBUG: Initialization error:', error instanceof Error ? error.message : String(error));
console.error('DEBUG: Continuing in mock mode...');
}
// Start server
console.error('DEBUG: Starting MCP server...');
await server.start();
console.error('DEBUG: MCP server started successfully');
}
catch (error) {
console.error('FATAL ERROR:', error instanceof Error ? error.message : String(error));
console.error('STACK TRACE:', error instanceof Error ? error.stack : String(error));
process.exit(1);
}
}
// Always run main when this file is executed directly
main().catch((error) => {
console.error('Unhandled error:', error);
process.exit(1);
});
//# sourceMappingURL=simple-server.js.map