MCP server for querying internal knowledge base
Project description
MCP Knowledge Query
这是一个 MCP (Model Context Protocol) 服务器,提供知识库检索工具。它允许 LLM 或者是其他 MCP 客户端查询配置的知识库。
功能
- query_knowledge: 根据关键词检索知识库,支持配置 Top-K、分数阈值和查询扩展(Expand)。
- add: 简单的加法工具(示例)。
安装
确保已安装 Python 3.10+ 和 uv (推荐) 或 pip。
# 使用 uv 运行
uv run mcp-knowledge-query-kd
或者本地安装:
pip install -e .
mcp-knowledge-query-kd
配置
为了安全起见,本工具使用环境变量来管理敏感信息(AK/SK)。在使用前,请确保在运行环境中设置了以下环境变量:
必需的环境变量
HIAGENT_AK: 您的 Access KeyHIAGENT_SK: 您的 Secret KeyHIAGENT_WORKSPACE_ID: 您的工作空间 IDHIAGENT_DATASET_IDS: 默认查询的知识库 ID 列表,用逗号分隔。如果不设置,将使用代码内置的默认 ID。
可选的环境变量
HIAGENT_HOST: API 服务地址,默认为https://hiagent-api.x-peng.com
示例配置 (.env)
您可以参考 .env.example 文件配置您的环境。
如果您是通过 Claude Desktop 使用此 MCP Server,请在 Claude 的配置文件 (claude_desktop_config.json) 中添加环境变量:
{
"mcpServers": {
"knowledge-query": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-knowledge-query-kd",
"run",
"mcp-knowledge-query-kd"
],
"env": {
"HIAGENT_AK": "your_actual_ak",
"HIAGENT_SK": "your_actual_sk",
"HIAGENT_WORKSPACE_ID": "your_workspace_id"
}
}
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_knowledge_query_kd-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcp_knowledge_query_kd-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32f208afe5fed8098c6681ce459fe629de67c54fae585318f1ada277237341b3
|
|
| MD5 |
2631af2473b64f4b79ab2ab50e1aae54
|
|
| BLAKE2b-256 |
a9c210be07c623819431e3e8855d08d3203665c1536f7dd916cb93eb0a4f8845
|