togello-mcp-server 1.0.3 → 1.0.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 CHANGED
@@ -17,6 +17,20 @@ This server implements the Model Context Protocol (MCP) for managing context in
17
17
  }
18
18
  }
19
19
 
20
+
21
+ # Features
22
+
23
+ ## Resources
24
+
25
+ - category-list: タスクのカテゴリー一覧を提供します。URI: `togello://category-list`
26
+ - activity-item-list: アクティビティ項目の一覧を提供します。URI: `togello://activity-item-list`
27
+
28
+ ## Tools
29
+
30
+ - get-tasks-list: TODO機能で未完了のタスクを取得します。タスク名 / 予定開始日時 / 予定終了日時 / 優先度 / カテゴリ を認識できます。
31
+ - create-task: TODO機能で新しいタスクを作成します。タスク名を指定する必要があります。
32
+ - get-today-calendar: 連携しているGoogleカレンダーの昨日/今日/明日の予定を取得します。予定名 / 開始日時 / 終了日時 を認識できます。
33
+
20
34
  ```
21
35
 
22
36
  ## publish
package/build/client.js CHANGED
@@ -18,4 +18,23 @@ export const httpClient = {
18
18
  }
19
19
  return (await response.json());
20
20
  },
21
+ postJson: async ({ path, body }) => {
22
+ const token = process.env.TOGELLO_API_TOKEN;
23
+ if (!token) {
24
+ throw new Error("environment variable TOGELLO_API_TOKEN is not set");
25
+ }
26
+ const url = `${API_BASE_URL}${path}`;
27
+ const response = await fetch(url, {
28
+ method: "POST",
29
+ headers: {
30
+ Authorization: `Bearer ${token}`,
31
+ "Content-Type": "application/json",
32
+ },
33
+ body: JSON.stringify(body),
34
+ });
35
+ if (!response.ok) {
36
+ throw new Error(`response status: ${response.status}`);
37
+ }
38
+ return (await response.json());
39
+ },
21
40
  };
@@ -0,0 +1,37 @@
1
+ import { httpClient } from "../../client.js";
2
+ export const activityItemListHandler = async (uri, {}) => {
3
+ try {
4
+ const activityItemList = await httpClient.fetchURL({
5
+ path: "/v2/integration/activity-items",
6
+ });
7
+ return {
8
+ contents: [
9
+ {
10
+ type: "text",
11
+ uri: uri.href,
12
+ text: `The following is a single activity item represented in the order:
13
+ [activity item uuid, item name]`,
14
+ },
15
+ {
16
+ type: "text",
17
+ uri: uri.href,
18
+ text: activityItemList
19
+ .map((item) => [item.activityItemUUID, item.itemName])
20
+ .join(","),
21
+ },
22
+ ],
23
+ };
24
+ }
25
+ catch (error) {
26
+ console.error("Error in resource handler:", error);
27
+ return {
28
+ contents: [
29
+ {
30
+ type: "text",
31
+ uri: uri.href,
32
+ text: `Error in resource handler: ${error}`,
33
+ },
34
+ ],
35
+ };
36
+ }
37
+ };
@@ -0,0 +1,37 @@
1
+ import { httpClient } from "../../client.js";
2
+ export const categoryListHandler = async (uri, {}) => {
3
+ try {
4
+ const categoryList = await httpClient.fetchURL({
5
+ path: "/v2/integration/categories",
6
+ });
7
+ return {
8
+ contents: [
9
+ {
10
+ type: "text",
11
+ uri: uri.href,
12
+ text: `The following is a single category represented in the order:
13
+ [category uuid, label of category]`,
14
+ },
15
+ {
16
+ type: "text",
17
+ uri: uri.href,
18
+ text: categoryList
19
+ .map((category) => [category.categoryUUID, category.label])
20
+ .join(","),
21
+ },
22
+ ],
23
+ };
24
+ }
25
+ catch (error) {
26
+ console.error("Error in resource handler:", error);
27
+ return {
28
+ contents: [
29
+ {
30
+ type: "text",
31
+ uri: uri.href,
32
+ text: `Error in resource handler: ${error}`,
33
+ },
34
+ ],
35
+ };
36
+ }
37
+ };
@@ -0,0 +1,36 @@
1
+ import { httpClient } from "../../client.js";
2
+ export const tasksHandler = async (uri, {}) => {
3
+ try {
4
+ const tasks = await httpClient.fetchURL({
5
+ path: "/v2/integration/todo",
6
+ });
7
+ return {
8
+ contents: [
9
+ {
10
+ type: "text",
11
+ uri: uri.href,
12
+ text: tasks
13
+ .map((todo) => JSON.stringify({
14
+ label: todo.label,
15
+ scheduledStartDate: todo.scheduledStartDate,
16
+ scheduledEndDate: todo.scheduledEndDate,
17
+ priorityNumber: todo.priorityNumber,
18
+ }))
19
+ .join(","),
20
+ },
21
+ ],
22
+ };
23
+ }
24
+ catch (error) {
25
+ console.error("Error in resource handler:", error);
26
+ return {
27
+ contents: [
28
+ {
29
+ type: "text",
30
+ uri: uri.href,
31
+ text: `Error in resource handler: ${error}`,
32
+ },
33
+ ],
34
+ };
35
+ }
36
+ };
@@ -0,0 +1,30 @@
1
+ import { httpClient } from "../../client.js";
2
+ export const createTaskHandler = async ({ taskName, }) => {
3
+ try {
4
+ await httpClient.postJson({
5
+ path: "/v2/integration/todo",
6
+ body: {
7
+ label: taskName,
8
+ },
9
+ });
10
+ return {
11
+ content: [
12
+ {
13
+ type: "text",
14
+ text: `Task "${taskName}" created successfully.`,
15
+ },
16
+ ],
17
+ };
18
+ }
19
+ catch (error) {
20
+ console.error("Error creating task:", error);
21
+ return {
22
+ content: [
23
+ {
24
+ type: "text",
25
+ text: `Error creating task: ${error}`,
26
+ },
27
+ ],
28
+ };
29
+ }
30
+ };
package/build/index.js CHANGED
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { z } from "zod";
5
+ import { categoryListHandler } from "./handlers/resource/categoryListHandler.js";
6
+ import { createTaskHandler } from "./handlers/tool/createTaskHandler.js";
4
7
  import { getTodayCalendarHandler } from "./handlers/tool/getTodayCalendarHandler.js";
5
8
  import { getTodoListHandler } from "./handlers/tool/getTodoListHandler.js";
6
9
  const server = new McpServer({
@@ -14,8 +17,11 @@ const server = new McpServer({
14
17
  async function main() {
15
18
  const transport = new StdioServerTransport();
16
19
  // server.resource("togello-todos", "togello://tasks", tasksHandler);
17
- server.tool("get-tasks-list", {}, getTodoListHandler);
18
- server.tool("get-today-calendar", {}, getTodayCalendarHandler);
20
+ server.resource("category-list", "togello://category-list", categoryListHandler);
21
+ server.resource("activity-item-list", "togello://activity-item-list", categoryListHandler);
22
+ server.tool("get-tasks-list", "Retrieves incomplete tasks from the TODO feature. Recognizes task name / scheduled start date and time / scheduled end date and time / priority / category", {}, getTodoListHandler);
23
+ server.tool("create-task", "Creates a new task in the TODO feature.", { taskName: z.string().describe("create task name") }, createTaskHandler);
24
+ server.tool("get-today-calendar", "Retrieves scheduled events for yesterday/today/tomorrow from the linked Google Calendar. Recognizes event name / start date and time / end date and time. ", {}, getTodayCalendarHandler);
19
25
  await server.connect(transport);
20
26
  }
21
27
  main().catch((error) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "togello-mcp-server",
4
- "version": "1.0.3",
4
+ "version": "1.0.4",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "build": "tsc && chmod 755 build/index.js",