mcp-server-knowledgebase 0.2.1__tar.gz → 0.2.2__tar.gz
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.
- {mcp_server_knowledgebase-0.2.1 → mcp_server_knowledgebase-0.2.2}/PKG-INFO +128 -28
- {mcp_server_knowledgebase-0.2.1 → mcp_server_knowledgebase-0.2.2}/README.md +127 -27
- {mcp_server_knowledgebase-0.2.1 → mcp_server_knowledgebase-0.2.2}/README_zh.md +123 -27
- {mcp_server_knowledgebase-0.2.1 → mcp_server_knowledgebase-0.2.2}/pyproject.toml +1 -1
- {mcp_server_knowledgebase-0.2.1 → mcp_server_knowledgebase-0.2.2}/src/mcp_server_knowledgebase/config.py +1 -1
- mcp_server_knowledgebase-0.2.2/src/mcp_server_knowledgebase/models.py +127 -0
- mcp_server_knowledgebase-0.2.2/src/mcp_server_knowledgebase/server.py +361 -0
- {mcp_server_knowledgebase-0.2.1 → mcp_server_knowledgebase-0.2.2}/tests/test_tools.py +71 -28
- {mcp_server_knowledgebase-0.2.1 → mcp_server_knowledgebase-0.2.2}/uv.lock +1 -1
- mcp_server_knowledgebase-0.2.1/src/mcp_server_knowledgebase/models.py +0 -75
- mcp_server_knowledgebase-0.2.1/src/mcp_server_knowledgebase/server.py +0 -399
- {mcp_server_knowledgebase-0.2.1 → mcp_server_knowledgebase-0.2.2}/.gitignore +0 -0
- {mcp_server_knowledgebase-0.2.1 → mcp_server_knowledgebase-0.2.2}/.python-version +0 -0
- {mcp_server_knowledgebase-0.2.1 → mcp_server_knowledgebase-0.2.2}/src/mcp_server_knowledgebase/__init__.py +0 -0
- {mcp_server_knowledgebase-0.2.1 → mcp_server_knowledgebase-0.2.2}/src/mcp_server_knowledgebase/common/__init__.py +0 -0
- {mcp_server_knowledgebase-0.2.1 → mcp_server_knowledgebase-0.2.2}/src/mcp_server_knowledgebase/common/auth.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: mcp-server-knowledgebase
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: MCP server for Viking Knowledge Base Service
|
|
5
5
|
License: MIT
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -168,7 +168,8 @@ Example result:
|
|
|
168
168
|
```json
|
|
169
169
|
{
|
|
170
170
|
"collection_name": "product_docs",
|
|
171
|
-
"doc_id": "product_guide_2026"
|
|
171
|
+
"doc_id": "product_guide_2026",
|
|
172
|
+
"resource_id": "kb-example"
|
|
172
173
|
}
|
|
173
174
|
```
|
|
174
175
|
|
|
@@ -179,13 +180,16 @@ Get a document's metadata and processing status.
|
|
|
179
180
|
```python
|
|
180
181
|
get_doc(
|
|
181
182
|
collection_name="product_docs",
|
|
183
|
+
resource_id="kb-example",
|
|
182
184
|
doc_id="product_guide_2026",
|
|
183
185
|
)
|
|
184
186
|
```
|
|
185
187
|
|
|
186
188
|
Parameters:
|
|
187
189
|
|
|
188
|
-
- `collection_name` (
|
|
190
|
+
- `collection_name` (optional): Collection containing the document.
|
|
191
|
+
- `resource_id` (optional): Collection ID. Provide this or `collection_name`;
|
|
192
|
+
`resource_id` takes precedence when both are provided.
|
|
189
193
|
- `doc_id` (required): Document ID.
|
|
190
194
|
|
|
191
195
|
Example result:
|
|
@@ -196,7 +200,6 @@ Example result:
|
|
|
196
200
|
"doc_id": "product_guide_2026",
|
|
197
201
|
"doc_name": "Product Guide",
|
|
198
202
|
"doc_type": "pdf",
|
|
199
|
-
"url": "https://example.com/product-guide.pdf",
|
|
200
203
|
"add_type": "url",
|
|
201
204
|
"create_time": 1788220800,
|
|
202
205
|
"update_time": 1788220860,
|
|
@@ -204,13 +207,54 @@ Example result:
|
|
|
204
207
|
"status": {
|
|
205
208
|
"process_status": 0,
|
|
206
209
|
"failed_code": null
|
|
210
|
+
},
|
|
211
|
+
"title": "Product Guide",
|
|
212
|
+
"doc_summary": "Product setup and account management instructions.",
|
|
213
|
+
"brief_summary": "An introduction to the product.",
|
|
214
|
+
"meta": {
|
|
215
|
+
"category": "product",
|
|
216
|
+
"version": "2026"
|
|
217
|
+
},
|
|
218
|
+
"video_outline": {
|
|
219
|
+
"title": "Product walkthrough",
|
|
220
|
+
"summary": "A walkthrough of the product.",
|
|
221
|
+
"chapters": [
|
|
222
|
+
{
|
|
223
|
+
"title": "Account settings",
|
|
224
|
+
"content": "Open Account Settings.",
|
|
225
|
+
"start_time": "00:00:10",
|
|
226
|
+
"end_time": "00:00:30",
|
|
227
|
+
"element_content": {
|
|
228
|
+
"text": "Account Settings"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
"audio_outline": {
|
|
234
|
+
"title": "Product introduction",
|
|
235
|
+
"summary": "An introduction to account management.",
|
|
236
|
+
"chapters": [
|
|
237
|
+
{
|
|
238
|
+
"title": "Resetting your password",
|
|
239
|
+
"content": "Select Reset Password.",
|
|
240
|
+
"start_time": 10.0,
|
|
241
|
+
"end_time": 30.0,
|
|
242
|
+
"element_content": {
|
|
243
|
+
"text": "Reset Password"
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
]
|
|
207
247
|
}
|
|
208
248
|
}
|
|
209
249
|
```
|
|
210
250
|
|
|
211
251
|
`process_status` values: `0` completed, `1` failed, `2` or `3` queued, `5`
|
|
212
|
-
deleting, and `6` processing. Fields not returned by Viking are `null
|
|
213
|
-
|
|
252
|
+
deleting, and `6` processing. Fields not returned by Viking are `null`.
|
|
253
|
+
|
|
254
|
+
Additional result fields include `title` (document title), `doc_summary` (document
|
|
255
|
+
summary), `brief_summary` (short summary), `meta` (metadata), `video_outline`, and
|
|
256
|
+
`audio_outline`. Outlines contain `title`, `summary`, and `chapters`; chapters
|
|
257
|
+
contain `title`, `content`, `start_time`, `end_time`, and `element_content`.
|
|
214
258
|
|
|
215
259
|
### `list_docs`
|
|
216
260
|
|
|
@@ -219,6 +263,7 @@ List documents in a collection using cursor pagination.
|
|
|
219
263
|
```python
|
|
220
264
|
list_docs(
|
|
221
265
|
collection_name="product_docs",
|
|
266
|
+
resource_id="kb-example",
|
|
222
267
|
limit=2,
|
|
223
268
|
next_token=None,
|
|
224
269
|
)
|
|
@@ -226,9 +271,11 @@ list_docs(
|
|
|
226
271
|
|
|
227
272
|
Parameters:
|
|
228
273
|
|
|
229
|
-
- `collection_name` (
|
|
274
|
+
- `collection_name` (optional): Collection whose documents will be listed.
|
|
275
|
+
- `resource_id` (optional): Collection ID. Provide this or `collection_name`;
|
|
276
|
+
`resource_id` takes precedence when both are provided.
|
|
230
277
|
- `limit` (optional): Number of documents to return, from 1 to 100. Defaults
|
|
231
|
-
to `
|
|
278
|
+
to `50`.
|
|
232
279
|
- `next_token` (optional): Opaque cursor returned by the previous call. Omit
|
|
233
280
|
it for the first page. An empty cursor in the result means all documents
|
|
234
281
|
have been returned.
|
|
@@ -239,23 +286,21 @@ Example result:
|
|
|
239
286
|
{
|
|
240
287
|
"collection_name": "product_docs",
|
|
241
288
|
"total_num": 3,
|
|
242
|
-
"count":
|
|
289
|
+
"count": 1,
|
|
243
290
|
"doc_list": [
|
|
244
291
|
{
|
|
245
|
-
"collection_name": "product_docs",
|
|
246
292
|
"doc_id": "product_guide_2026",
|
|
247
293
|
"doc_name": "Product Guide",
|
|
248
294
|
"doc_type": "pdf",
|
|
249
|
-
"url": "https://example.com/product-guide.pdf",
|
|
250
|
-
"add_type": "url",
|
|
251
295
|
"create_time": 1788220800,
|
|
252
296
|
"update_time": 1788220860,
|
|
253
297
|
"point_num": 53,
|
|
254
298
|
"status": {
|
|
255
|
-
"process_status": 0
|
|
299
|
+
"process_status": 0,
|
|
300
|
+
"failed_code": null
|
|
256
301
|
},
|
|
257
302
|
"brief_summary": "An introduction to the product.",
|
|
258
|
-
"
|
|
303
|
+
"title": "Product Guide"
|
|
259
304
|
}
|
|
260
305
|
],
|
|
261
306
|
"has_more": true,
|
|
@@ -263,20 +308,24 @@ Example result:
|
|
|
263
308
|
}
|
|
264
309
|
```
|
|
265
310
|
|
|
266
|
-
`total_num` is `null` when Viking does not provide it.
|
|
267
|
-
preserve additional upstream fields such as summaries and token counts.
|
|
311
|
+
`total_num` is `null` when Viking does not provide it.
|
|
268
312
|
|
|
269
313
|
### `get_collection`
|
|
270
314
|
|
|
271
315
|
Get information and build status for a collection.
|
|
272
316
|
|
|
273
317
|
```python
|
|
274
|
-
get_collection(
|
|
318
|
+
get_collection(
|
|
319
|
+
collection_name="product_docs",
|
|
320
|
+
resource_id="kb-example",
|
|
321
|
+
)
|
|
275
322
|
```
|
|
276
323
|
|
|
277
324
|
Parameters:
|
|
278
325
|
|
|
279
|
-
- `collection_name` (
|
|
326
|
+
- `collection_name` (optional): Collection name.
|
|
327
|
+
- `resource_id` (optional): Collection ID. Provide this or `collection_name`;
|
|
328
|
+
`resource_id` takes precedence when both are provided.
|
|
280
329
|
|
|
281
330
|
Example result:
|
|
282
331
|
|
|
@@ -284,7 +333,11 @@ Example result:
|
|
|
284
333
|
{
|
|
285
334
|
"collection_name": "product_docs",
|
|
286
335
|
"description": "Product manuals and release notes",
|
|
287
|
-
"status": 1
|
|
336
|
+
"status": 1,
|
|
337
|
+
"resource_id": "kb-example",
|
|
338
|
+
"doc_num": 3,
|
|
339
|
+
"create_time": 1788220800,
|
|
340
|
+
"update_time": 1788220860
|
|
288
341
|
}
|
|
289
342
|
```
|
|
290
343
|
|
|
@@ -308,13 +361,20 @@ Example result:
|
|
|
308
361
|
"collection_list": [
|
|
309
362
|
{
|
|
310
363
|
"collection_name": "product_docs",
|
|
311
|
-
"description": "Product manuals and release notes"
|
|
364
|
+
"description": "Product manuals and release notes",
|
|
365
|
+
"resource_id": "kb-example-1",
|
|
366
|
+
"create_time": 1788220800,
|
|
367
|
+
"update_time": 1788220860
|
|
312
368
|
},
|
|
313
369
|
{
|
|
314
370
|
"collection_name": "support_faq",
|
|
315
|
-
"description": "Frequently asked support questions"
|
|
371
|
+
"description": "Frequently asked support questions",
|
|
372
|
+
"resource_id": "kb-example-2",
|
|
373
|
+
"create_time": 1788220800,
|
|
374
|
+
"update_time": 1788220860
|
|
316
375
|
}
|
|
317
|
-
]
|
|
376
|
+
],
|
|
377
|
+
"total_num": 2
|
|
318
378
|
}
|
|
319
379
|
```
|
|
320
380
|
|
|
@@ -327,7 +387,8 @@ include or exclude matching document field values.
|
|
|
327
387
|
search_knowledge(
|
|
328
388
|
query="How do I reset my password?",
|
|
329
389
|
collection_name="support_faq",
|
|
330
|
-
|
|
390
|
+
resource_id="kb-example",
|
|
391
|
+
limit=10,
|
|
331
392
|
doc_filter={
|
|
332
393
|
"op": "must",
|
|
333
394
|
"field": "doc_id",
|
|
@@ -338,10 +399,12 @@ search_knowledge(
|
|
|
338
399
|
|
|
339
400
|
Parameters:
|
|
340
401
|
|
|
341
|
-
- `query` (required): Search query.
|
|
342
|
-
- `collection_name` (
|
|
402
|
+
- `query` (required): Search query, from 1 to 8000 characters.
|
|
403
|
+
- `collection_name` (optional): Collection to search.
|
|
404
|
+
- `resource_id` (optional): Collection ID. Provide this or `collection_name`;
|
|
405
|
+
`resource_id` takes precedence when both are provided.
|
|
343
406
|
- `limit` (optional): Maximum number of chunks to return, from 1 to 100.
|
|
344
|
-
Defaults to `
|
|
407
|
+
Defaults to `10`.
|
|
345
408
|
- `doc_filter` (optional): Object with the following fields:
|
|
346
409
|
- `op`: `"must"` to include matches or `"must_not"` to exclude them.
|
|
347
410
|
- `field`: Document field to filter, such as `"doc_id"`.
|
|
@@ -356,7 +419,23 @@ Example result:
|
|
|
356
419
|
"id": "chunk_001",
|
|
357
420
|
"content": "Open Account Settings and select Reset Password.",
|
|
358
421
|
"doc_id": "account_guide",
|
|
359
|
-
"doc_name": "Account Guide"
|
|
422
|
+
"doc_name": "Account Guide",
|
|
423
|
+
"title": "Account Guide",
|
|
424
|
+
"doc_type": "pdf",
|
|
425
|
+
"score": 0.85,
|
|
426
|
+
"rerank_score": 0.92,
|
|
427
|
+
"chunk_title": "Resetting your password",
|
|
428
|
+
"audio_start_time": null,
|
|
429
|
+
"audio_end_time": null,
|
|
430
|
+
"video_start_time": null,
|
|
431
|
+
"video_end_time": null,
|
|
432
|
+
"chunk_attachment": [
|
|
433
|
+
{
|
|
434
|
+
"uuid": "image_1",
|
|
435
|
+
"caption": "Account Settings",
|
|
436
|
+
"type": "image"
|
|
437
|
+
}
|
|
438
|
+
]
|
|
360
439
|
}
|
|
361
440
|
]
|
|
362
441
|
}
|
|
@@ -365,6 +444,27 @@ Example result:
|
|
|
365
444
|
`doc_id` and `doc_name` are `null` when Viking does not provide document
|
|
366
445
|
metadata. A non-null `doc_id` can be passed directly to `get_doc`.
|
|
367
446
|
|
|
447
|
+
Chunks also include `title` (document title), `doc_type` (document type), `score`
|
|
448
|
+
(search score), `rerank_score`, `chunk_title`, `audio_start_time`, `audio_end_time`,
|
|
449
|
+
`video_start_time`, `video_end_time`, and `chunk_attachment` (attachments). Each
|
|
450
|
+
attachment contains `uuid`, `caption`, and `type`.
|
|
451
|
+
|
|
452
|
+
Image links for `image`, `doc-image`, and `table` attachments are returned as MCP
|
|
453
|
+
`ResourceLink` blocks with `uri`, `name`, `description`, and `mimeType` (`image/*`),
|
|
454
|
+
and URL is not included in `chunk_attachment`.
|
|
455
|
+
|
|
456
|
+
Example image link content block:
|
|
457
|
+
|
|
458
|
+
```json
|
|
459
|
+
{
|
|
460
|
+
"type": "resource_link",
|
|
461
|
+
"uri": "https://example.com/account-settings.png",
|
|
462
|
+
"name": "image_1",
|
|
463
|
+
"description": "Account Settings",
|
|
464
|
+
"mimeType": "image/*"
|
|
465
|
+
}
|
|
466
|
+
```
|
|
467
|
+
|
|
368
468
|
## MCP client configuration
|
|
369
469
|
|
|
370
470
|
Example stdio configuration using `uvx` and a Viking API key:
|
|
@@ -376,7 +476,7 @@ Example stdio configuration using `uvx` and a Viking API key:
|
|
|
376
476
|
"command": "uvx",
|
|
377
477
|
"args": [
|
|
378
478
|
"--from",
|
|
379
|
-
"mcp-server-knowledgebase>=0.2.
|
|
479
|
+
"mcp-server-knowledgebase>=0.2.2",
|
|
380
480
|
"mcp-server-knowledgebase"
|
|
381
481
|
],
|
|
382
482
|
"env": {
|
|
@@ -157,7 +157,8 @@ Example result:
|
|
|
157
157
|
```json
|
|
158
158
|
{
|
|
159
159
|
"collection_name": "product_docs",
|
|
160
|
-
"doc_id": "product_guide_2026"
|
|
160
|
+
"doc_id": "product_guide_2026",
|
|
161
|
+
"resource_id": "kb-example"
|
|
161
162
|
}
|
|
162
163
|
```
|
|
163
164
|
|
|
@@ -168,13 +169,16 @@ Get a document's metadata and processing status.
|
|
|
168
169
|
```python
|
|
169
170
|
get_doc(
|
|
170
171
|
collection_name="product_docs",
|
|
172
|
+
resource_id="kb-example",
|
|
171
173
|
doc_id="product_guide_2026",
|
|
172
174
|
)
|
|
173
175
|
```
|
|
174
176
|
|
|
175
177
|
Parameters:
|
|
176
178
|
|
|
177
|
-
- `collection_name` (
|
|
179
|
+
- `collection_name` (optional): Collection containing the document.
|
|
180
|
+
- `resource_id` (optional): Collection ID. Provide this or `collection_name`;
|
|
181
|
+
`resource_id` takes precedence when both are provided.
|
|
178
182
|
- `doc_id` (required): Document ID.
|
|
179
183
|
|
|
180
184
|
Example result:
|
|
@@ -185,7 +189,6 @@ Example result:
|
|
|
185
189
|
"doc_id": "product_guide_2026",
|
|
186
190
|
"doc_name": "Product Guide",
|
|
187
191
|
"doc_type": "pdf",
|
|
188
|
-
"url": "https://example.com/product-guide.pdf",
|
|
189
192
|
"add_type": "url",
|
|
190
193
|
"create_time": 1788220800,
|
|
191
194
|
"update_time": 1788220860,
|
|
@@ -193,13 +196,54 @@ Example result:
|
|
|
193
196
|
"status": {
|
|
194
197
|
"process_status": 0,
|
|
195
198
|
"failed_code": null
|
|
199
|
+
},
|
|
200
|
+
"title": "Product Guide",
|
|
201
|
+
"doc_summary": "Product setup and account management instructions.",
|
|
202
|
+
"brief_summary": "An introduction to the product.",
|
|
203
|
+
"meta": {
|
|
204
|
+
"category": "product",
|
|
205
|
+
"version": "2026"
|
|
206
|
+
},
|
|
207
|
+
"video_outline": {
|
|
208
|
+
"title": "Product walkthrough",
|
|
209
|
+
"summary": "A walkthrough of the product.",
|
|
210
|
+
"chapters": [
|
|
211
|
+
{
|
|
212
|
+
"title": "Account settings",
|
|
213
|
+
"content": "Open Account Settings.",
|
|
214
|
+
"start_time": "00:00:10",
|
|
215
|
+
"end_time": "00:00:30",
|
|
216
|
+
"element_content": {
|
|
217
|
+
"text": "Account Settings"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
"audio_outline": {
|
|
223
|
+
"title": "Product introduction",
|
|
224
|
+
"summary": "An introduction to account management.",
|
|
225
|
+
"chapters": [
|
|
226
|
+
{
|
|
227
|
+
"title": "Resetting your password",
|
|
228
|
+
"content": "Select Reset Password.",
|
|
229
|
+
"start_time": 10.0,
|
|
230
|
+
"end_time": 30.0,
|
|
231
|
+
"element_content": {
|
|
232
|
+
"text": "Reset Password"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
]
|
|
196
236
|
}
|
|
197
237
|
}
|
|
198
238
|
```
|
|
199
239
|
|
|
200
240
|
`process_status` values: `0` completed, `1` failed, `2` or `3` queued, `5`
|
|
201
|
-
deleting, and `6` processing. Fields not returned by Viking are `null
|
|
202
|
-
|
|
241
|
+
deleting, and `6` processing. Fields not returned by Viking are `null`.
|
|
242
|
+
|
|
243
|
+
Additional result fields include `title` (document title), `doc_summary` (document
|
|
244
|
+
summary), `brief_summary` (short summary), `meta` (metadata), `video_outline`, and
|
|
245
|
+
`audio_outline`. Outlines contain `title`, `summary`, and `chapters`; chapters
|
|
246
|
+
contain `title`, `content`, `start_time`, `end_time`, and `element_content`.
|
|
203
247
|
|
|
204
248
|
### `list_docs`
|
|
205
249
|
|
|
@@ -208,6 +252,7 @@ List documents in a collection using cursor pagination.
|
|
|
208
252
|
```python
|
|
209
253
|
list_docs(
|
|
210
254
|
collection_name="product_docs",
|
|
255
|
+
resource_id="kb-example",
|
|
211
256
|
limit=2,
|
|
212
257
|
next_token=None,
|
|
213
258
|
)
|
|
@@ -215,9 +260,11 @@ list_docs(
|
|
|
215
260
|
|
|
216
261
|
Parameters:
|
|
217
262
|
|
|
218
|
-
- `collection_name` (
|
|
263
|
+
- `collection_name` (optional): Collection whose documents will be listed.
|
|
264
|
+
- `resource_id` (optional): Collection ID. Provide this or `collection_name`;
|
|
265
|
+
`resource_id` takes precedence when both are provided.
|
|
219
266
|
- `limit` (optional): Number of documents to return, from 1 to 100. Defaults
|
|
220
|
-
to `
|
|
267
|
+
to `50`.
|
|
221
268
|
- `next_token` (optional): Opaque cursor returned by the previous call. Omit
|
|
222
269
|
it for the first page. An empty cursor in the result means all documents
|
|
223
270
|
have been returned.
|
|
@@ -228,23 +275,21 @@ Example result:
|
|
|
228
275
|
{
|
|
229
276
|
"collection_name": "product_docs",
|
|
230
277
|
"total_num": 3,
|
|
231
|
-
"count":
|
|
278
|
+
"count": 1,
|
|
232
279
|
"doc_list": [
|
|
233
280
|
{
|
|
234
|
-
"collection_name": "product_docs",
|
|
235
281
|
"doc_id": "product_guide_2026",
|
|
236
282
|
"doc_name": "Product Guide",
|
|
237
283
|
"doc_type": "pdf",
|
|
238
|
-
"url": "https://example.com/product-guide.pdf",
|
|
239
|
-
"add_type": "url",
|
|
240
284
|
"create_time": 1788220800,
|
|
241
285
|
"update_time": 1788220860,
|
|
242
286
|
"point_num": 53,
|
|
243
287
|
"status": {
|
|
244
|
-
"process_status": 0
|
|
288
|
+
"process_status": 0,
|
|
289
|
+
"failed_code": null
|
|
245
290
|
},
|
|
246
291
|
"brief_summary": "An introduction to the product.",
|
|
247
|
-
"
|
|
292
|
+
"title": "Product Guide"
|
|
248
293
|
}
|
|
249
294
|
],
|
|
250
295
|
"has_more": true,
|
|
@@ -252,20 +297,24 @@ Example result:
|
|
|
252
297
|
}
|
|
253
298
|
```
|
|
254
299
|
|
|
255
|
-
`total_num` is `null` when Viking does not provide it.
|
|
256
|
-
preserve additional upstream fields such as summaries and token counts.
|
|
300
|
+
`total_num` is `null` when Viking does not provide it.
|
|
257
301
|
|
|
258
302
|
### `get_collection`
|
|
259
303
|
|
|
260
304
|
Get information and build status for a collection.
|
|
261
305
|
|
|
262
306
|
```python
|
|
263
|
-
get_collection(
|
|
307
|
+
get_collection(
|
|
308
|
+
collection_name="product_docs",
|
|
309
|
+
resource_id="kb-example",
|
|
310
|
+
)
|
|
264
311
|
```
|
|
265
312
|
|
|
266
313
|
Parameters:
|
|
267
314
|
|
|
268
|
-
- `collection_name` (
|
|
315
|
+
- `collection_name` (optional): Collection name.
|
|
316
|
+
- `resource_id` (optional): Collection ID. Provide this or `collection_name`;
|
|
317
|
+
`resource_id` takes precedence when both are provided.
|
|
269
318
|
|
|
270
319
|
Example result:
|
|
271
320
|
|
|
@@ -273,7 +322,11 @@ Example result:
|
|
|
273
322
|
{
|
|
274
323
|
"collection_name": "product_docs",
|
|
275
324
|
"description": "Product manuals and release notes",
|
|
276
|
-
"status": 1
|
|
325
|
+
"status": 1,
|
|
326
|
+
"resource_id": "kb-example",
|
|
327
|
+
"doc_num": 3,
|
|
328
|
+
"create_time": 1788220800,
|
|
329
|
+
"update_time": 1788220860
|
|
277
330
|
}
|
|
278
331
|
```
|
|
279
332
|
|
|
@@ -297,13 +350,20 @@ Example result:
|
|
|
297
350
|
"collection_list": [
|
|
298
351
|
{
|
|
299
352
|
"collection_name": "product_docs",
|
|
300
|
-
"description": "Product manuals and release notes"
|
|
353
|
+
"description": "Product manuals and release notes",
|
|
354
|
+
"resource_id": "kb-example-1",
|
|
355
|
+
"create_time": 1788220800,
|
|
356
|
+
"update_time": 1788220860
|
|
301
357
|
},
|
|
302
358
|
{
|
|
303
359
|
"collection_name": "support_faq",
|
|
304
|
-
"description": "Frequently asked support questions"
|
|
360
|
+
"description": "Frequently asked support questions",
|
|
361
|
+
"resource_id": "kb-example-2",
|
|
362
|
+
"create_time": 1788220800,
|
|
363
|
+
"update_time": 1788220860
|
|
305
364
|
}
|
|
306
|
-
]
|
|
365
|
+
],
|
|
366
|
+
"total_num": 2
|
|
307
367
|
}
|
|
308
368
|
```
|
|
309
369
|
|
|
@@ -316,7 +376,8 @@ include or exclude matching document field values.
|
|
|
316
376
|
search_knowledge(
|
|
317
377
|
query="How do I reset my password?",
|
|
318
378
|
collection_name="support_faq",
|
|
319
|
-
|
|
379
|
+
resource_id="kb-example",
|
|
380
|
+
limit=10,
|
|
320
381
|
doc_filter={
|
|
321
382
|
"op": "must",
|
|
322
383
|
"field": "doc_id",
|
|
@@ -327,10 +388,12 @@ search_knowledge(
|
|
|
327
388
|
|
|
328
389
|
Parameters:
|
|
329
390
|
|
|
330
|
-
- `query` (required): Search query.
|
|
331
|
-
- `collection_name` (
|
|
391
|
+
- `query` (required): Search query, from 1 to 8000 characters.
|
|
392
|
+
- `collection_name` (optional): Collection to search.
|
|
393
|
+
- `resource_id` (optional): Collection ID. Provide this or `collection_name`;
|
|
394
|
+
`resource_id` takes precedence when both are provided.
|
|
332
395
|
- `limit` (optional): Maximum number of chunks to return, from 1 to 100.
|
|
333
|
-
Defaults to `
|
|
396
|
+
Defaults to `10`.
|
|
334
397
|
- `doc_filter` (optional): Object with the following fields:
|
|
335
398
|
- `op`: `"must"` to include matches or `"must_not"` to exclude them.
|
|
336
399
|
- `field`: Document field to filter, such as `"doc_id"`.
|
|
@@ -345,7 +408,23 @@ Example result:
|
|
|
345
408
|
"id": "chunk_001",
|
|
346
409
|
"content": "Open Account Settings and select Reset Password.",
|
|
347
410
|
"doc_id": "account_guide",
|
|
348
|
-
"doc_name": "Account Guide"
|
|
411
|
+
"doc_name": "Account Guide",
|
|
412
|
+
"title": "Account Guide",
|
|
413
|
+
"doc_type": "pdf",
|
|
414
|
+
"score": 0.85,
|
|
415
|
+
"rerank_score": 0.92,
|
|
416
|
+
"chunk_title": "Resetting your password",
|
|
417
|
+
"audio_start_time": null,
|
|
418
|
+
"audio_end_time": null,
|
|
419
|
+
"video_start_time": null,
|
|
420
|
+
"video_end_time": null,
|
|
421
|
+
"chunk_attachment": [
|
|
422
|
+
{
|
|
423
|
+
"uuid": "image_1",
|
|
424
|
+
"caption": "Account Settings",
|
|
425
|
+
"type": "image"
|
|
426
|
+
}
|
|
427
|
+
]
|
|
349
428
|
}
|
|
350
429
|
]
|
|
351
430
|
}
|
|
@@ -354,6 +433,27 @@ Example result:
|
|
|
354
433
|
`doc_id` and `doc_name` are `null` when Viking does not provide document
|
|
355
434
|
metadata. A non-null `doc_id` can be passed directly to `get_doc`.
|
|
356
435
|
|
|
436
|
+
Chunks also include `title` (document title), `doc_type` (document type), `score`
|
|
437
|
+
(search score), `rerank_score`, `chunk_title`, `audio_start_time`, `audio_end_time`,
|
|
438
|
+
`video_start_time`, `video_end_time`, and `chunk_attachment` (attachments). Each
|
|
439
|
+
attachment contains `uuid`, `caption`, and `type`.
|
|
440
|
+
|
|
441
|
+
Image links for `image`, `doc-image`, and `table` attachments are returned as MCP
|
|
442
|
+
`ResourceLink` blocks with `uri`, `name`, `description`, and `mimeType` (`image/*`),
|
|
443
|
+
and URL is not included in `chunk_attachment`.
|
|
444
|
+
|
|
445
|
+
Example image link content block:
|
|
446
|
+
|
|
447
|
+
```json
|
|
448
|
+
{
|
|
449
|
+
"type": "resource_link",
|
|
450
|
+
"uri": "https://example.com/account-settings.png",
|
|
451
|
+
"name": "image_1",
|
|
452
|
+
"description": "Account Settings",
|
|
453
|
+
"mimeType": "image/*"
|
|
454
|
+
}
|
|
455
|
+
```
|
|
456
|
+
|
|
357
457
|
## MCP client configuration
|
|
358
458
|
|
|
359
459
|
Example stdio configuration using `uvx` and a Viking API key:
|
|
@@ -365,7 +465,7 @@ Example stdio configuration using `uvx` and a Viking API key:
|
|
|
365
465
|
"command": "uvx",
|
|
366
466
|
"args": [
|
|
367
467
|
"--from",
|
|
368
|
-
"mcp-server-knowledgebase>=0.2.
|
|
468
|
+
"mcp-server-knowledgebase>=0.2.2",
|
|
369
469
|
"mcp-server-knowledgebase"
|
|
370
470
|
],
|
|
371
471
|
"env": {
|