index.tsā¢1.19 kB
#!/usr/bin/env node
import path, { dirname } from "path";
import { fileURLToPath } from "url";
import { startServer } from "./infrastructure/server/mcp.server.js";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
async function main() {
try {
console.error("Starting Slack MCP Server...");
// Debug environment variables at startup
console.error("š Environment check at startup:");
console.error(
" SLACK_TOKEN:",
process.env.SLACK_TOKEN ? "present" : "missing"
);
console.error(
" SLACK_BOT_TOKEN:",
process.env.SLACK_BOT_TOKEN ? "present" : "missing"
);
// Start the server with our server.js configuration
await startServer(path.resolve(__dirname, "./server.js"), {
appName: "SlackMCPServer",
});
console.error("š Slack MCP Server started!");
console.error("š” MCP SSE: http://localhost:3001/sse");
console.error("š§ API: http://localhost:3001/api/");
} catch (error) {
console.error("Fatal error in main():", error);
process.exit(1);
}
}
main().catch((error) => {
console.error("Fatal error:", error);
process.exit(1);
});