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"
}
}
}
}
Metadata
Release files for mcp-knowledge-query-kd 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_knowledge_query_kd-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / mcp_knowledge_query_kd-0.1.1-py3-none-any.whl
| Download URL | mcp_knowledge_query_kd-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
32f208afe5fed8098c6681ce459fe629de67c54fae585318f1ada277237341b3
|
|
BLAKE2b-256 checksum How to use checksums |
a9c210be07c623819431e3e8855d08d3203665c1536f7dd916cb93eb0a4f8845
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for mcp-knowledge-query-kd 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.