@taazkareem/clickup-mcp-server 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/build/logger.js +26 -1
- package/build/server.js +1 -1
- package/build/services/clickup/base.js +22 -1
- package/build/services/clickup/bulk.js +111 -69
- package/build/services/clickup/index.js +2 -2
- package/build/services/clickup/task/index.js +32 -0
- package/build/services/clickup/task/task-attachments.js +97 -0
- package/build/services/clickup/task/task-comments.js +104 -0
- package/build/services/clickup/task/task-core.js +439 -0
- package/build/services/clickup/task/task-custom-fields.js +97 -0
- package/build/services/clickup/task/task-search.js +462 -0
- package/build/services/clickup/task/task-service.js +25 -0
- package/build/services/clickup/task/task-tags.js +101 -0
- package/build/services/clickup/workspace.js +81 -36
- package/build/tools/folder.js +1 -1
- package/build/tools/list.js +2 -4
- package/build/tools/task/attachments.js +49 -20
- package/build/tools/task/attachments.types.js +9 -0
- package/build/tools/task/bulk-operations.js +102 -18
- package/build/tools/task/handlers.js +216 -53
- package/build/tools/task/index.js +1 -1
- package/build/tools/task/main.js +161 -32
- package/build/tools/task/single-operations.js +82 -17
- package/build/tools/task/utilities.js +47 -75
- package/build/tools/utils.js +2 -2
- package/build/utils/date-utils.js +149 -30
- package/build/utils/resolver-utils.js +33 -40
- package/build/utils/sponsor-service.js +1 -1
- package/package.json +1 -1
- package/build/mcp-tools.js +0 -64
- package/build/server-state.js +0 -93
- package/build/server.log +0 -0
- package/build/services/clickup/task.js +0 -701
- package/build/tools/bulk-tasks.js +0 -36
- package/build/tools/debug.js +0 -76
- package/build/tools/logs.js +0 -55
- package/build/tools/task.js +0 -1554
- package/build/utils/params-utils.js +0 -39
- package/build/utils/sponsor-analytics.js +0 -100
- package/build/utils/sponsor-utils.js +0 -57
|
@@ -59,7 +59,7 @@ export class SponsorService {
|
|
|
59
59
|
if (this.isEnabled && includeSponsorMessage) {
|
|
60
60
|
content.push({
|
|
61
61
|
type: "text",
|
|
62
|
-
text:
|
|
62
|
+
text: `♥ Support this project by sponsoring the developer at ${this.sponsorUrl}`
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
return { content };
|
package/package.json
CHANGED
package/build/mcp-tools.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Logger } from "./logger.js";
|
|
2
|
-
// Create a logger instance
|
|
3
|
-
const logger = new Logger('MCPTools');
|
|
4
|
-
/**
|
|
5
|
-
* Register a handler for a tool that may receive JSON string parameters
|
|
6
|
-
* This wrapper ensures that array and object parameters are properly parsed
|
|
7
|
-
*
|
|
8
|
-
* @param server MCP Server instance
|
|
9
|
-
* @param name Tool name
|
|
10
|
-
* @param handler Handler function
|
|
11
|
-
*/
|
|
12
|
-
export function registerToolHandler(server, name, handler) {
|
|
13
|
-
// Create a wrapper handler that pre-processes parameters
|
|
14
|
-
const wrappedHandler = async (params) => {
|
|
15
|
-
logger.debug(`Processing parameters for tool ${name}`, { params });
|
|
16
|
-
try {
|
|
17
|
-
// Process the parameters before passing them to the actual handler
|
|
18
|
-
const processedParams = {};
|
|
19
|
-
// Process each parameter - try to parse strings that might be JSON
|
|
20
|
-
for (const [key, value] of Object.entries(params)) {
|
|
21
|
-
if (typeof value === 'string') {
|
|
22
|
-
try {
|
|
23
|
-
// Check if this might be a JSON array or object
|
|
24
|
-
if ((value.startsWith('[') && value.endsWith(']')) ||
|
|
25
|
-
(value.startsWith('{') && value.endsWith('}'))) {
|
|
26
|
-
try {
|
|
27
|
-
processedParams[key] = JSON.parse(value);
|
|
28
|
-
logger.debug(`Parsed JSON parameter: ${key}`, { original: value, parsed: processedParams[key] });
|
|
29
|
-
}
|
|
30
|
-
catch (parseError) {
|
|
31
|
-
// If parsing fails, use the original string
|
|
32
|
-
processedParams[key] = value;
|
|
33
|
-
logger.debug(`Failed to parse JSON for parameter: ${key}, using original`, { error: parseError.message });
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
processedParams[key] = value;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
// If there's any error, use the original value
|
|
42
|
-
processedParams[key] = value;
|
|
43
|
-
logger.debug(`Error processing parameter: ${key}`, { error: error.message });
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
// Non-string values are used as-is
|
|
48
|
-
processedParams[key] = value;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
logger.debug(`Processed parameters for tool ${name}`, { processedParams });
|
|
52
|
-
// Call the original handler with processed parameters
|
|
53
|
-
return handler(processedParams);
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
logger.error(`Error in wrapped handler for tool ${name}:`, { error: error.stack || error.message });
|
|
57
|
-
throw error;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
// Use setRequestHandler to register the wrapped handler
|
|
61
|
-
logger.info(`Registering wrapped handler for tool: ${name}`);
|
|
62
|
-
// Override the tool's handler in the CallTool switch statement
|
|
63
|
-
// The server.ts file will use the switch case to call this handler
|
|
64
|
-
}
|
package/build/server-state.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Server State Management Module
|
|
3
|
-
*
|
|
4
|
-
* This module provides shared state management for the MCP server,
|
|
5
|
-
* particularly for controlling shutdown behavior and tracking busy states.
|
|
6
|
-
*/
|
|
7
|
-
// State variables
|
|
8
|
-
let serverBusyState = false; // Tracks if server is doing critical work
|
|
9
|
-
let gracePeriodActive = false; // Tracks if we're in post-initialization grace period
|
|
10
|
-
let gracePeriodTimer = null;
|
|
11
|
-
export const GRACE_PERIOD_MS = 10000; // 10 second grace period after startup
|
|
12
|
-
/**
|
|
13
|
-
* Logging helper that avoids circular dependency
|
|
14
|
-
*/
|
|
15
|
-
function safeLog(level, message, data) {
|
|
16
|
-
// Use console as a fallback to avoid circular dependency with logger
|
|
17
|
-
const timestamp = new Date().toISOString();
|
|
18
|
-
if (level === 'error') {
|
|
19
|
-
console.error(`[${timestamp}] ${level.toUpperCase()}: ${message}`, data || '');
|
|
20
|
-
}
|
|
21
|
-
else if (level === 'debug' && process.env.DEBUG) {
|
|
22
|
-
console.debug(`[${timestamp}] ${level.toUpperCase()}: ${message}`, data || '');
|
|
23
|
-
}
|
|
24
|
-
else if (level !== 'debug') {
|
|
25
|
-
console.log(`[${timestamp}] ${level.toUpperCase()}: ${message}`, data || '');
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Set the server as busy doing critical work that shouldn't be interrupted
|
|
30
|
-
* @param busy Whether the server is currently busy with critical operations
|
|
31
|
-
*/
|
|
32
|
-
export function setServerBusy(busy) {
|
|
33
|
-
serverBusyState = busy;
|
|
34
|
-
safeLog('debug', `Server busy state set to: ${busy}`);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Start grace period after initialization to prevent immediate shutdown
|
|
38
|
-
*/
|
|
39
|
-
export function startGracePeriod() {
|
|
40
|
-
gracePeriodActive = true;
|
|
41
|
-
safeLog('debug', `Starting ${GRACE_PERIOD_MS}ms grace period to prevent premature shutdown`);
|
|
42
|
-
if (gracePeriodTimer) {
|
|
43
|
-
clearTimeout(gracePeriodTimer);
|
|
44
|
-
}
|
|
45
|
-
gracePeriodTimer = setTimeout(() => {
|
|
46
|
-
gracePeriodActive = false;
|
|
47
|
-
safeLog('debug', 'Grace period ended, server will now respond to shutdown signals');
|
|
48
|
-
gracePeriodTimer = null;
|
|
49
|
-
}, GRACE_PERIOD_MS);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Cancel the grace period if needed
|
|
53
|
-
*/
|
|
54
|
-
export function cancelGracePeriod() {
|
|
55
|
-
if (gracePeriodTimer) {
|
|
56
|
-
clearTimeout(gracePeriodTimer);
|
|
57
|
-
gracePeriodTimer = null;
|
|
58
|
-
}
|
|
59
|
-
gracePeriodActive = false;
|
|
60
|
-
safeLog('debug', 'Grace period canceled, server will now respond to shutdown signals');
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Check if the server should ignore shutdown signals
|
|
64
|
-
* @returns true if shutdown signals should be ignored
|
|
65
|
-
*/
|
|
66
|
-
export function shouldIgnoreShutdown() {
|
|
67
|
-
// Ignore shutdown if explicitly configured via environment variable
|
|
68
|
-
if (process.env.FORCE_KEEP_ALIVE === 'true') {
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
// Ignore shutdown during the grace period after startup
|
|
72
|
-
if (gracePeriodActive) {
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
// Ignore shutdown if the server is doing critical work
|
|
76
|
-
if (serverBusyState) {
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
// Otherwise, allow normal shutdown
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Check if grace period is currently active
|
|
84
|
-
*/
|
|
85
|
-
export function isGracePeriodActive() {
|
|
86
|
-
return gracePeriodActive;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Check if server is currently in busy state
|
|
90
|
-
*/
|
|
91
|
-
export function isServerBusy() {
|
|
92
|
-
return serverBusyState;
|
|
93
|
-
}
|
package/build/server.log
DELETED
|
File without changes
|