@2kw/ai-mcp-server 6.3.0-dev.118 → 6.3.0-dev.122
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/knowledge.js +34 -0
- package/package.json +1 -1
package/dist/tools/knowledge.js
CHANGED
|
@@ -5,6 +5,38 @@ import { formatErrorForMcp } from "../errors.js";
|
|
|
5
5
|
import { getMimeType } from "../mime.js";
|
|
6
6
|
const ChunkingStrategy = z.enum(["AUTO", "FIXED", "HIERARCHICAL", "CUSTOM"]);
|
|
7
7
|
const DocumentStatus = z.enum(["PENDING", "PARSING", "CHUNKING", "EMBEDDING", "READY", "ERROR"]);
|
|
8
|
+
/** The 29 Postgres text-search configurations the backend's TextSearchLanguage enum accepts (#1249). */
|
|
9
|
+
const TEXT_SEARCH_LANGUAGES = [
|
|
10
|
+
"arabic",
|
|
11
|
+
"armenian",
|
|
12
|
+
"basque",
|
|
13
|
+
"catalan",
|
|
14
|
+
"danish",
|
|
15
|
+
"dutch",
|
|
16
|
+
"english",
|
|
17
|
+
"finnish",
|
|
18
|
+
"french",
|
|
19
|
+
"german",
|
|
20
|
+
"greek",
|
|
21
|
+
"hindi",
|
|
22
|
+
"hungarian",
|
|
23
|
+
"indonesian",
|
|
24
|
+
"irish",
|
|
25
|
+
"italian",
|
|
26
|
+
"lithuanian",
|
|
27
|
+
"nepali",
|
|
28
|
+
"norwegian",
|
|
29
|
+
"portuguese",
|
|
30
|
+
"romanian",
|
|
31
|
+
"russian",
|
|
32
|
+
"serbian",
|
|
33
|
+
"simple",
|
|
34
|
+
"spanish",
|
|
35
|
+
"swedish",
|
|
36
|
+
"tamil",
|
|
37
|
+
"turkish",
|
|
38
|
+
"yiddish",
|
|
39
|
+
];
|
|
8
40
|
/**
|
|
9
41
|
* Fields shared by knowledge-base create and update — the backend treats
|
|
10
42
|
* every one of these as mandatory on both requests (name, slug,
|
|
@@ -24,6 +56,7 @@ const knowledgeBaseFields = {
|
|
|
24
56
|
parentChunkSize: z.number().int().min(100).max(8000).optional().describe("Parent chunk size for hierarchical chunking (100-8000), must exceed chunkSize"),
|
|
25
57
|
hybridSearchEnabled: z.boolean().optional().describe("Enable hybrid dense + lexical search"),
|
|
26
58
|
rerankerProviderId: z.string().optional().describe("Provider id used for reranking"),
|
|
59
|
+
textSearchLanguage: z.enum(TEXT_SEARCH_LANGUAGES).optional().describe("Text-search language for the lexical leg (default simple on create). On update, omit to leave the active and any pending language untouched — resending the current value would cancel a reindex in progress; changing it starts one in the background."),
|
|
27
60
|
};
|
|
28
61
|
function buildKnowledgeBaseBody(params) {
|
|
29
62
|
const body = {
|
|
@@ -41,6 +74,7 @@ function buildKnowledgeBaseBody(params) {
|
|
|
41
74
|
"parentChunkSize",
|
|
42
75
|
"hybridSearchEnabled",
|
|
43
76
|
"rerankerProviderId",
|
|
77
|
+
"textSearchLanguage",
|
|
44
78
|
]) {
|
|
45
79
|
if (params[key] !== undefined)
|
|
46
80
|
body[key] = params[key];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@2kw/ai-mcp-server",
|
|
3
|
-
"version": "6.3.0-dev.
|
|
3
|
+
"version": "6.3.0-dev.122",
|
|
4
4
|
"description": "MCP server for 2kw.ai — EU-hosted AI platform: OpenAI-compatible LLM gateway, schema-driven document extraction, transcription, agents with a knowledge base, and cost observability. 158 tools for Claude Code, Cursor, and Windsurf.",
|
|
5
5
|
"mcpName": "ai.2kw/mcp-server",
|
|
6
6
|
"keywords": [
|