ima-kb-mcp
腾讯 ima 知识库的 MCP 服务器。基于官方 IMA OpenAPI,提供知识库搜索、浏览、读取原文能力,可用于 Cherry Studio、Claude Desktop、Cursor 等支持 MCP 的客户端。
功能
| 工具 | 作用 |
|---|---|
search_knowledge_bases |
搜索 / 列出知识库 |
get_knowledge_base_detail |
知识库详细信息 |
list_knowledge |
浏览知识库内容(含文件夹) |
search_knowledge |
在知识库内全文搜索(如"断路器 低电压脱扣") |
get_media_info |
获取文件原文访问地址(PDF 等) |
search_notes |
搜索笔记 |
get_note_content |
读取笔记正文 |
raw_call |
直接调用任意 IMA OpenAPI 接口 |
认证
凭证按优先级读取:环境变量 → 本地配置文件。
- 环境变量:
IMA_OPENAPI_CLIENTID/IMA_OPENAPI_APIKEY - 配置文件:
~/.config/ima/client_id/~/.config/ima/api_key
凭证获取:https://ima.qq.com/agent-interface
本地运行(stdio)
# 方式一:直接运行
uv run --with mcp --with httpx python ima_kb_mcp.py
# 方式二:作为包安装
uvx ima-kb-mcp
MCP 客户端配置示例:
{
"mcpServers": {
"ima-kb": {
"command": "uv",
"args": [
"run",
"--with",
"mcp",
"--with",
"httpx",
"/path/to/ima_kb_mcp.py"
],
"env": {
"IMA_OPENAPI_CLIENTID": "your_client_id",
"IMA_OPENAPI_APIKEY": "your_api_key"
}
}
}
}
部署到 ModelScope 魔搭 MCP 广场(托管)
- 将本仓库推送到 GitHub。
- 打开 魔搭 MCP 广场 → 创建 MCP → 选择 从 GitHub 仓库快速创建。
- 托管类型选择 可托管部署。
- 配置环境变量:
IMA_OPENAPI_CLIENTID:你的 Client IDIMA_OPENAPI_APIKEY:你的 API Key
- 部署完成后,复制生成的 SSE 地址。
- 在 Cherry Studio 中:设置 → MCP 服务器 → 添加,类型选择
SSE,填入地址即可。
技术栈
Metadata
Release files for ima-kb-mcp 1.0.0
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 |
|---|---|---|---|---|
| ima_kb_mcp-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / ima_kb_mcp-1.0.0-py3-none-any.whl
| Download URL | ima_kb_mcp-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ff7cdd0e34ab69ff2e9171929e07ae9937f962bc5845bf2a911f775097ba385b
|
|
BLAKE2b-256 checksum How to use checksums |
c5930834a7ad0e15fb32c025d5308db6f6b9ab95ecfddb0fed6847414301c3ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for ima-kb-mcp 1.0.0
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.