mcp-meilisearch 1.4.6 → 1.4.7
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/tools/core/ai-tools.d.ts.map +1 -1
- package/dist/tools/core/ai-tools.js +2 -1
- package/dist/utils/ai-handler.d.ts.map +1 -1
- package/dist/utils/ai-handler.js +3 -3
- package/dist/utils/response-handler.d.ts +1 -1
- package/dist/utils/response-handler.d.ts.map +1 -1
- package/dist/utils/response-handler.js +2 -0
- package/package.json +3 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/core/ai-tools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ai-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/core/ai-tools.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAapE;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,SAAS,SAoDhD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
3
|
import { AIService } from "../../utils/ai-handler.js";
|
|
4
|
+
import { cleanNullValues } from "../../utils/response-handler.js";
|
|
4
5
|
import { createErrorResponse } from "../../utils/error-handler.js";
|
|
5
6
|
/**
|
|
6
7
|
* Register AI tools with the MCP server
|
|
@@ -37,7 +38,7 @@ export const registerAITools = (server) => {
|
|
|
37
38
|
text: JSON.stringify({
|
|
38
39
|
toolName: result.toolName,
|
|
39
40
|
reasoning: result.reasoning,
|
|
40
|
-
parameters: result.parameters,
|
|
41
|
+
parameters: cleanNullValues(result.parameters),
|
|
41
42
|
}, null, 2),
|
|
42
43
|
},
|
|
43
44
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-handler.d.ts","sourceRoot":"","sources":["../../src/utils/ai-handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ai-handler.d.ts","sourceRoot":"","sources":["../../src/utils/ai-handler.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,UAAU,MAAM;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAmBD,UAAU,cAAc;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED;;;;;GAKG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA0B;IACjD,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAkB;IAClD,OAAO,CAAC,QAAQ,CAAmC;IACnD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAwB;IACrD,OAAO,CAAC,MAAM,CAAgD;IAE9D;;;OAGG;IACH,OAAO;IAEP;;;OAGG;WACW,WAAW,IAAI,SAAS;IAOtC;;;;;;OAMG;IACH,UAAU,CACR,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE,qBAAgC,EAC1C,KAAK,CAAC,EAAE,MAAM,GACb,IAAI;IAyBP;;;OAGG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAIxC,iBAAiB,IAAI,OAAO;IAI5B;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAaxB;;;;;OAKG;IACG,YAAY,CAChB,KAAK,EAAE,MAAM,EACb,aAAa,CAAC,EAAE,MAAM,EAAE,GACvB,OAAO,CAAC,cAAc,CAAC;YA4BZ,kBAAkB;YA+DlB,uBAAuB;CAyDtC"}
|
package/dist/utils/ai-handler.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { OpenAI } from "openai";
|
|
2
2
|
import systemPrompt from "../prompts/system.js";
|
|
3
3
|
import { OPEN_ROUTER_API } from "../types/enums.js";
|
|
4
|
+
import { markdownToJson } from "./response-handler.js";
|
|
4
5
|
import { InferenceClient } from "@huggingface/inference";
|
|
5
|
-
import { markdownToJson, cleanNullValues } from "./response-handler.js";
|
|
6
6
|
/**
|
|
7
7
|
* AI Inference Service
|
|
8
8
|
*
|
|
@@ -151,7 +151,7 @@ export class AIService {
|
|
|
151
151
|
}
|
|
152
152
|
const inferenceToolResponse = {
|
|
153
153
|
name: toolCall.name,
|
|
154
|
-
parameters:
|
|
154
|
+
parameters: JSON.parse(toolCall.arguments),
|
|
155
155
|
};
|
|
156
156
|
return {
|
|
157
157
|
error: null,
|
|
@@ -200,7 +200,7 @@ export class AIService {
|
|
|
200
200
|
}
|
|
201
201
|
const inferenceToolResponse = {
|
|
202
202
|
name: toolCall.name,
|
|
203
|
-
parameters:
|
|
203
|
+
parameters: JSON.parse(toolCall.arguments),
|
|
204
204
|
};
|
|
205
205
|
return {
|
|
206
206
|
error: null,
|
|
@@ -11,5 +11,5 @@ export declare function markdownToJson<T>(markdownJsonString: string): T | null;
|
|
|
11
11
|
* Recursively removes null values from an object, replacing them with undefined
|
|
12
12
|
* This ensures optional parameters are properly handled by JSON schema validation
|
|
13
13
|
*/
|
|
14
|
-
export declare function cleanNullValues(obj
|
|
14
|
+
export declare function cleanNullValues(obj?: Record<string, any>): Record<string, any>;
|
|
15
15
|
//# sourceMappingURL=response-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-handler.d.ts","sourceRoot":"","sources":["../../src/utils/response-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,kBAAkB,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAoCtE;AAgCD;;;GAGG;AACH,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"response-handler.d.ts","sourceRoot":"","sources":["../../src/utils/response-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,kBAAkB,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAoCtE;AAgCD;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAwBrB"}
|
|
@@ -75,6 +75,8 @@ function parseNestedJsonStrings(obj) {
|
|
|
75
75
|
* This ensures optional parameters are properly handled by JSON schema validation
|
|
76
76
|
*/
|
|
77
77
|
export function cleanNullValues(obj) {
|
|
78
|
+
if (!obj || typeof obj !== "object")
|
|
79
|
+
return obj ?? {};
|
|
78
80
|
const result = {};
|
|
79
81
|
for (const [key, value] of Object.entries(obj)) {
|
|
80
82
|
if (value === null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-meilisearch",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.7",
|
|
4
4
|
"description": "Model Context Protocol (MCP) implementation for Meilisearch",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "tsc && tsc -p tsconfig.types.json",
|
|
27
|
-
"demo": "npm run build & npm run
|
|
27
|
+
"demo": "npm run build & npm run preview --workspace=demo",
|
|
28
28
|
"server": "npm run build && node --env-file=.env dist/index.js",
|
|
29
29
|
"prepublishOnly": "rm -rf dist && npm version patch && npm run build"
|
|
30
30
|
},
|
|
@@ -37,8 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^22.15.19",
|
|
40
|
-
"typescript": "^5.8.3"
|
|
41
|
-
"zod-to-json-schema": "^3.24.5"
|
|
40
|
+
"typescript": "^5.8.3"
|
|
42
41
|
},
|
|
43
42
|
"engines": {
|
|
44
43
|
"node": ">=20.12.2",
|