@kintone/mcp-server 1.3.15 → 1.5.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.
- package/CHANGELOG.md +21 -0
- package/README.md +2 -0
- package/dist/schema/search/index.js +2 -0
- package/dist/schema/search/input.js +113 -0
- package/dist/schema/search/output.js +162 -0
- package/dist/server/tool-filters.js +1 -1
- package/dist/tools/index.js +6 -0
- package/dist/tools/kintone/app/get-general-settings.js +0 -1
- package/dist/tools/kintone/record/add-record-comment.js +58 -0
- package/dist/tools/kintone/record/get-record-comments.js +82 -0
- package/dist/tools/kintone/search/search.js +32 -0
- package/dist/version.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.5.0](https://github.com/kintone/mcp-server/compare/1.4.0...1.5.0) (2026-06-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add kintone record comment tools (get/add) ([#414](https://github.com/kintone/mcp-server/issues/414)) ([d2ae555](https://github.com/kintone/mcp-server/commit/d2ae55519c1312e38fe4666f853086b44458fadc))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update dependency @modelcontextprotocol/sdk to v1.29.0 ([#317](https://github.com/kintone/mcp-server/issues/317)) ([1688179](https://github.com/kintone/mcp-server/commit/168817913c7a7927dc7304cce949e0efbcaa6793))
|
|
14
|
+
* remove stray console.log polluting MCP stdio stream ([#463](https://github.com/kintone/mcp-server/issues/463)) ([ab15d5a](https://github.com/kintone/mcp-server/commit/ab15d5a9525d45e64d2e8396d0ae568a20671d2f))
|
|
15
|
+
* use --node-linker=hoisted instead of --shamefully-hoist ([#459](https://github.com/kintone/mcp-server/issues/459)) ([a276b1c](https://github.com/kintone/mcp-server/commit/a276b1ca4939b68f858a2ddbb2186efccb57adc2))
|
|
16
|
+
|
|
17
|
+
## [1.4.0](https://github.com/kintone/mcp-server/compare/1.3.15...1.4.0) (2026-05-27)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* add search tool ([#440](https://github.com/kintone/mcp-server/issues/440)) ([011538e](https://github.com/kintone/mcp-server/commit/011538e98c8f74ea04fcdb0cd44df61a32332370))
|
|
23
|
+
|
|
3
24
|
## [1.3.15](https://github.com/kintone/mcp-server/compare/1.3.14...1.3.15) (2026-05-24)
|
|
4
25
|
|
|
5
26
|
|
package/README.md
CHANGED
|
@@ -209,6 +209,8 @@ export HTTPS_PROXY="http://username:password@proxy.example.com:8080"
|
|
|
209
209
|
| `kintone-update-records` | 複数のレコードを更新 |
|
|
210
210
|
| `kintone-delete-records` | 複数のレコードを削除 |
|
|
211
211
|
| `kintone-update-statuses` | 複数のレコードのステータスを更新 |
|
|
212
|
+
| `kintone-get-record-comments` | レコードのコメントを取得 |
|
|
213
|
+
| `kintone-add-record-comment` | レコードにコメントを追加 |
|
|
212
214
|
| `kintone-add-app` | 動作テスト環境にアプリを作成 |
|
|
213
215
|
| `kintone-deploy-app` | アプリ設定を運用環境へ反映 |
|
|
214
216
|
| `kintone-update-general-settings` | アプリの一般設定を変更 |
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const searchQuerySchema = z.object({
|
|
3
|
+
operator: z
|
|
4
|
+
.enum(["AND", "OR", "NOT"])
|
|
5
|
+
.describe("Search operator (AND: all keywords match, OR: any keyword matches, NOT: keywords do not match)"),
|
|
6
|
+
keywords: z
|
|
7
|
+
.array(z.string())
|
|
8
|
+
.min(1)
|
|
9
|
+
.describe("Keywords to search for (at least 1 required)"),
|
|
10
|
+
});
|
|
11
|
+
const searchScopeSchema = z.discriminatedUnion("scope", [
|
|
12
|
+
z.object({
|
|
13
|
+
scope: z.literal("SPACE"),
|
|
14
|
+
ids: z
|
|
15
|
+
.array(z.union([z.number(), z.string()]))
|
|
16
|
+
.optional()
|
|
17
|
+
.nullable()
|
|
18
|
+
.describe("Space IDs to search in"),
|
|
19
|
+
}),
|
|
20
|
+
z.object({
|
|
21
|
+
scope: z.literal("APP"),
|
|
22
|
+
ids: z
|
|
23
|
+
.array(z.union([z.number(), z.string()]))
|
|
24
|
+
.optional()
|
|
25
|
+
.nullable()
|
|
26
|
+
.describe("App IDs to search in"),
|
|
27
|
+
}),
|
|
28
|
+
z.object({
|
|
29
|
+
scope: z.literal("PEOPLE"),
|
|
30
|
+
codes: z
|
|
31
|
+
.array(z.string())
|
|
32
|
+
.optional()
|
|
33
|
+
.nullable()
|
|
34
|
+
.describe("People codes to search in"),
|
|
35
|
+
}),
|
|
36
|
+
z.object({
|
|
37
|
+
scope: z.literal("MESSAGE"),
|
|
38
|
+
codes: z
|
|
39
|
+
.array(z.string())
|
|
40
|
+
.optional()
|
|
41
|
+
.nullable()
|
|
42
|
+
.describe("Message codes to search in"),
|
|
43
|
+
}),
|
|
44
|
+
]);
|
|
45
|
+
const searchSortSchema = z.union([
|
|
46
|
+
z.object({
|
|
47
|
+
by: z.literal("RELEVANCE").optional().describe("Sort by relevance"),
|
|
48
|
+
order: z.literal("DESC").optional().describe("Order (only DESC)"),
|
|
49
|
+
}),
|
|
50
|
+
z.object({
|
|
51
|
+
by: z.literal("CREATED_AT").describe("Sort by created date"),
|
|
52
|
+
order: z
|
|
53
|
+
.enum(["ASC", "DESC"])
|
|
54
|
+
.optional()
|
|
55
|
+
.describe("Sort order (ASC or DESC)"),
|
|
56
|
+
}),
|
|
57
|
+
]);
|
|
58
|
+
const searchHitTypeSchema = z.enum([
|
|
59
|
+
"RECORD",
|
|
60
|
+
"RECORD_COMMENT",
|
|
61
|
+
"SPACE",
|
|
62
|
+
"THREAD",
|
|
63
|
+
"THREAD_COMMENT",
|
|
64
|
+
"PEOPLE_COMMENT",
|
|
65
|
+
"MESSAGE_COMMENT",
|
|
66
|
+
"ATTACHMENT",
|
|
67
|
+
]);
|
|
68
|
+
export const searchInputSchema = {
|
|
69
|
+
query: z
|
|
70
|
+
.tuple([searchQuerySchema])
|
|
71
|
+
.rest(searchQuerySchema)
|
|
72
|
+
.describe("Search queries (at least 1 required)"),
|
|
73
|
+
types: z
|
|
74
|
+
.array(searchHitTypeSchema)
|
|
75
|
+
.optional()
|
|
76
|
+
.nullable()
|
|
77
|
+
.describe("Filter by hit types"),
|
|
78
|
+
scopes: z
|
|
79
|
+
.array(searchScopeSchema)
|
|
80
|
+
.optional()
|
|
81
|
+
.nullable()
|
|
82
|
+
.describe("Scopes to search in"),
|
|
83
|
+
excludeScopes: z
|
|
84
|
+
.array(searchScopeSchema)
|
|
85
|
+
.optional()
|
|
86
|
+
.nullable()
|
|
87
|
+
.describe("Scopes to exclude from search"),
|
|
88
|
+
createdAfter: z
|
|
89
|
+
.string()
|
|
90
|
+
.optional()
|
|
91
|
+
.describe("Filter results created after this date (ISO 8601 format)"),
|
|
92
|
+
createdBefore: z
|
|
93
|
+
.string()
|
|
94
|
+
.optional()
|
|
95
|
+
.describe("Filter results created before this date (ISO 8601 format)"),
|
|
96
|
+
creators: z
|
|
97
|
+
.array(z.string())
|
|
98
|
+
.optional()
|
|
99
|
+
.nullable()
|
|
100
|
+
.describe("Filter by creator codes"),
|
|
101
|
+
sort: searchSortSchema.optional().describe("Sort configuration"),
|
|
102
|
+
limit: z
|
|
103
|
+
.number()
|
|
104
|
+
.min(1)
|
|
105
|
+
.max(20)
|
|
106
|
+
.default(20)
|
|
107
|
+
.describe("Maximum number of results to return"),
|
|
108
|
+
pageToken: z
|
|
109
|
+
.string()
|
|
110
|
+
.optional()
|
|
111
|
+
.nullable()
|
|
112
|
+
.describe("Token for pagination. If undefined, null, or empty string, returns the first page. For subsequent pages, specify the nextPageToken from the previous response."),
|
|
113
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const searchUserSchema = z.object({
|
|
3
|
+
code: z.string(),
|
|
4
|
+
name: z.string(),
|
|
5
|
+
});
|
|
6
|
+
const idSchema = z.union([z.number(), z.string()]);
|
|
7
|
+
const searchHitRecordSchema = z.object({
|
|
8
|
+
appId: idSchema,
|
|
9
|
+
appName: z.string(),
|
|
10
|
+
recordId: idSchema,
|
|
11
|
+
recordTitle: z.string(),
|
|
12
|
+
createdAt: z.string(),
|
|
13
|
+
creator: searchUserSchema,
|
|
14
|
+
matchedFields: z.array(z.object({ code: z.string(), label: z.string() })),
|
|
15
|
+
spaceId: idSchema.optional(),
|
|
16
|
+
spaceName: z.string().optional(),
|
|
17
|
+
});
|
|
18
|
+
const searchHitRecordCommentSchema = z.object({
|
|
19
|
+
appId: idSchema,
|
|
20
|
+
appName: z.string(),
|
|
21
|
+
recordId: idSchema,
|
|
22
|
+
recordTitle: z.string(),
|
|
23
|
+
commentId: idSchema,
|
|
24
|
+
createdAt: z.string(),
|
|
25
|
+
creator: searchUserSchema,
|
|
26
|
+
spaceId: idSchema.optional(),
|
|
27
|
+
spaceName: z.string().optional(),
|
|
28
|
+
});
|
|
29
|
+
const searchHitSpaceSchema = z.object({
|
|
30
|
+
spaceId: idSchema,
|
|
31
|
+
spaceName: z.string(),
|
|
32
|
+
createdAt: z.string(),
|
|
33
|
+
creator: searchUserSchema,
|
|
34
|
+
});
|
|
35
|
+
const searchHitThreadSchema = z.object({
|
|
36
|
+
spaceId: idSchema,
|
|
37
|
+
spaceName: z.string(),
|
|
38
|
+
threadId: idSchema,
|
|
39
|
+
threadName: z.string(),
|
|
40
|
+
createdAt: z.string(),
|
|
41
|
+
creator: searchUserSchema,
|
|
42
|
+
});
|
|
43
|
+
const searchHitThreadCommentSchema = z.object({
|
|
44
|
+
commentId: idSchema,
|
|
45
|
+
replyId: idSchema.optional(),
|
|
46
|
+
spaceId: idSchema,
|
|
47
|
+
spaceName: z.string(),
|
|
48
|
+
threadId: idSchema,
|
|
49
|
+
threadName: z.string(),
|
|
50
|
+
createdAt: z.string(),
|
|
51
|
+
creator: searchUserSchema,
|
|
52
|
+
});
|
|
53
|
+
const searchHitPeopleCommentSchema = z.object({
|
|
54
|
+
commentId: idSchema,
|
|
55
|
+
replyId: idSchema.optional(),
|
|
56
|
+
owner: searchUserSchema,
|
|
57
|
+
createdAt: z.string(),
|
|
58
|
+
creator: searchUserSchema,
|
|
59
|
+
});
|
|
60
|
+
const searchHitMessageCommentSchema = z.object({
|
|
61
|
+
commentId: idSchema,
|
|
62
|
+
recipient: searchUserSchema,
|
|
63
|
+
createdAt: z.string(),
|
|
64
|
+
creator: searchUserSchema,
|
|
65
|
+
});
|
|
66
|
+
const attachmentBaseSchema = z.object({
|
|
67
|
+
fileKey: z.string(),
|
|
68
|
+
name: z.string(),
|
|
69
|
+
createdAt: z.string(),
|
|
70
|
+
creator: searchUserSchema,
|
|
71
|
+
});
|
|
72
|
+
const hitBase = { url: z.string(), snippets: z.array(z.string()) };
|
|
73
|
+
const searchHitSchema = z.union([
|
|
74
|
+
z.object({
|
|
75
|
+
...hitBase,
|
|
76
|
+
type: z.literal("RECORD"),
|
|
77
|
+
record: searchHitRecordSchema,
|
|
78
|
+
}),
|
|
79
|
+
z.object({
|
|
80
|
+
...hitBase,
|
|
81
|
+
type: z.literal("RECORD_COMMENT"),
|
|
82
|
+
recordComment: searchHitRecordCommentSchema,
|
|
83
|
+
}),
|
|
84
|
+
z.object({
|
|
85
|
+
...hitBase,
|
|
86
|
+
type: z.literal("SPACE"),
|
|
87
|
+
space: searchHitSpaceSchema,
|
|
88
|
+
}),
|
|
89
|
+
z.object({
|
|
90
|
+
...hitBase,
|
|
91
|
+
type: z.literal("THREAD"),
|
|
92
|
+
thread: searchHitThreadSchema,
|
|
93
|
+
}),
|
|
94
|
+
z.object({
|
|
95
|
+
...hitBase,
|
|
96
|
+
type: z.literal("THREAD_COMMENT"),
|
|
97
|
+
threadComment: searchHitThreadCommentSchema,
|
|
98
|
+
}),
|
|
99
|
+
z.object({
|
|
100
|
+
...hitBase,
|
|
101
|
+
type: z.literal("PEOPLE_COMMENT"),
|
|
102
|
+
peopleComment: searchHitPeopleCommentSchema,
|
|
103
|
+
}),
|
|
104
|
+
z.object({
|
|
105
|
+
...hitBase,
|
|
106
|
+
type: z.literal("MESSAGE_COMMENT"),
|
|
107
|
+
messageComment: searchHitMessageCommentSchema,
|
|
108
|
+
}),
|
|
109
|
+
z.object({
|
|
110
|
+
...hitBase,
|
|
111
|
+
type: z.literal("ATTACHMENT"),
|
|
112
|
+
attachment: attachmentBaseSchema.extend({
|
|
113
|
+
attachedTo: z.literal("RECORD"),
|
|
114
|
+
}),
|
|
115
|
+
record: searchHitRecordSchema,
|
|
116
|
+
}),
|
|
117
|
+
z.object({
|
|
118
|
+
...hitBase,
|
|
119
|
+
type: z.literal("ATTACHMENT"),
|
|
120
|
+
attachment: attachmentBaseSchema.extend({ attachedTo: z.literal("SPACE") }),
|
|
121
|
+
space: searchHitSpaceSchema,
|
|
122
|
+
}),
|
|
123
|
+
z.object({
|
|
124
|
+
...hitBase,
|
|
125
|
+
type: z.literal("ATTACHMENT"),
|
|
126
|
+
attachment: attachmentBaseSchema.extend({
|
|
127
|
+
attachedTo: z.literal("THREAD"),
|
|
128
|
+
}),
|
|
129
|
+
thread: searchHitThreadSchema,
|
|
130
|
+
}),
|
|
131
|
+
z.object({
|
|
132
|
+
...hitBase,
|
|
133
|
+
type: z.literal("ATTACHMENT"),
|
|
134
|
+
attachment: attachmentBaseSchema.extend({
|
|
135
|
+
attachedTo: z.literal("THREAD_COMMENT"),
|
|
136
|
+
}),
|
|
137
|
+
threadComment: searchHitThreadCommentSchema,
|
|
138
|
+
}),
|
|
139
|
+
z.object({
|
|
140
|
+
...hitBase,
|
|
141
|
+
type: z.literal("ATTACHMENT"),
|
|
142
|
+
attachment: attachmentBaseSchema.extend({
|
|
143
|
+
attachedTo: z.literal("PEOPLE_COMMENT"),
|
|
144
|
+
}),
|
|
145
|
+
peopleComment: searchHitPeopleCommentSchema,
|
|
146
|
+
}),
|
|
147
|
+
z.object({
|
|
148
|
+
...hitBase,
|
|
149
|
+
type: z.literal("ATTACHMENT"),
|
|
150
|
+
attachment: attachmentBaseSchema.extend({
|
|
151
|
+
attachedTo: z.literal("MESSAGE_COMMENT"),
|
|
152
|
+
}),
|
|
153
|
+
messageComment: searchHitMessageCommentSchema,
|
|
154
|
+
}),
|
|
155
|
+
]);
|
|
156
|
+
export const searchOutputSchema = {
|
|
157
|
+
hits: z.array(searchHitSchema).describe("Array of search hits"),
|
|
158
|
+
nextPageToken: z
|
|
159
|
+
.string()
|
|
160
|
+
.nullable()
|
|
161
|
+
.describe("Token for fetching the next page of results"),
|
|
162
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const filterRules = [
|
|
2
2
|
{
|
|
3
3
|
condition: (condition) => condition.isApiTokenAuth,
|
|
4
|
-
excludeTools: ["kintone-get-apps", "kintone-add-app"],
|
|
4
|
+
excludeTools: ["kintone-get-apps", "kintone-add-app", "kintone-search"],
|
|
5
5
|
},
|
|
6
6
|
];
|
|
7
7
|
export function shouldEnableTool(toolName, condition) {
|
package/dist/tools/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { addRecordComment } from "./kintone/record/add-record-comment.js";
|
|
1
2
|
import { addRecords } from "./kintone/record/add-records.js";
|
|
2
3
|
import { deleteRecords } from "./kintone/record/delete-records.js";
|
|
4
|
+
import { getRecordComments } from "./kintone/record/get-record-comments.js";
|
|
3
5
|
import { getRecords } from "./kintone/record/get-records.js";
|
|
4
6
|
import { updateRecords } from "./kintone/record/update-records.js";
|
|
5
7
|
import { getApp } from "./kintone/app/get-app.js";
|
|
@@ -18,6 +20,7 @@ import { addApp } from "./kintone/app/add-app.js";
|
|
|
18
20
|
import { deployApp } from "./kintone/app/deploy-app.js";
|
|
19
21
|
import { updateGeneralSettings } from "./kintone/app/update-general-settings.js";
|
|
20
22
|
import { downloadFile } from "./kintone/file/download-file.js";
|
|
23
|
+
import { search } from "./kintone/search/search.js";
|
|
21
24
|
export { createToolCallback } from "./factory.js";
|
|
22
25
|
export const tools = [
|
|
23
26
|
getApp,
|
|
@@ -35,9 +38,12 @@ export const tools = [
|
|
|
35
38
|
addRecords,
|
|
36
39
|
deleteRecords,
|
|
37
40
|
getRecords,
|
|
41
|
+
getRecordComments,
|
|
42
|
+
addRecordComment,
|
|
38
43
|
updateRecords,
|
|
39
44
|
addApp,
|
|
40
45
|
deployApp,
|
|
41
46
|
updateGeneralSettings,
|
|
42
47
|
downloadFile,
|
|
48
|
+
search,
|
|
43
49
|
];
|
|
@@ -89,7 +89,6 @@ const toolConfig = {
|
|
|
89
89
|
};
|
|
90
90
|
const callback = async ({ app, lang, preview }, { client }) => {
|
|
91
91
|
const settings = await client.app.getAppSettings({ app, lang, preview });
|
|
92
|
-
console.log(settings);
|
|
93
92
|
const result = {
|
|
94
93
|
name: settings.name,
|
|
95
94
|
description: settings.description,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { createTool } from "../../factory.js";
|
|
3
|
+
const mentionSchema = z.object({
|
|
4
|
+
code: z
|
|
5
|
+
.string()
|
|
6
|
+
.describe("Login name (for USER), group/role code (for GROUP), or organization code (for ORGANIZATION). Display names are not accepted."),
|
|
7
|
+
type: z
|
|
8
|
+
.enum(["USER", "GROUP", "ORGANIZATION"])
|
|
9
|
+
.describe("Type of the mention target"),
|
|
10
|
+
});
|
|
11
|
+
const inputSchema = {
|
|
12
|
+
app: z
|
|
13
|
+
.string()
|
|
14
|
+
.describe("The ID of the app that contains the record (numeric value as string)"),
|
|
15
|
+
record: z.string().describe("The ID of the record to add a comment to"),
|
|
16
|
+
text: z
|
|
17
|
+
.string()
|
|
18
|
+
.min(1)
|
|
19
|
+
.max(65535)
|
|
20
|
+
.describe("Comment text. To mention users/groups/organizations, list the corresponding entries in 'mentions'. Do NOT include '@code' tokens in this text — not even as a greeting prefix such as '@user1 さん、' or '@group_name '. Mentions specified via the 'mentions' parameter are auto-rendered into the posted comment by kintone; any '@code' written in this text becomes a plain-text literal that does not link, does not notify, and visually duplicates the auto-rendered mention."),
|
|
21
|
+
mentions: z
|
|
22
|
+
.array(mentionSchema)
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("Mentions to attach to the comment. Each entry pairs a code with its type (USER/GROUP/ORGANIZATION)."),
|
|
25
|
+
};
|
|
26
|
+
const outputSchema = {
|
|
27
|
+
id: z.string().describe("ID of the added comment"),
|
|
28
|
+
};
|
|
29
|
+
const toolName = "kintone-add-record-comment";
|
|
30
|
+
const toolConfig = {
|
|
31
|
+
title: "Add Record Comment",
|
|
32
|
+
description: "Add a single comment to a kintone record. The kintone API accepts one comment per call; to add comments to multiple records, call this tool repeatedly.",
|
|
33
|
+
inputSchema,
|
|
34
|
+
outputSchema,
|
|
35
|
+
};
|
|
36
|
+
const callback = async ({ app, record, text, mentions }, { client }) => {
|
|
37
|
+
const response = await client.record.addRecordComment({
|
|
38
|
+
app,
|
|
39
|
+
record,
|
|
40
|
+
comment: {
|
|
41
|
+
text,
|
|
42
|
+
mentions,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
const result = {
|
|
46
|
+
id: response.id,
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
structuredContent: result,
|
|
50
|
+
content: [
|
|
51
|
+
{
|
|
52
|
+
type: "text",
|
|
53
|
+
text: JSON.stringify(result, null, 2),
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export const addRecordComment = createTool(toolName, toolConfig, callback);
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { createTool } from "../../factory.js";
|
|
3
|
+
const inputSchema = {
|
|
4
|
+
app: z
|
|
5
|
+
.string()
|
|
6
|
+
.describe("The ID of the app that contains the record (numeric value as string)"),
|
|
7
|
+
record: z.string().describe("The ID of the record to retrieve comments from"),
|
|
8
|
+
order: z
|
|
9
|
+
.enum(["asc", "desc"])
|
|
10
|
+
.optional()
|
|
11
|
+
.describe("Sort order of comments by createdAt. 'asc' = oldest first, 'desc' = newest first (default: desc)"),
|
|
12
|
+
limit: z
|
|
13
|
+
.number()
|
|
14
|
+
.min(1)
|
|
15
|
+
.max(10)
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Maximum number of comments to retrieve (1-10, default: 10 by kintone API)"),
|
|
18
|
+
offset: z
|
|
19
|
+
.number()
|
|
20
|
+
.min(0)
|
|
21
|
+
.optional()
|
|
22
|
+
.describe("Number of comments to skip (default: 0)"),
|
|
23
|
+
};
|
|
24
|
+
const commentSchema = z.object({
|
|
25
|
+
id: z.string().describe("Comment ID"),
|
|
26
|
+
text: z.string().describe("Comment text"),
|
|
27
|
+
createdAt: z.string().describe("Comment creation datetime (ISO 8601)"),
|
|
28
|
+
creator: z
|
|
29
|
+
.object({
|
|
30
|
+
code: z.string().describe("User code of the comment creator"),
|
|
31
|
+
name: z.string().describe("Display name of the comment creator"),
|
|
32
|
+
})
|
|
33
|
+
.describe("Information about the comment creator"),
|
|
34
|
+
mentions: z
|
|
35
|
+
.array(z.object({
|
|
36
|
+
code: z.string().describe("Code of the mentioned user/group/org"),
|
|
37
|
+
type: z
|
|
38
|
+
.enum(["USER", "GROUP", "ORGANIZATION"])
|
|
39
|
+
.describe("Type of the mention target"),
|
|
40
|
+
}))
|
|
41
|
+
.describe("Mentions in the comment"),
|
|
42
|
+
});
|
|
43
|
+
const outputSchema = {
|
|
44
|
+
comments: z.array(commentSchema).describe("Array of comments on the record"),
|
|
45
|
+
older: z
|
|
46
|
+
.boolean()
|
|
47
|
+
.describe("Whether there are older comments beyond this page"),
|
|
48
|
+
newer: z
|
|
49
|
+
.boolean()
|
|
50
|
+
.describe("Whether there are newer comments beyond this page"),
|
|
51
|
+
};
|
|
52
|
+
const toolName = "kintone-get-record-comments";
|
|
53
|
+
const toolConfig = {
|
|
54
|
+
title: "Get Record Comments",
|
|
55
|
+
description: "Get comments posted on a single kintone record. The kintone API returns comments for one record at a time; to fetch comments for multiple records, call this tool repeatedly. Up to 10 comments are returned per call; use offset to paginate.",
|
|
56
|
+
inputSchema,
|
|
57
|
+
outputSchema,
|
|
58
|
+
};
|
|
59
|
+
const callback = async ({ app, record, order, limit, offset }, { client }) => {
|
|
60
|
+
const response = await client.record.getRecordComments({
|
|
61
|
+
app,
|
|
62
|
+
record,
|
|
63
|
+
order,
|
|
64
|
+
limit,
|
|
65
|
+
offset,
|
|
66
|
+
});
|
|
67
|
+
const result = {
|
|
68
|
+
comments: response.comments,
|
|
69
|
+
older: response.older,
|
|
70
|
+
newer: response.newer,
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
structuredContent: result,
|
|
74
|
+
content: [
|
|
75
|
+
{
|
|
76
|
+
type: "text",
|
|
77
|
+
text: JSON.stringify(result, null, 2),
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export const getRecordComments = createTool(toolName, toolConfig, callback);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createTool } from "../../factory.js";
|
|
2
|
+
import { searchInputSchema, searchOutputSchema, } from "../../../schema/search/index.js";
|
|
3
|
+
const toolName = "kintone-search";
|
|
4
|
+
const toolConfig = {
|
|
5
|
+
title: "Search",
|
|
6
|
+
description: "Search across kintone for records, spaces, threads, comments, and attachments. " +
|
|
7
|
+
"Performs a cross-domain full-text search. " +
|
|
8
|
+
"Requires password or session authentication (not API token).",
|
|
9
|
+
inputSchema: searchInputSchema,
|
|
10
|
+
outputSchema: searchOutputSchema,
|
|
11
|
+
};
|
|
12
|
+
const callback = async (input, { client }) => {
|
|
13
|
+
const { query, ...rest } = input;
|
|
14
|
+
const response = await client.search({
|
|
15
|
+
...rest,
|
|
16
|
+
query,
|
|
17
|
+
});
|
|
18
|
+
const result = {
|
|
19
|
+
hits: response.hits,
|
|
20
|
+
nextPageToken: response.nextPageToken,
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
structuredContent: result,
|
|
24
|
+
content: [
|
|
25
|
+
{
|
|
26
|
+
type: "text",
|
|
27
|
+
text: JSON.stringify(result, null, 2),
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export const search = createTool(toolName, toolConfig, callback);
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated. Do not edit manually.
|
|
2
|
-
export const version = "1.
|
|
2
|
+
export const version = "1.5.0"; // x-release-please-version
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kintone/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "The official MCP Server for kintone",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kintone",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@kintone/rest-api-client": "6.
|
|
34
|
-
"@modelcontextprotocol/sdk": "1.
|
|
33
|
+
"@kintone/rest-api-client": "6.2.0",
|
|
34
|
+
"@modelcontextprotocol/sdk": "1.29.0",
|
|
35
35
|
"file-type": "22.0.1",
|
|
36
36
|
"https-proxy-agent": "7.0.6",
|
|
37
37
|
"zod": "3.25.76"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"eslint": "9.39.4",
|
|
49
49
|
"eslint-plugin-package-json": "0.88.3",
|
|
50
50
|
"globals": "17.6.0",
|
|
51
|
-
"npm": "11.
|
|
51
|
+
"npm": "11.16.0",
|
|
52
52
|
"prettier": "3.8.3",
|
|
53
53
|
"tsx": "4.22.3",
|
|
54
54
|
"typescript": "5.9.3",
|