
Viking Knowledge Base
STDIOMCP server for VolcEngine Viking Knowledge Base search and document management
MCP server for VolcEngine Viking Knowledge Base search and document management
This MCP server provides a tool to interact with the VolcEngine Viking Knowledge Base Service, allowing you to search and retrieve knowledge from your collections, meanwhile, allowing you to add doc to your collections and get doc processing info by doc_id.
pip install -e .
Or with uv (recommended):
uv pip install -e .
The server requires the following environment variables:
VOLCENGINE_ACCESS_KEY
: Your VolcEngine access keyVOLCENGINE_SECRET_KEY
: Your VolcEngine secret keyOptional environment variables:
KNOWLEDGE_BASE_PROJECT
: Your viking knowledge base project nameKNOWLEDGE_BASE_REGION
: Your viking knowledge base region,if not provided, will use cn-north-1
as defaultPORT
: Port for the FastMCP server (default: 8000)The server can be run with either stdio transport (for MCP integration) or SSE transport:
python -m mcp_server_knowledgebase.server --transport stdio
Or:
python -m mcp_server_knowledgebase.server --transport sse
Add a document to a collection in your project.
add_doc( collection_name="collection_name", add_type="url", doc_id="_mcp_server_auto_gen_doc_id_xxxxxxx", doc_name="doc_xxxx", doc_type="pdf", url="http://xxxxx.pdf" )
Parameters:
collection_name
(required): the name of the collection you want to add document .add_type
(required): the type of the document to add. so far only support "url" now.doc_id
(required): you should generate a unique doc_id based on user's given url and timestamp, the doc_id can only use English letters, numbers, and underscores , and must start with an English letter. It cannot be empty. Length requirement: [1, 128], you can use a format like "_mcp_server_auto_gen_doc_id_xxxxxxx.doc_name
(required): the name of the document to add. you can1 generate a unique doc_name based on user given url and timestamp. the length of doc_name must between 1 and 256. you can use a format like "_mcp_server_auto_gen_doc_name_xxxxxxx.doc_type
(required): the type of the document to add. for structured document, we support xlsx, csv,jsonl, for unstructured document, wu support txt, doc, docx, pdf, markdown, faq.xlsx, pptx". you should judge the doc_type based on user's given url and judge if we support this doc type. if supported, assign this parameter.url
(required): the url of the document to add. user should give a valid url, we will add the doc to the collection.Get information about document by collection_name and doc_id .
get_doc( collection_name="collection_name", doc_id="_mcp_server_auto_gen_doc_id_xxxxxxx", )
Parameters:
collection_name
(required): the name of the collection you want to get information .doc_id
(required): the doc_id of document user want to get information .Get information about a viking knowledge base collection from your project .
get_collection( collection_name="collection_name", )
Parameters:
collection_name
(required): the name of the collection you want to get information .List all knowledge base collections of the globally configured project .
list_collections( )
Search for knowledge in the configured collection based on a query.
search_knowledge( query="How to reset my password?", limit=3, collection_name=None )
Parameters:
query
(required): The search query stringlimit
(optional): Maximum number of results to return (default: 3)collection_name
(optional): Knowledge base collection name to search. If not provided, llm will choose some collections to search based on the description of collectionTo add this server to your MCP configuration, add the following to your MCP settings file:
{ "mcpServers": { "knowledgebase": { "command": "uvx", "args": [ "--from", "git+https://github.com/volcengine/mcp-server#subdirectory=server/mcp_server_knowledgebase", "mcp-server-knowledgebase" ], "env": { "VOLCENGINE_ACCESS_KEY": "your-access-key", "VOLCENGINE_SECRET_KEY": "your-secret-key", "KNOWLEDGE_BASE_PROJECT": "your-project-name", "KNOWLEDGE_BASE_REGION": "your-region" } } } }
Authentication Errors
Connection Timeouts
Empty Results
The server uses Python's logging module with INFO level by default. You can see detailed logs in the console when running the server.
Contributions to improve the Viking Knowledge Base MCP Server are welcome. Please follow these steps:
Please ensure your code follows the project's coding standards and includes appropriate tests.
volcengine/mcp-server is licensed under the MIT License.