Skip to main content
Glama

ClickUp MCP Server

#!/usr/bin/env node /** * index.js * * Main entry point for the ClickUp MCP server integration with Supergateway. * This script loads environment variables and starts the ClickUp MCP server * through Supergateway, exposing it via SSE for n8n integration. */ const { spawn } = require('child_process'); const dotenv = require('dotenv'); const path = require('path'); // Load environment variables dotenv.config(); // Check required environment variables const requiredEnvVars = ['CLICKUP_API_KEY', 'CLICKUP_TEAM_ID']; const missingEnvVars = requiredEnvVars.filter(varName => !process.env[varName]); if (missingEnvVars.length > 0) { console.error(`Error: Missing required environment variables: ${missingEnvVars.join(', ')}`); process.exit(1); } // Get configuration from environment variables const PORT = process.env.PORT || 8002; const BASE_URL = process.env.BASE_URL || `http://localhost:${PORT}`; const SSE_PATH = process.env.SSE_PATH || '/sse'; const MESSAGE_PATH = process.env.MESSAGE_PATH || '/message'; const LOG_LEVEL = process.env.LOG_LEVEL || 'info'; const DOCUMENT_SUPPORT = process.env.DOCUMENT_SUPPORT || 'false'; const CORS_ORIGINS = process.env.CORS_ORIGINS || '*'; // Construct the ClickUp MCP server command // Use the original @taazkareem/clickup-mcp-server package const clickupCmd = `npx -y @taazkareem/clickup-mcp-server --env CLICKUP_API_KEY=${process.env.CLICKUP_API_KEY} --env CLICKUP_TEAM_ID=${process.env.CLICKUP_TEAM_ID} --env DOCUMENT_SUPPORT=${DOCUMENT_SUPPORT} --env LOG_LEVEL=${LOG_LEVEL}`; // Construct the Supergateway command let supergatewayCmd = `npx -y supergateway --stdio "${clickupCmd}" --port ${PORT} --baseUrl ${BASE_URL} --ssePath ${SSE_PATH} --messagePath ${MESSAGE_PATH} --logLevel ${LOG_LEVEL} --healthEndpoint /healthz`; // Add CORS if specified if (CORS_ORIGINS) { if (CORS_ORIGINS === '*') { supergatewayCmd += ' --cors'; } else { // Split CORS_ORIGINS by comma and add each as a separate --cors argument const origins = CORS_ORIGINS.split(','); for (const origin of origins) { supergatewayCmd += ` --cors "${origin.trim()}"`; } } } // Print configuration console.log('Starting ClickUp MCP Server through Supergateway with the following configuration:'); console.log(`- Port: ${PORT}`); console.log(`- Base URL: ${BASE_URL}`); console.log(`- SSE Path: ${SSE_PATH}`); console.log(`- Message Path: ${MESSAGE_PATH}`); console.log(`- Log Level: ${LOG_LEVEL}`); console.log(`- Document Support: ${DOCUMENT_SUPPORT}`); console.log(`- CORS Origins: ${CORS_ORIGINS}`); console.log(''); // Execute the command console.log(`Executing: ${supergatewayCmd}`); const [cmd, ...args] = supergatewayCmd.split(' '); const child = spawn(cmd, args, { shell: true, stdio: 'inherit' }); // Handle process events child.on('error', (err) => { console.error('Failed to start process:', err); process.exit(1); }); child.on('exit', (code, signal) => { if (code !== 0) { console.error(`Process exited with code ${code} and signal ${signal}`); process.exit(code || 1); } }); // Handle termination signals process.on('SIGINT', () => { console.log('Received SIGINT. Shutting down...'); child.kill('SIGINT'); }); process.on('SIGTERM', () => { console.log('Received SIGTERM. Shutting down...'); child.kill('SIGTERM'); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/v4lheru/clickup-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server