
Chinese History Mcp
io.github.lizhuojunx86由 GitHub 帳號 lizhuojunx86 發布v0.3.0更新於 Oct 24, 2026
Traceable Chinese-history MCP: 4 cited tools over 9 classical texts (pre-Qin to Wei-Jin).
概覽
一個在本機執行、唯讀的 MCP 伺服器,讓助理檢索九部中國古典史籍並取得附出處的結果。
- 可以做什麼
- 依關鍵字、典籍、人物或類型跨書檢索歷史事件,每筆結果標註書名、篇章、段落與來源角色。依姓名或別名查詢人物,回傳人物簡介、原文評價、品質標籤、相關事件與人物關係。依現代地名查找古代故事,同名異地時回傳候選供消歧。依受控詞表中的品質檢索代表性事件、人物與故事,並附原文證據引文。所有結果以 JSON 回傳並帶引用。
- 適用情境
- 適合需要助理回答先秦至魏晉中國歷史問題並給出可溯源引用,而非無出處敘述的情境;也適合用固定的九部典籍語料核對某項說法。
- 執行需求
- 以 stdio 在本機執行。需要 Python 3.9 或更新版本(僅用標準函式庫),或以 uvx 免安裝執行。語料資料庫檔案未隨套件提供,需從專案 Releases 另行下載,並透過 --db 參數或 STORYEXTRACTOR_DB 環境變數指定。未宣告需要驗證、API 金鑰或網路存取。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Chinese History Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
chinese-history-mcp
[CI] [PyPI] [License: MIT] [Data: CC BY 4.0] [Python 3.9+] [Dependencies: zero] [MCP] [Release]
A traceable Chinese-history MCP server. Four Model Context
Protocol tools over 9 classical Chinese
texts (pre-Qin to Wei-Jin — 史记 / 汉书 / 后汉书 / 三国志 / 左传 / 论语 / 孟子 /
吕氏春秋 / 资治通鉴). Every result carries a 【book → chapter → paragraph】
citation, and honestly reports its review_status — the server never claims
per-item human review it doesn't have.
一个可溯源的中国历史故事 MCP server:按事件 / 人物 / 今地名 / 品质四轴查询 先秦-汉魏九部正史子书,每条返回都带原文出处,机器生成/机审内容如实标注。
[Demo — every result is cited]
- Zero runtime dependencies — pure Python standard library. No
pip installof a framework, no MCP SDK; the whole server is auditable in a few files. - Read-only — opens the corpus with
mode=ro+PRAGMA query_only; never writes. - Honest by construction — machine-generated punctuation / translation and machine-adjudicated status are labeled in every response (AIGC-compliant).
Why this exists: as of mid-2026 the public MCP ecosystem has no classical Chinese / Chinese-history server. This fills that gap. Income expectation is zero; the goal is a useful public good.
Contents: The four tools · Install & run · The corpus database · Honesty · Data & provenance · Design notes
The four tools
Each tool call returns JSON. Multi-source events, person appraisals, and place/quality edges all carry the exact 【book → chapter → paragraph】 they came from — that is the point of the server.
Install & run
Requires Python 3.9+ (standard library only — nothing else is installed). The server speaks MCP over stdio (newline-delimited JSON-RPC 2.0).
Or run without installing, straight from a checkout:
Configure in an MCP client
Claude Desktop (claude_desktop_config.json), Cline, Continue, etc. — add one
stdio server. After pip install chinese-history-mcp:
Alternative: run from a checkout (no install), or with uvx
Or zero-install with uv:
uvx chinese-history-mcp --db /path/to/corpus.db.
Try one handshake by hand
Demo + hallucination comparison
python3 scripts/mcp_demo.py --db /path/to/corpus.db runs a scripted tour of
all four tools (also a minimal MCP-client reference). See
docs/MCP_DEMO.md for a side-by-side of a bare LLM
(fabricated / uncitable) vs. this server (cited) on the same questions.
The corpus database
corpus.db is not in this repository (it is a ~90 MB binary). Download it
from this repo's Releases and point --db at it, or set
STORYEXTRACTOR_DB=/path/to/corpus.db.
The database is read-only at runtime. If you host it on a read-only medium,
make sure the release artifact was produced with
sqlite3 corpus.db "VACUUM INTO 'corpus_release.db'" (single file, no
-wal/-shm sidecars).
Honesty (please read)
This server is designed for provenance, not to launder machine output as scholarship. Downstream clients and LLMs must not present its results as "individually human-reviewed." Every response labels what it is:
- Events
review_status='approved'— mostly machine bulk-approved credible inferences, not per-item human review. - Person profiles
review_status='draft'— LLM-synthesized, not human-vetted. - Quality mappings —
auto_approved= multi-LLM machine consensus,draft= pending review;evidence_quoteis a real substring of the source,rationaleis an LLM's reasoning. - Place mappings — mostly multi-LLM machine consensus (
auto_approved), a few human-approved; confidence is bucketed high/medium/doubtful. - Text — original is public-domain 白文 with machine-generated punctuation/segmentation; vernacular translation is fully machine-generated.
The server also does not eliminate downstream hallucination: it gives you citable retrieval facts; an LLM built on top can still confabulate around them. The citations are anchors for human verification.
Scope is the 9 texts above — "not found" means "not in this corpus," not "did not happen."
Data & provenance
- Original text: public-domain classical Chinese 白文 (unpunctuated base text from public-domain editions), with self-produced, machine-generated punctuation and segmentation (not copied from any modern annotated/collated edition).
- Vernacular translation: machine-generated across the whole corpus.
- Annotations (events / entities / places / qualities): machine-assisted, with human review gating on selected layers; status is reported per record.
License
- Code (this repository): MIT — see LICENSE.
- Corpus data (
corpus.db, distributed via Releases): CC BY 4.0.
The text layer is self-produced (punctuation/segmentation) over public-domain base text, so it is distributed freely; machine-generated attributes are labeled throughout for AIGC compliance.
Design notes
- Pure stdlib hand-written stdio JSON-RPC 2.0 (
initialize/tools/list/tools/call+ping/ notifications). No third-party MCP SDK. - Read-only DB access (
src/storyextractor/mcp/db.py):mode=ro+PRAGMA query_only; the migration-runningdb.connectis never used at serve time. - Tests:
python3 tests/test_mcp_server.py(read-only enforcement, protocol shapes/error codes, honestreview_status, alias token-exact matching + disambiguation, LIKE-wildcard escaping) — builds a temporary fixture DB, so it runs withoutcorpus.db.
Contributing & project meta
- CONTRIBUTING.md — how to run tests/lint and the principles this project holds to.
- CHANGELOG.md — release history.
- SECURITY.md — threat surface (read-only, no network) and how to report issues.
Issues and pull requests are welcome. Please keep the constraints in mind:
zero runtime dependencies, read-only, every result cited, honest review_status.
來源:README.md,提交 62833c5
工具
0版本歷史
1- v0.3.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分