Skip to main content

HTP Wiki MCP Server

为 AI Agent 提供**合泰周边器件 IC(Holtek Peripheral)**选型与知识检索能力的 MCP Server。

覆盖电源管理(LDO / DC-DC / 电荷泵 / 电压检测 / 离线 SMPS / 电池 AFE)、显示驱动(LCD / LED)、 RF 无线(Sub-1G / 2.4G BLE / NFC)、CIS 影像前端、模拟器件(OPAMP / ADC)、USB 桥接、RTC、 触控、DTMF、PIR、音频、电机驱动等独立器件的规格与选型知识。

术语边界:本库对象是独立周边器件 IC,不是 MCU 片上外设;没有引脚复用(pinmux)概念。

功能

共 18 个工具 + 3 个资源:

  • search_knowledge(query, limit, include_datasheets, category, series) — 知识页混合检索(词法 + 向量 + 重排),片段按查询词锚定并附章节面包屑,自带相关度三态
  • search_datasheets(query, limit) — Datasheet / 应用笔记章节级检索
  • get_wiki_page(path, section) — 按路径直读 wiki 页面全文或指定小节(search 命中后的下一跳)
  • get_family_info(name) — 器件家族详情:家族摘要 + 应用选型矩阵 + 覆盖型号清单
  • get_part_info(model) — 型号详情:所属家族 + 矩阵行 + datasheet 链接
  • get_model(model) — 型号 → 家族 / 矩阵行 / datasheet 文件名 / 原档下载链接映射
  • compare_models(models) — 对比多个型号/系列的关键参数
  • list_families() / list_parts() / list_datasheets() — 列出家族 / 型号页 / 原档清单
  • get_datasheet(series, max_length) — 获取 Datasheet / 应用笔记内容(Markdown)
  • list_datasheet_sections(series, max_sections) — 列出原档章节树(不返回正文)
  • get_datasheet_section(series, section, max_length) — 按章节号/标题取单章正文
  • get_raw_document(model, kind) — 按型号取 Datasheet / 应用笔记 / 宣传册原档 PDF 下载链接
  • get_raw_file(path) — 按路径取 raw/ 文档型原档下载链接(拒绝路径穿越与代码目录)
  • get_wiki_version() — 获取知识库与 MCP 版本信息、检索方式状态
  • report_skill_version(version) — 会话开始上报本机编排 Skill 版本,用于用量日志打标
  • submit_feedback(question, issue_type, ...) — 提交纠正反馈,帮助改进知识库

资源:wiki://overview(按应用领域分组的家族总览)、wiki://families/{name}、wiki://parts/{model}。

使用方法

环境变量

变量 默认值 说明
WIKI_ROOT 自动探测仓库根 wiki 仓库根目录(含 entities/concepts/md)
MCP_TRANSPORT stdio stdio / streamable-http / sse
MCP_HOST 0.0.0.0 HTTP 模式监听地址
MCP_PORT 8100 HTTP 模式监听端口
MCP_PATH /mcp streamable-http 端点路径(线上 /htp-wiki)
CACHE_DIR <WIKI_ROOT>/.work 原档索引与向量缓存目录(只读挂载时必设可写路径)
FEEDBACK_ROOT 空(关闭落盘) 用量 / 反馈根目录;本服务写 <FEEDBACK_ROOT>/htp-wiki/
MCP_WARMUP 1 启动时后台预建原档索引与向量

检索层开关(HTP_DS_* / DS_RAG_* / WIKI_*)与云端 key 见 DEPLOY.md 环境变量表。

stdio 模式(本地调试)

uvx htp-wiki-mcp

Streamable HTTP 模式

MCP_TRANSPORT=streamable-http uvx htp-wiki-mcp

反馈机制(submit_feedback)

用户 Agent 在回答不准确、用户指出错误、或知识库信息缺失时,可调用 submit_feedback 提交纠正反馈。反馈以 JSON Lines 格式写入 <FEEDBACK_ROOT>/htp-wiki/,按日期分文件(feedback_YYYY-MM-DD.jsonl);每次工具调用另由服务端写入 usage_YYYY-MM-DD.jsonl。

