@hauptsache.net/clickup-mcp 1.0.4 → 1.1.0

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.
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerSpaceTools = registerSpaceTools;
4
+ const zod_1 = require("zod");
5
+ const config_1 = require("../shared/config");
6
+ function registerSpaceTools(server) {
7
+ server.tool("listSpaces", "Lists all spaces in the workspace. These might also be referred to as customers or projects.", {
8
+ archived: zod_1.z.boolean().optional().describe("Include archived spaces (default: false)")
9
+ }, async ({ archived = false }) => {
10
+ try {
11
+ const url = `https://api.clickup.com/api/v2/team/${config_1.CONFIG.teamId}/space${archived ? '?archived=true' : ''}`;
12
+ const response = await fetch(url, {
13
+ headers: { Authorization: config_1.CONFIG.apiKey },
14
+ });
15
+ if (!response.ok) {
16
+ throw new Error(`Error fetching spaces: ${response.status} ${response.statusText}`);
17
+ }
18
+ const data = await response.json();
19
+ if (!data.spaces || !Array.isArray(data.spaces)) {
20
+ return {
21
+ content: [{ type: "text", text: "No spaces found in the workspace." }],
22
+ };
23
+ }
24
+ const spaceBlocks = data.spaces.map((space) => ({
25
+ type: "text",
26
+ text: [
27
+ `space_id: ${space.id}`,
28
+ `name: ${space.name}`,
29
+ `private: ${space.private || false}`,
30
+ `avatar: ${space.avatar || 'None'}`,
31
+ `color: ${space.color || 'None'}`,
32
+ `access: ${space.access || 'Unknown'}`,
33
+ ...(space.archived ? ['archived: true'] : []),
34
+ ...(space.multiple_assignees !== undefined ? [`multiple_assignees: ${space.multiple_assignees}`] : []),
35
+ ...(space.features?.due_dates?.enabled !== undefined ? [`due_dates_enabled: ${space.features.due_dates.enabled}`] : []),
36
+ ...(space.features?.time_tracking?.enabled !== undefined ? [`time_tracking_enabled: ${space.features.time_tracking.enabled}`] : []),
37
+ ].join('\n')
38
+ }));
39
+ return {
40
+ content: [
41
+ {
42
+ type: "text",
43
+ text: `Found ${data.spaces.length} space(s) in the workspace:`
44
+ },
45
+ ...spaceBlocks
46
+ ],
47
+ };
48
+ }
49
+ catch (error) {
50
+ console.error('Error fetching spaces:', error);
51
+ return {
52
+ content: [
53
+ {
54
+ type: "text",
55
+ text: `Error fetching spaces: ${error instanceof Error ? error.message : 'Unknown error'}`,
56
+ },
57
+ ],
58
+ };
59
+ }
60
+ });
61
+ }
@@ -0,0 +1,9 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ContentBlock } from "../shared/types";
3
+ export declare function registerTaskToolsRead(server: McpServer, userData: any): void;
4
+ export declare function registerTaskToolsWrite(server: McpServer, userData: any): void;
5
+ /**
6
+ * Helper function to generate consistent task metadata
7
+ */
8
+ export declare function generateTaskMetadata(task: any): Promise<ContentBlock>;
9
+ //# sourceMappingURL=task-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-tools.d.ts","sourceRoot":"","sources":["../../src/tools/task-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,YAAY,EAAqB,MAAM,iBAAiB,CAAC;AAwIlE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,QAoDrE;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,QAwQtE;AAoLD;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,CA6G3E"}