mcp-meilisearch 1.0.10 → 1.0.12
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/plugin.d.ts +2 -42
- package/dist/plugin.d.ts.map +1 -1
- package/dist/server.js +1 -1
- package/dist/standalone.d.ts +3 -34
- package/dist/standalone.d.ts.map +1 -1
- package/dist/standalone.js +3 -2
- package/dist/types/options.d.ts +39 -0
- package/dist/types/options.d.ts.map +1 -0
- package/dist/types/options.js +1 -0
- package/package.json +1 -1
package/dist/plugin.d.ts
CHANGED
|
@@ -1,49 +1,9 @@
|
|
|
1
1
|
import { Plugin } from "vite";
|
|
2
|
-
|
|
3
|
-
* Options for the MCP Vite plugin
|
|
4
|
-
*/
|
|
5
|
-
export interface MCPPluginOptions {
|
|
6
|
-
/**
|
|
7
|
-
* The URL of the Meilisearch instance
|
|
8
|
-
* @required
|
|
9
|
-
* @example "http://localhost:7700"
|
|
10
|
-
*/
|
|
11
|
-
meilisearchHost: string;
|
|
12
|
-
/**
|
|
13
|
-
* The API key for authenticating with Meilisearch
|
|
14
|
-
* @required
|
|
15
|
-
*/
|
|
16
|
-
meilisearchApiKey: string;
|
|
17
|
-
/**
|
|
18
|
-
* Transport type for MCP server ("http" | "stdio")
|
|
19
|
-
* @default "http"
|
|
20
|
-
*/
|
|
21
|
-
transport?: "http" | "stdio";
|
|
22
|
-
/**
|
|
23
|
-
* HTTP port for MCP server
|
|
24
|
-
* @default 8080
|
|
25
|
-
*/
|
|
26
|
-
httpPort?: number;
|
|
27
|
-
/**
|
|
28
|
-
* MCP endpoint path
|
|
29
|
-
* @default "/mcp"
|
|
30
|
-
*/
|
|
31
|
-
mcpEndpoint?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Session timeout in milliseconds
|
|
34
|
-
* @default 3600000 (1 hour)
|
|
35
|
-
*/
|
|
36
|
-
sessionTimeout?: number;
|
|
37
|
-
/**
|
|
38
|
-
* Session cleanup interval in milliseconds
|
|
39
|
-
* @default 60000 (1 minute)
|
|
40
|
-
*/
|
|
41
|
-
sessionCleanupInterval?: number;
|
|
42
|
-
}
|
|
2
|
+
import { ServerOptions } from "./types/options.js";
|
|
43
3
|
/**
|
|
44
4
|
* Creates a Vite plugin that integrates with the MCP server
|
|
45
5
|
* @param options Configuration options for the MCP server
|
|
46
6
|
* @returns A Vite plugin
|
|
47
7
|
*/
|
|
48
|
-
export declare function mcpPlugin(options?:
|
|
8
|
+
export declare function mcpPlugin(options?: ServerOptions): Plugin;
|
|
49
9
|
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAInD;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,OAAO,GAAE,aAGR,GACA,MAAM,CAoGR"}
|
package/dist/server.js
CHANGED
|
@@ -279,7 +279,7 @@ const initServerHTTPTransport = async (customConfig) => {
|
|
|
279
279
|
registerTaskTools(serverInstance);
|
|
280
280
|
const server = new MCPServer(serverInstance, config);
|
|
281
281
|
let vite;
|
|
282
|
-
console.log("Meilisearch MCP Server is running on
|
|
282
|
+
console.log("Meilisearch MCP Server is running on HTTP transport:", `${config.mcpEndpoint}`);
|
|
283
283
|
// Return both server instances for proper cleanup
|
|
284
284
|
return { mcpServer: server, viteServer: vite };
|
|
285
285
|
};
|
package/dist/standalone.d.ts
CHANGED
|
@@ -1,41 +1,10 @@
|
|
|
1
1
|
import http from "node:http";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* HTTP port for MCP server
|
|
5
|
-
* @default 8080
|
|
6
|
-
*/
|
|
7
|
-
httpPort?: number;
|
|
8
|
-
/**
|
|
9
|
-
* MCP endpoint path
|
|
10
|
-
* @default "/mcp"
|
|
11
|
-
*/
|
|
12
|
-
mcpEndpoint?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Session timeout in milliseconds
|
|
15
|
-
* @default 3600000 (1 hour)
|
|
16
|
-
*/
|
|
17
|
-
sessionTimeout?: number;
|
|
18
|
-
/**
|
|
19
|
-
* Session cleanup interval in milliseconds
|
|
20
|
-
* @default 60000 (1 minute)
|
|
21
|
-
*/
|
|
22
|
-
sessionCleanupInterval?: number;
|
|
23
|
-
/**
|
|
24
|
-
* The URL of the Meilisearch instance
|
|
25
|
-
* @default "http://localhost:7700"
|
|
26
|
-
*/
|
|
27
|
-
meilisearchHost: string;
|
|
28
|
-
/**
|
|
29
|
-
* The API key for authenticating with Meilisearch
|
|
30
|
-
* @default ""
|
|
31
|
-
*/
|
|
32
|
-
meilisearchApiKey: string;
|
|
33
|
-
}
|
|
2
|
+
import { ServerOptions } from "./types/options.js";
|
|
34
3
|
/**
|
|
35
|
-
* Start a standalone MCP server
|
|
4
|
+
* Start a standalone MCP server
|
|
36
5
|
* @param options Configuration options for the MCP server
|
|
37
6
|
* @returns A promise that resolves to the HTTP server instance
|
|
38
7
|
*/
|
|
39
|
-
export declare function mcpStandalone(options?:
|
|
8
|
+
export declare function mcpStandalone(options?: ServerOptions): Promise<http.Server>;
|
|
40
9
|
export default mcpStandalone;
|
|
41
10
|
//# sourceMappingURL=standalone.d.ts.map
|
package/dist/standalone.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standalone.d.ts","sourceRoot":"","sources":["../src/standalone.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"standalone.d.ts","sourceRoot":"","sources":["../src/standalone.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAInD;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,OAAO,GAAE,aAGR,GACA,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAoGtB;AAqCD,eAAe,aAAa,CAAC"}
|
package/dist/standalone.js
CHANGED
|
@@ -4,7 +4,7 @@ import { parse as parseUrl } from "node:url";
|
|
|
4
4
|
import { configHandler } from "./utils/config-handler.js";
|
|
5
5
|
import { createErrorResponse } from "./utils/error-handler.js";
|
|
6
6
|
/**
|
|
7
|
-
* Start a standalone MCP server
|
|
7
|
+
* Start a standalone MCP server
|
|
8
8
|
* @param options Configuration options for the MCP server
|
|
9
9
|
* @returns A promise that resolves to the HTTP server instance
|
|
10
10
|
*/
|
|
@@ -16,6 +16,7 @@ export async function mcpStandalone(options = {
|
|
|
16
16
|
configHandler.setMeilisearchApiKey(options.meilisearchApiKey);
|
|
17
17
|
let mcpServerInstance = null;
|
|
18
18
|
const httpPort = options.httpPort || 8080;
|
|
19
|
+
const transport = options.transport || "http";
|
|
19
20
|
const mcpEndpoint = options.mcpEndpoint || "/mcp";
|
|
20
21
|
const server = createServer(async (req, res) => {
|
|
21
22
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
@@ -74,7 +75,7 @@ export async function mcpStandalone(options = {
|
|
|
74
75
|
});
|
|
75
76
|
try {
|
|
76
77
|
console.log("Initializing MCP server...");
|
|
77
|
-
const serverInstances = await initServer(
|
|
78
|
+
const serverInstances = await initServer(transport, options);
|
|
78
79
|
mcpServerInstance = serverInstances.mcpServer;
|
|
79
80
|
console.log("MCP server initialized successfully");
|
|
80
81
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface ServerOptions {
|
|
2
|
+
/**
|
|
3
|
+
* The URL of the Meilisearch instance
|
|
4
|
+
* @required
|
|
5
|
+
* @example "http://localhost:7700"
|
|
6
|
+
*/
|
|
7
|
+
meilisearchHost: string;
|
|
8
|
+
/**
|
|
9
|
+
* The API key for authenticating with Meilisearch
|
|
10
|
+
* @required
|
|
11
|
+
*/
|
|
12
|
+
meilisearchApiKey: string;
|
|
13
|
+
/**
|
|
14
|
+
* Transport type for MCP server ("http" | "stdio")
|
|
15
|
+
* @default "http"
|
|
16
|
+
*/
|
|
17
|
+
transport?: "http" | "stdio";
|
|
18
|
+
/**
|
|
19
|
+
* HTTP port for MCP server
|
|
20
|
+
* @default 8080
|
|
21
|
+
*/
|
|
22
|
+
httpPort?: number;
|
|
23
|
+
/**
|
|
24
|
+
* MCP endpoint path
|
|
25
|
+
* @default "/mcp"
|
|
26
|
+
*/
|
|
27
|
+
mcpEndpoint?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Session timeout in milliseconds
|
|
30
|
+
* @default 3600000 (1 hour)
|
|
31
|
+
*/
|
|
32
|
+
sessionTimeout?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Session cleanup interval in milliseconds
|
|
35
|
+
* @default 60000 (1 minute)
|
|
36
|
+
*/
|
|
37
|
+
sessionCleanupInterval?: number;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/types/options.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|