mcp-meilisearch 1.4.23 → 1.4.26
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/client.js +2 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +4 -4
- package/dist/tools/core/ai-tools.d.ts.map +1 -1
- package/dist/tools/core/ai-tools.js +22 -11
- package/dist/tools/meilisearch/document-tools.d.ts.map +1 -1
- package/dist/tools/meilisearch/document-tools.js +84 -54
- package/dist/tools/meilisearch/index-tools.d.ts.map +1 -1
- package/dist/tools/meilisearch/index-tools.js +59 -35
- package/dist/tools/meilisearch/search-tools.d.ts.map +1 -1
- package/dist/tools/meilisearch/search-tools.js +50 -35
- package/dist/tools/meilisearch/settings-tools.d.ts.map +1 -1
- package/dist/tools/meilisearch/settings-tools.js +384 -241
- package/dist/tools/meilisearch/system-tools.d.ts.map +1 -1
- package/dist/tools/meilisearch/system-tools.js +101 -85
- package/dist/tools/meilisearch/task-tools.d.ts.map +1 -1
- package/dist/tools/meilisearch/task-tools.js +106 -88
- package/dist/tools/meilisearch/vector-tools.d.ts.map +1 -1
- package/dist/tools/meilisearch/vector-tools.js +81 -68
- package/dist/utils/ai-handler.d.ts.map +1 -1
- package/dist/utils/ai-handler.js +3 -2
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/meilisearch/system-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE;;;;GAIG;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,SAAS,
|
|
1
|
+
{"version":3,"file":"system-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/meilisearch/system-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE;;;;GAIG;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,SAAS,SAyNpD,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -13,7 +13,11 @@ import { createErrorResponse } from "../../utils/error-handler.js";
|
|
|
13
13
|
*/
|
|
14
14
|
export const registerSystemTools = (server) => {
|
|
15
15
|
// Get Meilisearch version
|
|
16
|
-
server.
|
|
16
|
+
server.registerTool("get-version", {
|
|
17
|
+
description: "Get the version of the Meilisearch instance",
|
|
18
|
+
inputSchema: {},
|
|
19
|
+
_meta: { category: "meilisearch" },
|
|
20
|
+
}, async () => {
|
|
17
21
|
try {
|
|
18
22
|
const response = await apiClient.get("/version");
|
|
19
23
|
return {
|
|
@@ -26,8 +30,11 @@ export const registerSystemTools = (server) => {
|
|
|
26
30
|
return createErrorResponse(error);
|
|
27
31
|
}
|
|
28
32
|
});
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
server.registerTool("get-health", {
|
|
34
|
+
description: "Get the health status of the Meilisearch instance",
|
|
35
|
+
inputSchema: {},
|
|
36
|
+
_meta: { category: "meilisearch" },
|
|
37
|
+
}, async () => {
|
|
31
38
|
try {
|
|
32
39
|
const response = await apiClient.get("/health");
|
|
33
40
|
return {
|
|
@@ -40,8 +47,11 @@ export const registerSystemTools = (server) => {
|
|
|
40
47
|
return createErrorResponse(error);
|
|
41
48
|
}
|
|
42
49
|
});
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
server.registerTool("get-stats", {
|
|
51
|
+
description: "Get statistics about the Meilisearch server",
|
|
52
|
+
inputSchema: {},
|
|
53
|
+
_meta: { category: "meilisearch" },
|
|
54
|
+
}, async () => {
|
|
45
55
|
try {
|
|
46
56
|
const response = await apiClient.get("/");
|
|
47
57
|
return {
|
|
@@ -54,41 +64,44 @@ export const registerSystemTools = (server) => {
|
|
|
54
64
|
return createErrorResponse(error);
|
|
55
65
|
}
|
|
56
66
|
});
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
67
|
+
server.registerTool("get-tasks", {
|
|
68
|
+
description: "Get information about tasks with optional filtering",
|
|
69
|
+
inputSchema: {
|
|
70
|
+
limit: z
|
|
71
|
+
.number()
|
|
72
|
+
.min(0)
|
|
73
|
+
.optional()
|
|
74
|
+
.describe("Maximum number of tasks to return"),
|
|
75
|
+
from: z
|
|
76
|
+
.number()
|
|
77
|
+
.min(0)
|
|
78
|
+
.optional()
|
|
79
|
+
.describe("Task uid from which to start fetching"),
|
|
80
|
+
status: z
|
|
81
|
+
.enum(["enqueued", "processing", "succeeded", "failed", "canceled"])
|
|
82
|
+
.optional()
|
|
83
|
+
.describe("Status of tasks to return"),
|
|
84
|
+
type: z
|
|
85
|
+
.enum([
|
|
86
|
+
"indexCreation",
|
|
87
|
+
"indexUpdate",
|
|
88
|
+
"indexDeletion",
|
|
89
|
+
"documentAddition",
|
|
90
|
+
"documentUpdate",
|
|
91
|
+
"documentDeletion",
|
|
92
|
+
"settingsUpdate",
|
|
93
|
+
"dumpCreation",
|
|
94
|
+
"taskCancelation",
|
|
95
|
+
])
|
|
96
|
+
.optional()
|
|
97
|
+
.describe("Type of tasks to return"),
|
|
98
|
+
indexUids: z
|
|
99
|
+
.array(z.string())
|
|
100
|
+
.optional()
|
|
101
|
+
.describe("UIDs of the indexes on which tasks were performed"),
|
|
102
|
+
},
|
|
103
|
+
_meta: { category: "meilisearch" },
|
|
104
|
+
}, async ({ limit, from, status, type, indexUids }) => {
|
|
92
105
|
try {
|
|
93
106
|
const params = {};
|
|
94
107
|
if (limit !== undefined)
|
|
@@ -112,51 +125,54 @@ export const registerSystemTools = (server) => {
|
|
|
112
125
|
return createErrorResponse(error);
|
|
113
126
|
}
|
|
114
127
|
});
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
128
|
+
server.registerTool("delete-tasks", {
|
|
129
|
+
description: "Delete tasks based on provided filters",
|
|
130
|
+
inputSchema: {
|
|
131
|
+
statuses: z
|
|
132
|
+
.array(z.enum(["succeeded", "failed", "canceled"]))
|
|
133
|
+
.optional()
|
|
134
|
+
.describe("Statuses of tasks to delete"),
|
|
135
|
+
types: z
|
|
136
|
+
.array(z.enum([
|
|
137
|
+
"indexCreation",
|
|
138
|
+
"indexUpdate",
|
|
139
|
+
"indexDeletion",
|
|
140
|
+
"documentAddition",
|
|
141
|
+
"documentUpdate",
|
|
142
|
+
"documentDeletion",
|
|
143
|
+
"settingsUpdate",
|
|
144
|
+
"dumpCreation",
|
|
145
|
+
"taskCancelation",
|
|
146
|
+
]))
|
|
147
|
+
.optional()
|
|
148
|
+
.describe("Types of tasks to delete"),
|
|
149
|
+
indexUids: z
|
|
150
|
+
.array(z.string())
|
|
151
|
+
.optional()
|
|
152
|
+
.describe("UIDs of the indexes on which tasks to delete were performed"),
|
|
153
|
+
uids: z
|
|
154
|
+
.array(z.number())
|
|
155
|
+
.optional()
|
|
156
|
+
.describe("UIDs of the tasks to delete"),
|
|
157
|
+
canceledBy: z
|
|
158
|
+
.array(z.number())
|
|
159
|
+
.optional()
|
|
160
|
+
.describe("UIDs of the tasks that canceled tasks to delete"),
|
|
161
|
+
beforeUid: z
|
|
162
|
+
.number()
|
|
163
|
+
.optional()
|
|
164
|
+
.describe("Delete tasks whose uid is before this value"),
|
|
165
|
+
beforeStartedAt: z
|
|
166
|
+
.string()
|
|
167
|
+
.optional()
|
|
168
|
+
.describe("Delete tasks that started processing before this date (ISO 8601 format)"),
|
|
169
|
+
beforeFinishedAt: z
|
|
170
|
+
.string()
|
|
171
|
+
.optional()
|
|
172
|
+
.describe("Delete tasks that finished processing before this date (ISO 8601 format)"),
|
|
173
|
+
},
|
|
174
|
+
_meta: { category: "meilisearch" },
|
|
175
|
+
}, async ({ statuses, types, indexUids, uids, canceledBy, beforeUid, beforeStartedAt, beforeFinishedAt, }) => {
|
|
160
176
|
try {
|
|
161
177
|
const body = {};
|
|
162
178
|
if (statuses && statuses.length > 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/meilisearch/task-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAmCpE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,SAAS,
|
|
1
|
+
{"version":3,"file":"task-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/meilisearch/task-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAmCpE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,SAAS,SAuOlD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -8,44 +8,54 @@ import { createErrorResponse } from "../../utils/error-handler.js";
|
|
|
8
8
|
*/
|
|
9
9
|
export const registerTaskTools = (server) => {
|
|
10
10
|
// List all tasks
|
|
11
|
-
server.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
11
|
+
server.registerTool("list-tasks", {
|
|
12
|
+
description: "List all tasks in the Meilisearch instance",
|
|
13
|
+
inputSchema: {
|
|
14
|
+
limit: z
|
|
15
|
+
.number()
|
|
16
|
+
.min(0)
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Maximum number of tasks to return"),
|
|
19
|
+
from: z
|
|
20
|
+
.number()
|
|
21
|
+
.min(0)
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Task uid from which to start fetching"),
|
|
24
|
+
statuses: z
|
|
25
|
+
.array(z.enum([
|
|
26
|
+
"enqueued",
|
|
27
|
+
"processing",
|
|
28
|
+
"succeeded",
|
|
29
|
+
"failed",
|
|
30
|
+
"canceled",
|
|
31
|
+
]))
|
|
32
|
+
.optional()
|
|
33
|
+
.describe("Statuses of tasks to return"),
|
|
34
|
+
types: z
|
|
35
|
+
.array(z.enum([
|
|
36
|
+
"indexCreation",
|
|
37
|
+
"indexUpdate",
|
|
38
|
+
"indexDeletion",
|
|
39
|
+
"documentAddition",
|
|
40
|
+
"documentUpdate",
|
|
41
|
+
"documentDeletion",
|
|
42
|
+
"settingsUpdate",
|
|
43
|
+
"dumpCreation",
|
|
44
|
+
"taskCancelation",
|
|
45
|
+
]))
|
|
46
|
+
.optional()
|
|
47
|
+
.describe("Types of tasks to return"),
|
|
48
|
+
indexUids: z
|
|
49
|
+
.array(z.string())
|
|
50
|
+
.optional()
|
|
51
|
+
.describe("UIDs of the indexes on which tasks were performed"),
|
|
52
|
+
uids: z
|
|
53
|
+
.array(z.number())
|
|
54
|
+
.optional()
|
|
55
|
+
.describe("UIDs of specific tasks to return"),
|
|
56
|
+
},
|
|
57
|
+
_meta: { category: "meilisearch" },
|
|
58
|
+
}, async ({ limit, from, statuses, types, indexUids, uids, }) => {
|
|
49
59
|
try {
|
|
50
60
|
const params = {};
|
|
51
61
|
if (limit !== undefined)
|
|
@@ -71,10 +81,13 @@ export const registerTaskTools = (server) => {
|
|
|
71
81
|
return createErrorResponse(error);
|
|
72
82
|
}
|
|
73
83
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
server.registerTool("get-task", {
|
|
85
|
+
description: "Get information about a specific task",
|
|
86
|
+
inputSchema: {
|
|
87
|
+
taskUid: z.number().describe("Unique identifier of the task"),
|
|
88
|
+
},
|
|
89
|
+
_meta: { category: "meilisearch" },
|
|
90
|
+
}, async ({ taskUid }) => {
|
|
78
91
|
try {
|
|
79
92
|
const response = await apiClient.get(`/tasks/${taskUid}`);
|
|
80
93
|
return {
|
|
@@ -87,35 +100,38 @@ export const registerTaskTools = (server) => {
|
|
|
87
100
|
return createErrorResponse(error);
|
|
88
101
|
}
|
|
89
102
|
});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
103
|
+
server.registerTool("cancel-tasks", {
|
|
104
|
+
description: "Cancel tasks based on provided filters",
|
|
105
|
+
inputSchema: {
|
|
106
|
+
statuses: z
|
|
107
|
+
.array(z.enum(["enqueued", "processing"]))
|
|
108
|
+
.optional()
|
|
109
|
+
.describe("Statuses of tasks to cancel"),
|
|
110
|
+
types: z
|
|
111
|
+
.array(z.enum([
|
|
112
|
+
"indexCreation",
|
|
113
|
+
"indexUpdate",
|
|
114
|
+
"indexDeletion",
|
|
115
|
+
"documentAddition",
|
|
116
|
+
"documentUpdate",
|
|
117
|
+
"documentDeletion",
|
|
118
|
+
"settingsUpdate",
|
|
119
|
+
"dumpCreation",
|
|
120
|
+
"taskCancelation",
|
|
121
|
+
]))
|
|
122
|
+
.optional()
|
|
123
|
+
.describe("Types of tasks to cancel"),
|
|
124
|
+
indexUids: z
|
|
125
|
+
.array(z.string())
|
|
126
|
+
.optional()
|
|
127
|
+
.describe("UIDs of the indexes on which tasks to cancel were performed"),
|
|
128
|
+
uids: z
|
|
129
|
+
.array(z.number())
|
|
130
|
+
.optional()
|
|
131
|
+
.describe("UIDs of the tasks to cancel"),
|
|
132
|
+
},
|
|
133
|
+
_meta: { category: "meilisearch" },
|
|
134
|
+
}, async ({ statuses, types, indexUids, uids }) => {
|
|
119
135
|
try {
|
|
120
136
|
const body = {};
|
|
121
137
|
if (statuses && statuses.length > 0)
|
|
@@ -137,34 +153,36 @@ export const registerTaskTools = (server) => {
|
|
|
137
153
|
return createErrorResponse(error);
|
|
138
154
|
}
|
|
139
155
|
});
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
156
|
+
server.registerTool("wait-for-task", {
|
|
157
|
+
description: "Wait for a specific task to complete",
|
|
158
|
+
inputSchema: {
|
|
159
|
+
taskUid: z
|
|
160
|
+
.number()
|
|
161
|
+
.describe("Unique identifier of the task to wait for"),
|
|
162
|
+
timeoutMs: z
|
|
163
|
+
.number()
|
|
164
|
+
.min(0)
|
|
165
|
+
.optional()
|
|
166
|
+
.describe("Maximum time to wait in milliseconds (default: 5000)"),
|
|
167
|
+
intervalMs: z
|
|
168
|
+
.number()
|
|
169
|
+
.min(100)
|
|
170
|
+
.optional()
|
|
171
|
+
.describe("Polling interval in milliseconds (default: 500)"),
|
|
172
|
+
},
|
|
173
|
+
_meta: { category: "meilisearch" },
|
|
174
|
+
}, async ({ taskUid, timeoutMs = 5000, intervalMs = 500, }) => {
|
|
154
175
|
try {
|
|
155
176
|
const startTime = Date.now();
|
|
156
177
|
let taskCompleted = false;
|
|
157
178
|
let taskData = null;
|
|
158
179
|
while (!taskCompleted && Date.now() - startTime < timeoutMs) {
|
|
159
|
-
// Fetch the current task status
|
|
160
180
|
const response = await apiClient.get(`/tasks/${taskUid}`);
|
|
161
181
|
taskData = response.data;
|
|
162
|
-
// Check if the task has completed
|
|
163
182
|
if (["succeeded", "failed", "canceled"].includes(response.statusText)) {
|
|
164
183
|
taskCompleted = true;
|
|
165
184
|
}
|
|
166
185
|
else {
|
|
167
|
-
// Wait for the polling interval
|
|
168
186
|
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
169
187
|
}
|
|
170
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/meilisearch/vector-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE;;;;;GAKG;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,SAAS,
|
|
1
|
+
{"version":3,"file":"vector-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/meilisearch/vector-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE;;;;;GAKG;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,SAAS,SA2QpD,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|