Files
claude-task-master/mcp-server/server.js
Ralph Khreish ccb87a516a feat: implement tdd workflow (#1309)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-10-18 16:29:03 +02:00

40 lines
755 B
JavaScript
Executable File

#!/usr/bin/env node
import TaskMasterMCPServer from './src/index.js';
import dotenv from 'dotenv';
import logger from './src/logger.js';
// Load environment variables
dotenv.config();
// Set MCP mode to silence tm-core console output
process.env.TASK_MASTER_MCP = 'true';
/**
* Start the MCP server
*/
async function startServer() {
const server = new TaskMasterMCPServer();
// Handle graceful shutdown
process.on('SIGINT', async () => {
await server.stop();
process.exit(0);
});
process.on('SIGTERM', async () => {
await server.stop();
process.exit(0);
});
try {
await server.start();
} catch (error) {
logger.error(`Failed to start MCP server: ${error.message}`);
process.exit(1);
}
}
// Start the server
startServer();