@createtodo/mcp 0.1.0 → 0.1.1
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/dist/index.js +20 -5
- package/package.json +6 -7
package/dist/index.js
CHANGED
|
@@ -18,6 +18,9 @@ async function apiRequest(path, options = {}) {
|
|
|
18
18
|
url.searchParams.set(key, value);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
if (path === "/shape" && !url.searchParams.has("offset")) {
|
|
22
|
+
url.searchParams.set("offset", "-1");
|
|
23
|
+
}
|
|
21
24
|
const headers = {
|
|
22
25
|
"x-api-key": API_KEY
|
|
23
26
|
};
|
|
@@ -219,7 +222,7 @@ var listTools = {
|
|
|
219
222
|
inputSchema: z3.object({}),
|
|
220
223
|
handler: async () => {
|
|
221
224
|
const result = await apiRequest("/todo-lists");
|
|
222
|
-
return JSON.stringify(result
|
|
225
|
+
return JSON.stringify(result, null, 2);
|
|
223
226
|
}
|
|
224
227
|
},
|
|
225
228
|
get_list: {
|
|
@@ -340,6 +343,18 @@ var listTools = {
|
|
|
340
343
|
|
|
341
344
|
// src/tools/todos.ts
|
|
342
345
|
import { z as z4 } from "zod";
|
|
346
|
+
var cachedDefaultStateId;
|
|
347
|
+
async function getDefaultStateId() {
|
|
348
|
+
if (cachedDefaultStateId) return cachedDefaultStateId;
|
|
349
|
+
const states = await apiRequest(
|
|
350
|
+
"/shape",
|
|
351
|
+
{ params: { table: "workflow_states" } }
|
|
352
|
+
);
|
|
353
|
+
const todo = states.find((s) => s.type === "unstarted" && s.name === "Todo");
|
|
354
|
+
if (!todo) throw new Error('No default "Todo" workflow state found');
|
|
355
|
+
cachedDefaultStateId = todo.id;
|
|
356
|
+
return todo.id;
|
|
357
|
+
}
|
|
343
358
|
var todoTools = {
|
|
344
359
|
list_todos: {
|
|
345
360
|
description: "List todos in a specific list/container",
|
|
@@ -350,7 +365,7 @@ var todoTools = {
|
|
|
350
365
|
const result = await apiRequest(
|
|
351
366
|
`/todo-lists/${listId}`
|
|
352
367
|
);
|
|
353
|
-
return JSON.stringify(result
|
|
368
|
+
return JSON.stringify(result, null, 2);
|
|
354
369
|
}
|
|
355
370
|
},
|
|
356
371
|
create_todo: {
|
|
@@ -366,11 +381,11 @@ var todoTools = {
|
|
|
366
381
|
handler: async (input) => {
|
|
367
382
|
const id = crypto.randomUUID();
|
|
368
383
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
369
|
-
const
|
|
384
|
+
const stateId = input.stateId ?? await getDefaultStateId();
|
|
385
|
+
const modifiedColumns = ["name", "container_id", "state_id"];
|
|
370
386
|
if (input.description) modifiedColumns.push("description");
|
|
371
387
|
if (input.priority) modifiedColumns.push("priority");
|
|
372
388
|
if (input.assigneeId) modifiedColumns.push("assignee_id");
|
|
373
|
-
if (input.stateId) modifiedColumns.push("state_id");
|
|
374
389
|
const result = await apiRequest("/apply-changes", {
|
|
375
390
|
method: "POST",
|
|
376
391
|
body: {
|
|
@@ -382,7 +397,7 @@ var todoTools = {
|
|
|
382
397
|
description: input.description ?? null,
|
|
383
398
|
priority: input.priority ?? null,
|
|
384
399
|
assignee_id: input.assigneeId ?? null,
|
|
385
|
-
state_id:
|
|
400
|
+
state_id: stateId,
|
|
386
401
|
created_at: now,
|
|
387
402
|
updated_at: now,
|
|
388
403
|
modified_columns: modifiedColumns,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@createtodo/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "MCP server for managing createtodo tasks, lists, labels, and more",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,11 +24,6 @@
|
|
|
24
24
|
"files": [
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
|
-
"scripts": {
|
|
28
|
-
"build": "tsup src/index.ts --format esm --dts --clean",
|
|
29
|
-
"prepublishOnly": "pnpm build",
|
|
30
|
-
"dev": "tsx src/index.ts"
|
|
31
|
-
},
|
|
32
27
|
"dependencies": {
|
|
33
28
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
34
29
|
"zod": "^3.24.0"
|
|
@@ -37,5 +32,9 @@
|
|
|
37
32
|
"tsup": "^8.4.0",
|
|
38
33
|
"tsx": "^4.19.0",
|
|
39
34
|
"typescript": "^5.9.3"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsup src/index.ts --format esm --dts --clean",
|
|
38
|
+
"dev": "tsx src/index.ts"
|
|
40
39
|
}
|
|
41
|
-
}
|
|
40
|
+
}
|