示例记录:

{"timestamp":"2026-11-27T10:00:00+00:00","question":"HT7133-1 的压差是多少?","issue_type":"wrong_spec","answer":"典型 30mV","correction":"请核对 datasheet 电气特性表,按负载电流条件区分","details":""}

System Prompt 提示词模板

部署 Open WebUI 或其他 MCP 客户端时,建议在系统提示词中加入以下内容,提升反馈触发率:

你是一个合泰周边器件 IC 技术专家助手,基于 HTP Wiki 知识库回答问题。

工具使用规范:
1. 回答涉及器件选型、家族规格、型号参数对比时,优先调用 search_knowledge / get_family_info / get_part_info / compare_models 检索知识库,不要凭记忆回答。
2. 当出现以下情况时,必须调用 submit_feedback 工具提交反馈:
   - 用户明确指出你的回答有误(如"不对"、"错了"、"应该是...")
   - 你从知识库查到的数据与用户描述矛盾
   - 知识库查不到相关信息,你只能给出推测性回答
   - 用户提供了比你回答更准确的型号/规格/参数信息
3. submit_feedback 的 question 参数尽量完整抄录用户原始问题;correction 填写你认为正确的信息或用户指出的正确内容。
4. 不确定的信息要如实说明"知识库未覆盖",不要编造参数。

与 ht32-wiki-mcp 的差异

本服务由 ht32-wiki-mcp fork 并改造而来,主要差异:

维度 ht32-wiki-mcp htp-wiki-mcp
知识对象 HT32 32 位 MCU 合泰周边器件 IC(非 MCU)
页面体系 chips / peripherals / 资源矩阵 families(家族页 + 应用选型矩阵)/ parts / concepts / comparisons
选型工具 get_chip_info / get_peripheral_info get_family_info / get_part_info
对比工具 compare_chips compare_models
引脚复用 有 pinmux 行级检索 无(周边器件无引脚复用概念)
原档类型 Datasheet / User Manual Datasheet / 应用笔记 / 宣传册(无 user-manuals)
型号反查 find_models_with_function 无(无引脚功能反查)
反馈子目录 FEEDBACK_ROOT/ht32-wiki/ FEEDBACK_ROOT/htp-wiki/
部署端口 宿主 18080 → 容器 8000 宿主 18086 → 容器 8000

开发

uv sync --frozen
uv run python -m htp_wiki_mcp

Metadata

Release files for htp-wiki-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for htp-wiki-mcp 0.1.1
File Size Uploaded Provenance Actions
htp_wiki_mcp-0.1.1.tar.gz 251.9 kB Without provenance Details for htp_wiki_mcp-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for htp-wiki-mcp 0.1.1
File Interpreter ABI Platform Actions
htp_wiki_mcp-0.1.1-py3-none-any.whl Python 3 none any Details for htp_wiki_mcp-0.1.1-py3-none-any.whl

Total release size: 372.8 kB

Release files / htp_wiki_mcp-0.1.1.tar.gz

Download URL htp_wiki_mcp-0.1.1.tar.gz
Size 251.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1ae173cd2add98249c20ae3d37569aa7f679ce01432323c26cf16ebeef76093f
BLAKE2b-256 checksum
How to use checksums
69cc3d7f177446b2b2dac872ef450224b207abaf04ae7790e34b531738fb7544
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / htp_wiki_mcp-0.1.1-py3-none-any.whl

Download URL htp_wiki_mcp-0.1.1-py3-none-any.whl
Size 120.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a68d8b0ec12025733135e48149b12c8f025f3107813339681afd8b6ae821770
BLAKE2b-256 checksum
How to use checksums
92c7de057397d47c9f65861d0ac4dd5e124612d894218ce65f48c9aa78c3dbaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for htp-wiki-mcp 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.

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