mirror of
https://github.com/eyaltoledano/claude-task-master.git
synced 2025-07-18 14:32:31 +00:00
37 lines
689 B
JavaScript
37 lines
689 B
JavaScript
![]() |
#!/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();
|
||
|
|
||
|
/**
|
||
|
* 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();
|