
Viking Knowledge Base MCP Server
MCP火山引擎官方,让 agent 管理并检索 Viking 知识库:按 URL 导入文档、查看处理状态、在集合中搜索相关知识片段,可用来搭建 RAG。需要 Viking API Key 或火山引擎 AK/SK。
Viking Knowledge Base MCP Server
Overview
Viking Knowledge Base MCP Server lets MCP clients such as Claude Desktop, Cursor, Cline, and Trae interact with VolcEngine Viking Knowledge Base. It supports managing and inspecting collections and documents, and searching for relevant knowledge chunks.
Features
- Add a document to a knowledge base collection by URL
- Get document information and processing status
- List documents with cursor pagination
- Get collection information and build status
- List collections in the configured project
- Search a collection with optional document filtering
- Authenticate with either a Viking API key or VolcEngine AK/SK credentials
- Run over stdio or stateless Streamable HTTP
Prerequisites
- Python 3.10 or later
- A Viking Knowledge Base API key, or VolcEngine AK/SK credentials
Installation
Install from PyPI:
pip install mcp-server-knowledgebase
Or install it as a persistent command-line tool with uv:
uv tool install mcp-server-knowledgebase
For local development, clone the repository and install this package in editable mode:
git clone https://github.com/volcengine/mcp-server.git
cd mcp-server/server/mcp_server_knowledgebase
uv pip install -e .
Configuration
Authentication
Configure at least one authentication method:
- API key: set
VIKING_API_KEY. Requests useAuthorization: Bearer <VIKING_API_KEY>. - AK/SK: set both
VOLCENGINE_ACCESS_KEYandVOLCENGINE_SECRET_KEY. Requests use VolcEngine SignerV4 authentication.
When both methods are configured, VIKING_API_KEY takes precedence. If no API
key is set, the access key and secret key must be configured together.
Environment variables
| Environment variable | Description | Default |
|---|---|---|
VIKING_API_KEY | Viking Knowledge Base API key; takes precedence when configured | - |
VOLCENGINE_ACCESS_KEY | VolcEngine access key | - |
VOLCENGINE_SECRET_KEY | VolcEngine secret key | - |
KNOWLEDGE_BASE_PROJECT | Viking Knowledge Base project | default |
KNOWLEDGE_BASE_REGION | VolcEngine region used for AK/SK signing | cn-north-1 |
KNOWLEDGE_BASE_TIMEOUT | Upstream request timeout in seconds | 30 |
MCP_SERVER_HOST | Streamable HTTP bind host | 127.0.0.1 |
MCP_SERVER_PORT | Streamable HTTP port; falls back to PORT | 8000 |
STREAMABLE_HTTP_PATH | Streamable HTTP endpoint path | /mcp |
Running the server
Run with the default stdio transport:
mcp-server-knowledgebase
Run the published package without installing it persistently:
uvx --from mcp-server-knowledgebase mcp-server-knowledgebase
Or run the module directly from a source checkout:
python -m mcp_server_knowledgebase.server --transport stdio
Run with stateless Streamable HTTP:
mcp-server-knowledgebase --transport streamable-http
The default endpoint is http://127.0.0.1:8000/mcp. Set
MCP_SERVER_HOST=0.0.0.0 only when deploying behind a trusted gateway.
MCP protocol and deployment security
The server uses MCP Python SDK 2.x and supports protocol revision 2026-07-28,
including stateless server/discover negotiation. The SDK also handles older
handshake-based clients. Legacy HTTP+SSE is not exposed because it is
deprecated by the 2026-07-28 specification.
Streamable HTTP does not turn the configured Viking API key or VolcEngine AK/SK into client authentication. Protect remote deployments with an authentication gateway or MCP-compatible OAuth, and never expose service credentials to callers.
Available tools
add_doc: Add a document by URLget_doc: Get document information and processing statuslist_docs: List documents with cursor paginationget_collection: Get collection informationlist_collections: List collections in the configured projectsearch_knowledge: Search knowledge in a collection
add_doc
Add a supported document to a collection by URL.
add_doc(
collection_name="product_docs",
add_type="url",
doc_id="product_guide_2026",
doc_name="Product Guide",
doc_type="pdf",
url="https://example.com/product-guide.pdf",
)
Parameters:
collection_name(required): Target collection name.add_type(required): Currently only"url"is supported.doc_id(required): Unique ID containing only letters, numbers, and underscores. It must start with a letter and contain 1–128 characters.doc_name(required): Document name containing 1–256 characters.doc_type(required): One ofxlsx,csv,jsonl,txt,doc,docx,pdf,markdown,faq.xlsx, orpptx.url(required): Accessible URL of the document.
Example result:
{
"collection_name": "product_docs",
"doc_id": "product_guide_2026",
"resource_id": "kb-example"
}
get_doc
Get a document's metadata and processing status.
get_doc(
collection_name="product_docs",
resource_id="kb-example",
doc_id="product_guide_2026",
)
Parameters:
collection_name(optional): Collection containing the document.resource_id(optional): Collection ID. Provide this orcollection_name;resource_idtakes precedence when both are provided.doc_id(required): Document ID.
Example result:
{
"collection_name": "product_docs",
"doc_id": "product_guide_2026",
"doc_name": "Product Guide",
"doc_type": "pdf",
"add_type": "url",
"create_time": 1788220800,
"update_time": 1788220860,
"point_num": 53,
"status": {
"process_status": 0,
"failed_code": null
},
"title": "Product Guide",
"doc_summary": "Product setup and account management instructions.",
"brief_summary": "An introduction to the product.",
"meta": {
"category": "product",
"version": "2026"
},
"video_outline": {
"title": "Product walkthrough",
"summary": "A walkthrough of the product.",
"chapters": [
{
"title": "Account settings",
"content": "Open Account Settings.",
"start_time": "00:00:10",
"end_time": "00:00:30",
"element_content": {
"text": "Account Settings"
}
}
]
},
"audio_outline": {
"title": "Product introduction",
"summary": "An introduction to account management.",
"chapters": [
{
"title": "Resetting your password",
"content": "Select Reset Password.",
"start_time": 10.0,
"end_time": 30.0,
"element_content": {
"text": "Reset Password"
}
}
]
}
}
process_status values: 0 completed, 1 failed, 2 or 3 queued, 5
deleting, and 6 processing. Fields not returned by Viking are null.
Additional result fields include title (document title), doc_summary (document
summary), brief_summary (short summary), meta (metadata), video_outline, and
audio_outline. Outlines contain title, summary, and chapters; chapters
contain title, content, start_time, end_time, and element_content.
list_docs
List documents in a collection using cursor pagination.
list_docs(
collection_name="product_docs",
resource_id="kb-example",
limit=2,
next_token=None,
)
Parameters:
collection_name(optional): Collection whose documents will be listed.resource_id(optional): Collection ID. Provide this orcollection_name;resource_idtakes precedence when both are provided.limit(optional): Number of documents to return, from 1 to 100. Defaults to50.next_token(optional): Opaque cursor returned by the previous call. Omit it for the first page. An empty cursor in the result means all documents have been returned.
Example result:
{
"collection_name": "product_docs",
"total_num": 3,
"count": 1,
"doc_list": [
{
"doc_id": "product_guide_2026",
"doc_name": "Product Guide",
"doc_type": "pdf",
"create_time": 1788220800,
"update_time": 1788220860,
"point_num": 53,
"status": {
"process_status": 0,
"failed_code": null
},
"brief_summary": "An introduction to the product.",
"title": "Product Guide"
}
],
"has_more": true,
"next_token": "opaque-cursor-for-next-page"
}
total_num is null when Viking does not provide it.
get_collection
Get information and build status for a collection.
get_collection(
collection_name="product_docs",
resource_id="kb-example",
)
Parameters:
collection_name(optional): Collection name.resource_id(optional): Collection ID. Provide this orcollection_name;resource_idtakes precedence when both are provided.
Example result:
{
"collection_name": "product_docs",
"description": "Product manuals and release notes",
"status": 1,
"resource_id": "kb-example",
"doc_num": 3,
"create_time": 1788220800,
"update_time": 1788220860
}
Collection status values: -1 pending build, 0 building, 1 completed,
2 failed, and 3 changing.
list_collections
List all collections in the globally configured project.
list_collections()
This tool has no parameters.
Example result:
{
"collection_list": [
{
"collection_name": "product_docs",
"description": "Product manuals and release notes",
"resource_id": "kb-example-1",
"create_time": 1788220800,
"update_time": 1788220860
},
{
"collection_name": "support_faq",
"description": "Frequently asked support questions",
"resource_id": "kb-example-2",
"create_time": 1788220800,
"update_time": 1788220860
}
],
"total_num": 2
}
search_knowledge
Search for relevant chunks in a collection. An optional document filter can include or exclude matching document field values.
search_knowledge(
query="How do I reset my password?",
collection_name="support_faq",
resource_id="kb-example",
limit=10,
doc_filter={
"op": "must",
"field": "doc_id",
"conds": ["account_guide"],
},
)
Parameters:
query(required): Search query, from 1 to 8000 characters.collection_name(optional): Collection to search.resource_id(optional): Collection ID. Provide this orcollection_name;resource_idtakes precedence when both are provided.limit(optional): Maximum number of chunks to return, from 1 to 100. Defaults to10.doc_filter(optional): Object with the following fields:op:"must"to include matches or"must_not"to exclude them.field: Document field to filter, such as"doc_id".conds: Non-empty list of values to match.
Example result:
{
"result_list": [
{
"id": "chunk_001",
"content": "Open Account Settings and select Reset Password.",
"doc_id": "account_guide",
"doc_name": "Account Guide",
"title": "Account Guide",
"doc_type": "pdf",
"score": 0.85,
"rerank_score": 0.92,
"chunk_title": "Resetting your password",
"audio_start_time": null,
"audio_end_time": null,
"video_start_time": null,
"video_end_time": null,
"chunk_attachment": [
{
"uuid": "image_1",
"caption": "Account Settings",
"type": "image"
}
]
}
]
}
doc_id and doc_name are null when Viking does not provide document
metadata. A non-null doc_id can be passed directly to get_doc.
Chunks also include title (document title), doc_type (document type), score
(search score), rerank_score, chunk_title, audio_start_time, audio_end_time,
video_start_time, video_end_time, and chunk_attachment (attachments). Each
attachment contains uuid, caption, and type.
Image links for image, doc-image, and table attachments are returned as MCP
ResourceLink blocks with uri, name, description, and mimeType (image/*),
and URL is not included in chunk_attachment.
Example image link content block:
{
"type": "resource_link",
"uri": "https://example.com/account-settings.png",
"name": "image_1",
"description": "Account Settings",
"mimeType": "image/*"
}
MCP client configuration
Example stdio configuration using uvx and a Viking API key:
{
"mcpServers": {
"knowledgebase": {
"command": "uvx",
"args": [
"--from",
"mcp-server-knowledgebase>=0.2.2",
"mcp-server-knowledgebase"
],
"env": {
"VIKING_API_KEY": "your-viking-api-key",
"KNOWLEDGE_BASE_PROJECT": "your-project-name",
"KNOWLEDGE_BASE_REGION": "cn-north-1"
}
}
}
}
You can instead configure both VOLCENGINE_ACCESS_KEY and
VOLCENGINE_SECRET_KEY. If all three credentials are present,
VIKING_API_KEY takes precedence.
Troubleshooting
- Authentication errors
- Verify the API key or AK/SK credentials.
- When using AK/SK, configure both values together.
- Check that the credentials can access the configured project and collection.
- Connection timeouts
- Check network connectivity to the VolcEngine API.
- Adjust
KNOWLEDGE_BASE_TIMEOUTwhen necessary.
- Empty results
- Verify the project and collection names.
- For search, try a broader query or remove the document filter.
- For document listing, continue only with the exact
next_tokenreturned by the previous call.
License
This project is licensed under the MIT License.
相關資源

Cognee MCP
MCP把 cognee 记忆引擎作为 MCP 服务运行,通过 remember、recall、forget 三个工具把文档与对话写入知识图谱和向量库,供 agent 跨会话检索。需先用 Docker 或 uv 启动服务,默认需要 LLM API Key,也可连接 Cognee Cloud。
topoteretes/cognee33.7k
Graphiti MCP Server
MCP把对话与业务数据写入 Graphiti 时序知识图谱,让 agent 按实体、事实和时间检索长期记忆。Zep 开源维护,需先用 Docker 启动 FalkorDB 或 Neo4j 与服务,并配置 LLM API Key。
getzep/graphiti33.2k
WeKnora CLI
CLI腾讯开源知识库平台 WeKnora 的官方命令行:上传文档、管理知识库、混合检索并基于知识库回答问题,也能作为只读 MCP 服务运行,适合客服与行政团队维护内部知识库。需先自行部署 WeKnora 服务,用 Go 1.26+ 从源码编译。
Tencent/WeKnora38.6k
Qdrant MCP Server
MCP把 Qdrant 向量数据库用作 agent 的语义记忆层:存入信息并按语义检索,可连接远程实例或本地路径,默认用 FastEmbed 生成向量。Qdrant 官方维护。
qdrant/mcp-server-qdrant1.6k
Chroma MCP Server
MCPChroma 官方 MCP:让 agent 创建和管理集合、写入文档,并用向量检索、全文检索与元数据过滤取回内容。可连接内存或本地持久化库、自建实例和 Chroma Cloud。
chroma-core/chroma-mcp604
Scrapling
CLI自适应网页抓取框架:scrapling extract 一条命令即可把网页抓成 Markdown、纯文本或 HTML,支持 CSS 选择器与浏览器渲染动态页面,另有 MCP 服务(需装 ai 扩展)。需 Python 3.10+,首次使用需安装浏览器。
D4Vinci/Scrapling107k