Skip to main content

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 广场(托管)

  1. 将本仓库推送到 GitHub。
  2. 打开 魔搭 MCP 广场创建 MCP → 选择 从 GitHub 仓库快速创建
  3. 托管类型选择 可托管部署
  4. 配置环境变量:
    • IMA_OPENAPI_CLIENTID:你的 Client ID
    • IMA_OPENAPI_APIKEY:你的 API Key
  5. 部署完成后,复制生成的 SSE 地址
  6. 在 Cherry Studio 中:设置 → MCP 服务器 → 添加,类型选择 SSE,填入地址即可。

技术栈

  • Python ≥ 3.10
  • FastMCP - MCP server 框架
  • httpx - HTTP 客户端

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

If you're not sure about the file name format, learn more about wheel file names.

ima_kb_mcp-1.0.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file ima_kb_mcp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ima_kb_mcp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for ima_kb_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff7cdd0e34ab69ff2e9171929e07ae9937f962bc5845bf2a911f775097ba385b
MD5 eb6c23f9034fbd582289dcbe0e90560e
BLAKE2b-256 c5930834a7ad0e15fb32c025d5308db6f6b9ab95ecfddb0fed6847414301c3ba

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page