Add your description here
Project description
Volcengine Knowledge Base MCP
Claude Desktop 的火山引擎知识库 MCP 服务器,提供知识库搜索和对话功能。
特性
- 🔍 知识库搜索
- 💬 对话补全
- 🔐 安全的凭证管理
- 🚀 简单易用的配置
快速开始
前提条件
- Python 3.10 或更高版本
- Claude Desktop
- 你需要注册一个火山引擎账号,开通知识库服务,并且创建一个知识库
安装
- 克隆仓库:
git clone git@github.com:suqidan/volc-kb-mcp.git
cd volc-kb-mcp
- 安装依赖:
pip install -r requirements.txt
配置 Claude Desktop
编辑 Claude Desktop 配置文件:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
添加以下配置:
{
"mcpServers": {
"kb": {
"command": "python",
"args": [
"/path/to/kb_mcp.py"
]
}
}
}
使用方法
设置好 Claude MCP JSON 配置后,你只需要直接告诉 Claude 你要使用知识库,它就会询问你添加对应的信息,包含 ak, sk, account_id 以及 collection_namme
- 首次使用时配置凭证:
await configure(
access_key="your_access_key",
secret_key="your_secret_key",
account_id=your_account_id,
collection_name="your_collection_name"
)
- 搜索知识库:
result = await search_knowledge("你的查询")
- 对话补全:
messages = [
{"role": "system", "content": "你是一个有帮助的助手"},
{"role": "user", "content": "你好"}
]
response = await chat_completion(messages)
API 文档
configure
配置火山引擎凭证和知识库设置。
参数:
access_key(str): 火山引擎访问密钥secret_key(str): 火山引擎安全密钥account_id(int): 火山引擎账户IDcollection_name(str): 知识库集合名称
search_knowledge
搜索知识库。
参数:
query(str): 搜索查询字符串
chat_completion
获取对话补全响应。
参数:
messages(List[dict]): 对话消息列表stream(bool, 可选): 是否使用流式响应temperature(float, 可选): 温度参数
安全性
- 所有凭证都安全存储在用户本地
- 配置文件权限仅限当前用户访问
- 不会将凭证发送到火山引擎 API 之外的任何地方
故障排除
如果遇到问题:
- 确认凭证信息正确
- 检查配置文件权限
- 查看 Claude Desktop 日志文件
- 如果需要重新配置,删除
~/.config/volc_kb_mcp/config.json
贡献
欢迎提交 Pull Requests!对于重大更改,请先开 issue 讨论您想要更改的内容。
许可证
本项目采用 MIT 许可证 - 详见 LICENSE 文件
作者
suqidan
致谢
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 Distribution
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 volcengine_knowledgebase_mcp-0.1.0.tar.gz.
File metadata
- Download URL: volcengine_knowledgebase_mcp-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97f6b03d0826f23066ae9ded9a8a8e05b1cfeee8537c46be9405def40c7f6b1d
|
|
| MD5 |
3db5979f1ec8b57e22d710eb909a5504
|
|
| BLAKE2b-256 |
b44a91a7ecdd32e2bffc007865e19a0e6f69bc4636b92383f583bd4a25ae7582
|
File details
Details for the file volcengine_knowledgebase_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: volcengine_knowledgebase_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
131e8cfd4c5a79c73f45f543d02200a6e2a2bba4aad2d6bbd5e68645abd99e9a
|
|
| MD5 |
4bcc909ae2a9d39bc2fc99cbb33eb7bc
|
|
| BLAKE2b-256 |
fee93dbf1a61a391c0b7191d3aa7e5417045edf05bd85a82700f95ab68801711
|