Skip to main content

HT32 Wiki MCP Server

为 AI Agent 提供 HT32 MCU 选型与知识检索能力的 MCP Server。

功能

  • search_knowledge(query) — 全文搜索 wiki 知识库(芯片页、外设页、概念页、Datasheet), 片段按查询词锚定并附章节面包屑
  • get_wiki_page(path, section) — 按路径直读 wiki 页面全文或指定小节(search 命中后的下一跳)
  • get_chip_info(model) — 获取芯片系列详情
  • get_peripheral_info(name) — 获取外设详情
  • compare_chips(models) — 对比多个芯片型号
  • list_chips() / list_peripherals() — 列出芯片/外设清单
  • get_datasheet(series) — 获取 Datasheet 全文
  • get_wiki_version() — 获取知识库版本信息
  • submit_feedback(question, issue_type, ...) — 提交纠正反馈,帮助改进知识库

使用方法

环境变量

变量 默认值 说明
WIKI_ROOT 当前目录 wiki 仓库根目录(含 entities/concepts/md)
MCP_TRANSPORT stdio stdio / sse / streamable-http
MCP_HOST 0.0.0.0 HTTP 模式监听地址
MCP_PORT 8100 HTTP 模式监听端口
FEEDBACK_DIR /app/feedback 反馈写入目录(需可写,建议挂载持久卷)

stdio 模式(供 supergateway/1Panel 包装为 SSE)

uvx ht32-wiki-mcp

Streamable HTTP 模式

MCP_TRANSPORT=streamable-http uvx ht32-wiki-mcp

反馈机制(submit_feedback)

用户 Agent 在回答不准确、用户指出错误、或知识库信息缺失时,可调用 submit_feedback 提交纠正反馈。反馈以 JSON Lines 格式写入 FEEDBACK_DIR(默认 /app/feedback),按日期分文件(feedback_YYYY-MM-DD.jsonl)。

示例记录:

{"timestamp":"2026-08-10T10:00:00+00:00","question":"F52231 GPTM 最高频率?","issue_type":"wrong_spec","answer":"48MHz","correction":"72MHz,参考 UserManual 时钟章节","details":""}

System Prompt 提示词模板

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

你是一个 HT32 MCU 技术专家助手,基于 HT32 Wiki 知识库回答问题。

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

开发

uv sync --frozen
uv run python -m ht32_wiki_mcp

Metadata

Release files for ht32-wiki-mcp 0.7.3

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

Source distribution (sdist)

Source distribution for ht32-wiki-mcp 0.7.3
File Size Uploaded Provenance Actions
ht32_wiki_mcp-0.7.3.tar.gz 301.6 kB Without provenance Details for ht32_wiki_mcp-0.7.3.tar.gz

Built distribution (wheel)

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

Total release size: 413.1 kB

Release files / ht32_wiki_mcp-0.7.3.tar.gz

Download URL ht32_wiki_mcp-0.7.3.tar.gz
Size 301.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1675380af7235e2f563ef06b628268054820d7a16c77ddbe44a15af7065098f5
BLAKE2b-256 checksum
How to use checksums
65288e8a613134febcfaff2ef7daed781e68599b98a4e20438a5bf9cb0338eca
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 / ht32_wiki_mcp-0.7.3-py3-none-any.whl

Download URL ht32_wiki_mcp-0.7.3-py3-none-any.whl
Size 111.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d22b0f3b17325cf58e70a35bd8e8e0f4bbe9618cf16ae00b5c1b3c025c9b81d
BLAKE2b-256 checksum
How to use checksums
6fee97aaff09b27a0b443453793d37041dac9fe2bb778d9150d3c704884551ae
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 ht32-wiki-mcp 0.7.3

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.

Release history Release notifications | RSS feed

This release

0.7.3 This release

2 release files No provenance

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