mcp-meilisearch 1.2.4 → 1.2.5
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 +46 -83
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,33 +1,19 @@
|
|
|
1
1
|
# MCP Meilisearch API Server
|
|
2
2
|
|
|
3
|
-
A Model Context Protocol (MCP) server implementation that provides a bridge between AI models and the Meilisearch search engine
|
|
3
|
+
A Model Context Protocol (MCP) server implementation that provides a bridge between AI models and the Meilisearch search engine.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
This project provides a MCP server that enables AI models to interact directly with Meilisearch functionalities. The architecture includes:
|
|
5
|
+
## Overview
|
|
8
6
|
|
|
9
7
|
- **MCP Server**: Exposes Meilisearch APIs as tools using the Model Context Protocol.
|
|
10
8
|
- **Web Client Demo**: A demo interface showcasing search functionalities.
|
|
11
9
|
|
|
12
10
|
## Key Features
|
|
13
11
|
|
|
14
|
-
- **
|
|
12
|
+
- **Multiple Transport Options**: Supports both STDIO and StreamableHTTP transports.
|
|
13
|
+
- **Real-time Communication**: Enables seamless interaction between clients and the server.
|
|
15
14
|
- **Meilisearch API Support**: Full access to Meilisearch functionalities.
|
|
16
|
-
- **Enhanced Error Handling**: Improved error management for API requests.
|
|
17
15
|
- **Web Client Demo**: Updated interface for demonstrating search capabilities.
|
|
18
16
|
|
|
19
|
-
## Tool Categories
|
|
20
|
-
|
|
21
|
-
The MCP server organizes Meilisearch APIs into these categories:
|
|
22
|
-
|
|
23
|
-
1. **System Tools**: Health checks, version info, server stats.
|
|
24
|
-
2. **Index Tools**: Manage indexes (create, update, delete, list).
|
|
25
|
-
3. **Document Tools**: Add, update, delete, and retrieve documents.
|
|
26
|
-
4. **Search Tools**: Advanced search, including vector search.
|
|
27
|
-
5. **Settings Tools**: Configure index settings.
|
|
28
|
-
6. **Task Tools**: Manage asynchronous tasks.
|
|
29
|
-
7. **Vector Tools**: Experimental vector search capabilities.
|
|
30
|
-
|
|
31
17
|
## Getting Started
|
|
32
18
|
|
|
33
19
|
### Prerequisites
|
|
@@ -36,57 +22,68 @@ The MCP server organizes Meilisearch APIs into these categories:
|
|
|
36
22
|
- A running Meilisearch instance (local or remote).
|
|
37
23
|
- API key for Meilisearch (if required).
|
|
38
24
|
|
|
39
|
-
###
|
|
25
|
+
### Installation
|
|
40
26
|
|
|
41
|
-
|
|
27
|
+
Install the package:
|
|
42
28
|
|
|
43
29
|
```bash
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
# Using npm
|
|
31
|
+
npm install mcp-meilisearch
|
|
46
32
|
|
|
47
|
-
|
|
33
|
+
# Using yarn
|
|
34
|
+
yarn add mcp-meilisearch
|
|
48
35
|
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
# Using pnpm
|
|
37
|
+
pnpm add mcp-meilisearch
|
|
51
38
|
```
|
|
52
39
|
|
|
53
|
-
|
|
40
|
+
### Options
|
|
54
41
|
|
|
55
|
-
|
|
42
|
+
#### Meilisearch Connection Options
|
|
56
43
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
44
|
+
- `meilisearchHost`: URL of the Meilisearch instance (Default: "http://localhost:7700")
|
|
45
|
+
- `meilisearchApiKey`: API key for authenticating with Meilisearch (Default: "")
|
|
46
|
+
|
|
47
|
+
#### MCP Server Options
|
|
61
48
|
|
|
62
|
-
|
|
49
|
+
- `transport`: Transport type for MCP server ("http" | "stdio") (Default: "http")
|
|
50
|
+
- `httpPort`: HTTP port for MCP server (Default: 4995)
|
|
51
|
+
- `mcpEndpoint`: MCP endpoint path (Default: "/mcp")
|
|
63
52
|
|
|
64
|
-
|
|
53
|
+
#### Session Options
|
|
65
54
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
npm run demo # Start the Web client demo
|
|
69
|
-
```
|
|
55
|
+
- `sessionTimeout`: Session timeout in milliseconds (Default: 3600000)
|
|
56
|
+
- `sessionCleanupInterval`: Session cleanup interval in milliseconds (Default: 60000)
|
|
70
57
|
|
|
71
|
-
###
|
|
58
|
+
### Using the MCPClient
|
|
72
59
|
|
|
73
|
-
|
|
60
|
+
The package also exports the MCPClient class for client-side integration:
|
|
74
61
|
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
|
|
62
|
+
```typescript
|
|
63
|
+
import { MCPClient } from "mcp-meilisearch/client";
|
|
64
|
+
|
|
65
|
+
const client = new MCPClient("mcp-meilisearch-client");
|
|
66
|
+
await client.connectToServer("http://localhost:4995/mcp");
|
|
78
67
|
|
|
79
|
-
|
|
68
|
+
// Call a tool
|
|
69
|
+
const result = await client.callTool("search-across-all-indexes", {
|
|
70
|
+
q: "search kiosco antonio",
|
|
71
|
+
});
|
|
72
|
+
```
|
|
80
73
|
|
|
81
|
-
|
|
74
|
+
## Tools
|
|
82
75
|
|
|
83
|
-
|
|
84
|
-
- **Express**: Powers the web server.
|
|
85
|
-
- **Model Context Protocol SDK**: Facilitates AI integration.
|
|
76
|
+
The MCP server exposes various tools that allow you to interact with Meilisearch functionalities. Each tool corresponds to a specific Meilisearch API endpoint, enabling you to perform operations such as searching, indexing, and managing documents.
|
|
86
77
|
|
|
87
|
-
|
|
78
|
+
### Tool Categories
|
|
88
79
|
|
|
89
|
-
|
|
80
|
+
1. **System Tools**: Health checks, version info, server stats.
|
|
81
|
+
2. **Index Tools**: Manage indexes (create, update, delete, list).
|
|
82
|
+
3. **Document Tools**: Add, update, delete, and retrieve documents.
|
|
83
|
+
4. **Search Tools**: Advanced search, including vector search.
|
|
84
|
+
5. **Settings Tools**: Configure index settings.
|
|
85
|
+
6. **Task Tools**: Manage asynchronous tasks.
|
|
86
|
+
7. **Vector Tools**: Experimental vector search capabilities.
|
|
90
87
|
|
|
91
88
|
### System Tools
|
|
92
89
|
|
|
@@ -386,37 +383,3 @@ This section details all the available tools, their descriptions, and parameters
|
|
|
386
383
|
- `query` (string, optional): Text query to search for (if using 'embedder' instead of 'vector').
|
|
387
384
|
- `hybrid` (boolean, optional): Whether to perform a hybrid search (combining vector and text search).
|
|
388
385
|
- `hybridRatio` (number, optional): Ratio of vector vs text search in hybrid search (0-1, default: 0.5).
|
|
389
|
-
|
|
390
|
-
### Options
|
|
391
|
-
|
|
392
|
-
#### Meilisearch Connection Options
|
|
393
|
-
|
|
394
|
-
- `meilisearchHost`: URL of the Meilisearch instance (Default: "http://localhost:7700")
|
|
395
|
-
- `meilisearchApiKey`: API key for authenticating with Meilisearch (Default: "")
|
|
396
|
-
|
|
397
|
-
#### MCP Server Options
|
|
398
|
-
|
|
399
|
-
- `transport`: Transport type for MCP server ("http" | "stdio") (Default: "http")
|
|
400
|
-
- `httpPort`: HTTP port for MCP server (Default: 4995)
|
|
401
|
-
- `mcpEndpoint`: MCP endpoint path (Default: "/mcp")
|
|
402
|
-
|
|
403
|
-
#### Session Options
|
|
404
|
-
|
|
405
|
-
- `sessionTimeout`: Session timeout in milliseconds (Default: 3600000)
|
|
406
|
-
- `sessionCleanupInterval`: Session cleanup interval in milliseconds (Default: 60000)
|
|
407
|
-
|
|
408
|
-
### Using the MCPClient
|
|
409
|
-
|
|
410
|
-
The package also exports the MCPClient class for client-side integration:
|
|
411
|
-
|
|
412
|
-
```typescript
|
|
413
|
-
import { MCPClient } from "mcp-meilisearch/client";
|
|
414
|
-
|
|
415
|
-
const client = new MCPClient("mcp-meilisearch-client");
|
|
416
|
-
await client.connectToServer("http://localhost:4995/mcp");
|
|
417
|
-
|
|
418
|
-
// Call a tool
|
|
419
|
-
const result = await client.callTool("search-across-all-indexes", {
|
|
420
|
-
q: "search kiosco antonio",
|
|
421
|
-
});
|
|
422
|
-
```
|