Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ Available configuration options:
| `DISABLED_TOOLS` | Comma-separated list of tools to disable | None |
| `ENABLE_SSE` | Enable the HTTP/SSE transport | `false` |
| `PORT` | Port for the HTTP server | `3231` |
| `HOST` | Host address for the HTTP server (use `0.0.0.0` for external access) | `127.0.0.1` |
| `ENABLE_STDIO` | Enable the STDIO transport | `true` |
| `ENABLE_SECURITY_FEATURES` | Enable security headers and logging | `false` |
| `ENABLE_HTTPS` | Enable HTTPS/TLS encryption | `false` |
Expand Down
4 changes: 4 additions & 0 deletions docs/sse-transport.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The Server-Sent Events (SSE) transport for the ClickUp MCP Server enables integr
| ------ | ----------- | ------- |
| `ENABLE_SSE` | Enable the SSE transport | `false` |
| `SSE_PORT` | Port for the SSE server | `3000` |
| `HOST` | Host address for the HTTP server (use `0.0.0.0` for external access) | `127.0.0.1` |
| `ENABLE_STDIO` | Enable the STDIO transport | `true` |

## Enabling SSE Transport
Expand All @@ -20,6 +21,9 @@ You can enable the SSE transport using environment variables:

```bash
ENABLE_SSE=true SSE_PORT=3000 npx @taazkareem/clickup-mcp-server

# For external access (e.g., in Docker/Kubernetes):
ENABLE_SSE=true SSE_PORT=3000 HOST=0.0.0.0 npx @taazkareem/clickup-mcp-server
```

### Command Line Arguments
Expand Down
3 changes: 3 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ for (let i = 0; i < args.length; i++) {
if (key === 'SSE_PORT') envArgs.ssePort = value;
if (key === 'ENABLE_STDIO') envArgs.enableStdio = value;
if (key === 'PORT') envArgs.port = value;
if (key === 'HOST') envArgs.host = value;
i++;
}
}
Expand Down Expand Up @@ -80,6 +81,7 @@ interface Config {
ssePort: number;
enableStdio: boolean;
port?: string;
host: string;
// Security configuration (opt-in for backwards compatibility)
enableSecurityFeatures: boolean;
enableOriginValidation: boolean;
Expand Down Expand Up @@ -133,6 +135,7 @@ const configuration: Config = {
ssePort: parseInteger(envArgs.ssePort || process.env.SSE_PORT, 3000),
enableStdio: parseBoolean(envArgs.enableStdio || process.env.ENABLE_STDIO, true),
port: envArgs.port || process.env.PORT || '3231',
host: envArgs.host || process.env.HOST || '127.0.0.1',
// Security configuration (opt-in for backwards compatibility)
enableSecurityFeatures: parseBoolean(process.env.ENABLE_SECURITY_FEATURES, false),
enableOriginValidation: parseBoolean(process.env.ENABLE_ORIGIN_VALIDATION, false),
Expand Down
36 changes: 20 additions & 16 deletions src/sse_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,16 @@ export function startSSEServer() {
// Function to create and start HTTP server
function startHttpServer() {
const httpServer = http.createServer(app);
httpServer.listen(PORT, '127.0.0.1', () => {
const HOST = configuration.host;
httpServer.listen(PORT, HOST, () => {
logger.info('ClickUp MCP Server (HTTP) started', {
host: HOST,
port: PORT,
protocol: 'http',
endpoints: {
streamableHttp: `http://127.0.0.1:${PORT}/mcp`,
legacySSE: `http://127.0.0.1:${PORT}/sse`,
health: `http://127.0.0.1:${PORT}/health`
streamableHttp: `http://${HOST}:${PORT}/mcp`,
legacySSE: `http://${HOST}:${PORT}/sse`,
health: `http://${HOST}:${PORT}/health`
},
security: {
featuresEnabled: configuration.enableSecurityFeatures,
Expand All @@ -209,10 +211,10 @@ export function startSSEServer() {
}
});

console.log(`✅ ClickUp MCP Server started on http://127.0.0.1:${PORT}`);
console.log(`📡 Streamable HTTP endpoint: http://127.0.0.1:${PORT}/mcp`);
console.log(`🔄 Legacy SSE endpoint: http://127.0.0.1:${PORT}/sse`);
console.log(`❤️ Health check: http://127.0.0.1:${PORT}/health`);
console.log(`✅ ClickUp MCP Server started on http://${HOST}:${PORT}`);
console.log(`📡 Streamable HTTP endpoint: http://${HOST}:${PORT}/mcp`);
console.log(`🔄 Legacy SSE endpoint: http://${HOST}:${PORT}/sse`);
console.log(`❤️ Health check: http://${HOST}:${PORT}/health`);

if (configuration.enableHttps) {
console.log(`⚠️ HTTP server running alongside HTTPS - consider disabling HTTP in production`);
Expand Down Expand Up @@ -253,14 +255,16 @@ export function startSSEServer() {
}

const httpsServer = https.createServer(httpsOptions, app);
httpsServer.listen(HTTPS_PORT, '127.0.0.1', () => {
const HOST = configuration.host;
httpsServer.listen(HTTPS_PORT, HOST, () => {
logger.info('ClickUp MCP Server (HTTPS) started', {
host: HOST,
port: HTTPS_PORT,
protocol: 'https',
endpoints: {
streamableHttp: `https://127.0.0.1:${HTTPS_PORT}/mcp`,
legacySSE: `https://127.0.0.1:${HTTPS_PORT}/sse`,
health: `https://127.0.0.1:${HTTPS_PORT}/health`
streamableHttp: `https://${HOST}:${HTTPS_PORT}/mcp`,
legacySSE: `https://${HOST}:${HTTPS_PORT}/sse`,
health: `https://${HOST}:${HTTPS_PORT}/health`
},
security: {
featuresEnabled: configuration.enableSecurityFeatures,
Expand All @@ -271,10 +275,10 @@ export function startSSEServer() {
}
});

console.log(`🔒 ClickUp MCP Server (HTTPS) started on https://127.0.0.1:${HTTPS_PORT}`);
console.log(`📡 Streamable HTTPS endpoint: https://127.0.0.1:${HTTPS_PORT}/mcp`);
console.log(`🔄 Legacy SSE HTTPS endpoint: https://127.0.0.1:${HTTPS_PORT}/sse`);
console.log(`❤️ Health check HTTPS: https://127.0.0.1:${HTTPS_PORT}/health`);
console.log(`🔒 ClickUp MCP Server (HTTPS) started on https://${HOST}:${HTTPS_PORT}`);
console.log(`📡 Streamable HTTPS endpoint: https://${HOST}:${HTTPS_PORT}/mcp`);
console.log(`🔄 Legacy SSE HTTPS endpoint: https://${HOST}:${HTTPS_PORT}/sse`);
console.log(`❤️ Health check HTTPS: https://${HOST}:${HTTPS_PORT}/health`);
});
return httpsServer;
} catch (error) {
Expand Down