zrald
Version:
Advanced Graph RAG MCP Server with sophisticated graph structures, operators, and agentic capabilities for AI agents
48 lines • 1.65 kB
JavaScript
import { GraphRAGMCPServer } from './mcp-server.js';
import { config } from 'dotenv';
// Load environment variables
config();
async function main() {
try {
console.error('DEBUG: Starting Graph RAG 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.message);
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.message);
console.error('STACK TRACE:', error.stack);
process.exit(1);
}
}
// Always run main when this file is executed directly
main().catch((error) => {
console.error('Unhandled error:', error);
process.exit(1);
});
//# sourceMappingURL=index.js.map