feat(wip): initial commits for sub-tasks 1,2,3 for task 23

This commit is contained in:
Ralph Khreish
2025-03-24 21:31:36 +00:00
parent 1d70a7c32c
commit f49684a802
10 changed files with 4476 additions and 44 deletions

44
mcp-server/server.js Executable file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env node
import TaskMasterMCPServer from "./src/index.js";
import dotenv from "dotenv";
import { logger } from "../scripts/modules/utils.js";
// Load environment variables
dotenv.config();
// Constants
const PORT = process.env.MCP_SERVER_PORT || 3000;
const HOST = process.env.MCP_SERVER_HOST || "localhost";
/**
* Start the MCP server
*/
async function startServer() {
const server = new TaskMasterMCPServer();
// Handle graceful shutdown
process.on("SIGINT", async () => {
logger.info("Received SIGINT, shutting down gracefully...");
await server.stop();
process.exit(0);
});
process.on("SIGTERM", async () => {
logger.info("Received SIGTERM, shutting down gracefully...");
await server.stop();
process.exit(0);
});
try {
await server.start({ port: PORT, host: HOST });
logger.info(`MCP server running at http://${HOST}:${PORT}`);
logger.info("Press Ctrl+C to stop");
} catch (error) {
logger.error(`Failed to start MCP server: ${error.message}`);
process.exit(1);
}
}
// Start the server
startServer();