@taazkareem/clickup-mcp-server 0.2.2 → 0.2.3
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 +1 -1
- package/build/config.js +7 -5
- package/build/index.js +3 -3
- package/build/services/clickup.js +16 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ Directions for use with Cursor Composer Agent:
|
|
|
12
12
|
2. Go to Features in settings
|
|
13
13
|
3. Add under MCP Servers:
|
|
14
14
|
```bash
|
|
15
|
-
npx -y @taazkareem/clickup-mcp-server --env CLICKUP_API_KEY=your_api_key_here --env
|
|
15
|
+
npx -y @taazkareem/clickup-mcp-server --env CLICKUP_API_KEY=your_api_key_here --env TEAM_ID=your_team_id_here
|
|
16
16
|
```
|
|
17
17
|
4. Replace the credentials and click Save
|
|
18
18
|
5. Use Natural Language to interact with your ClickUp Workspace!
|
package/build/config.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// Parse command line arguments for --env flags
|
|
1
2
|
const args = process.argv.slice(2);
|
|
2
3
|
const envArgs = {};
|
|
3
4
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -5,15 +6,16 @@ for (let i = 0; i < args.length; i++) {
|
|
|
5
6
|
const [key, value] = args[i + 1].split('=');
|
|
6
7
|
if (key === 'CLICKUP_API_KEY')
|
|
7
8
|
envArgs.clickupApiKey = value;
|
|
8
|
-
if (key === '
|
|
9
|
-
envArgs.
|
|
10
|
-
i++;
|
|
9
|
+
if (key === 'TEAM_ID')
|
|
10
|
+
envArgs.teamId = value;
|
|
11
|
+
i++; // Skip the next argument since we used it
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
const configuration = {
|
|
14
|
-
clickupApiKey: envArgs.clickupApiKey ||
|
|
15
|
-
|
|
15
|
+
clickupApiKey: envArgs.clickupApiKey || '',
|
|
16
|
+
teamId: envArgs.teamId || '',
|
|
16
17
|
};
|
|
18
|
+
// Check for missing environment variables
|
|
17
19
|
const missingEnvVars = Object.entries(configuration)
|
|
18
20
|
.filter(([_, value]) => !value)
|
|
19
21
|
.map(([key]) => key);
|
package/build/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema
|
|
|
25
25
|
import { ClickUpService } from "./services/clickup.js";
|
|
26
26
|
import config from "./config.js";
|
|
27
27
|
// Initialize ClickUp service
|
|
28
|
-
const clickup = ClickUpService.initialize(config.clickupApiKey, config.
|
|
28
|
+
const clickup = ClickUpService.initialize(config.clickupApiKey, config.teamId);
|
|
29
29
|
/**
|
|
30
30
|
* Create an MCP server with capabilities for tools and prompts.
|
|
31
31
|
* Resources have been removed as they are being replaced with direct tool calls.
|
|
@@ -852,7 +852,7 @@ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
|
852
852
|
try {
|
|
853
853
|
switch (request.params.name) {
|
|
854
854
|
case "summarize_tasks": {
|
|
855
|
-
const spaces = await clickup.getSpaces(config.
|
|
855
|
+
const spaces = await clickup.getSpaces(config.teamId);
|
|
856
856
|
const tasks = [];
|
|
857
857
|
// Gather all tasks
|
|
858
858
|
for (const space of spaces) {
|
|
@@ -893,7 +893,7 @@ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
|
893
893
|
};
|
|
894
894
|
}
|
|
895
895
|
case "analyze_priorities": {
|
|
896
|
-
const spaces = await clickup.getSpaces(config.
|
|
896
|
+
const spaces = await clickup.getSpaces(config.teamId);
|
|
897
897
|
const tasks = [];
|
|
898
898
|
for (const space of spaces) {
|
|
899
899
|
const lists = await clickup.getLists(space.id);
|
|
@@ -6,10 +6,10 @@ import axios from 'axios';
|
|
|
6
6
|
export class ClickUpService {
|
|
7
7
|
client;
|
|
8
8
|
static instance;
|
|
9
|
-
|
|
9
|
+
teamId;
|
|
10
10
|
rateLimitRemaining = 100; // Default to lowest tier limit
|
|
11
11
|
rateLimitReset = 0;
|
|
12
|
-
constructor(apiKey,
|
|
12
|
+
constructor(apiKey, teamId) {
|
|
13
13
|
this.client = axios.create({
|
|
14
14
|
baseURL: 'https://api.clickup.com/api/v2',
|
|
15
15
|
headers: {
|
|
@@ -35,7 +35,7 @@ export class ClickUpService {
|
|
|
35
35
|
}
|
|
36
36
|
throw error;
|
|
37
37
|
});
|
|
38
|
-
this.
|
|
38
|
+
this.teamId = teamId;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Checks if we're close to hitting rate limits and waits if necessary.
|
|
@@ -73,13 +73,13 @@ export class ClickUpService {
|
|
|
73
73
|
/**
|
|
74
74
|
* Initializes the ClickUpService singleton instance.
|
|
75
75
|
* @param apiKey - The ClickUp API key for authentication
|
|
76
|
-
* @param
|
|
76
|
+
* @param teamId - The team/workspace ID to operate on
|
|
77
77
|
* @returns The singleton instance of ClickUpService
|
|
78
78
|
* @throws Error if initialization fails
|
|
79
79
|
*/
|
|
80
|
-
static initialize(apiKey,
|
|
80
|
+
static initialize(apiKey, teamId) {
|
|
81
81
|
if (!ClickUpService.instance) {
|
|
82
|
-
ClickUpService.instance = new ClickUpService(apiKey,
|
|
82
|
+
ClickUpService.instance = new ClickUpService(apiKey, teamId);
|
|
83
83
|
}
|
|
84
84
|
return ClickUpService.instance;
|
|
85
85
|
}
|
|
@@ -244,13 +244,13 @@ export class ClickUpService {
|
|
|
244
244
|
}
|
|
245
245
|
/**
|
|
246
246
|
* Gets all lists in the workspace.
|
|
247
|
-
* @param
|
|
247
|
+
* @param teamId - ID of the team/workspace
|
|
248
248
|
* @returns Promise resolving to array of ClickUpList objects
|
|
249
249
|
* @throws Error if the API request fails
|
|
250
250
|
*/
|
|
251
|
-
async getAllLists(
|
|
251
|
+
async getAllLists(teamId) {
|
|
252
252
|
return this.makeRequest(async () => {
|
|
253
|
-
const response = await this.client.get(`/team/${
|
|
253
|
+
const response = await this.client.get(`/team/${teamId}/list`);
|
|
254
254
|
return response.data.lists;
|
|
255
255
|
});
|
|
256
256
|
}
|
|
@@ -267,9 +267,9 @@ export class ClickUpService {
|
|
|
267
267
|
});
|
|
268
268
|
}
|
|
269
269
|
// Spaces
|
|
270
|
-
async getSpaces(
|
|
270
|
+
async getSpaces(teamId) {
|
|
271
271
|
return this.makeRequest(async () => {
|
|
272
|
-
const response = await this.client.get(`/team/${
|
|
272
|
+
const response = await this.client.get(`/team/${teamId}/space`);
|
|
273
273
|
return response.data.spaces;
|
|
274
274
|
});
|
|
275
275
|
}
|
|
@@ -279,8 +279,8 @@ export class ClickUpService {
|
|
|
279
279
|
return response.data;
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
|
-
async findSpaceByName(
|
|
283
|
-
const spaces = await this.getSpaces(
|
|
282
|
+
async findSpaceByName(teamId, spaceName) {
|
|
283
|
+
const spaces = await this.getSpaces(teamId);
|
|
284
284
|
return spaces.find(space => space.name.toLowerCase() === spaceName.toLowerCase()) || null;
|
|
285
285
|
}
|
|
286
286
|
/**
|
|
@@ -448,7 +448,7 @@ export class ClickUpService {
|
|
|
448
448
|
}
|
|
449
449
|
async findListByNameGlobally(listName) {
|
|
450
450
|
// First try the direct lists
|
|
451
|
-
const lists = await this.getAllLists(this.
|
|
451
|
+
const lists = await this.getAllLists(this.teamId);
|
|
452
452
|
const directList = lists.find(list => list.name.toLowerCase() === listName.toLowerCase());
|
|
453
453
|
if (directList)
|
|
454
454
|
return directList;
|
|
@@ -477,9 +477,9 @@ export class ClickUpService {
|
|
|
477
477
|
* @throws Error if API requests fail
|
|
478
478
|
*/
|
|
479
479
|
async getWorkspaceHierarchy() {
|
|
480
|
-
const spaces = await this.getSpaces(this.
|
|
480
|
+
const spaces = await this.getSpaces(this.teamId);
|
|
481
481
|
const root = {
|
|
482
|
-
id: this.
|
|
482
|
+
id: this.teamId,
|
|
483
483
|
name: 'Workspace',
|
|
484
484
|
type: 'workspace',
|
|
485
485
|
children: []
|
package/package.json
CHANGED