
Chinese History Mcp
io.github.lizhuojunx86Published by GitHub account lizhuojunx86v0.3.0Updated Oct 24, 2026
Traceable Chinese-history MCP: 4 cited tools over 9 classical texts (pre-Qin to Wei-Jin).
Overview
A local, read-only MCP server that lets an assistant search nine classical Chinese historical texts and get cited results.
- What you can do
- Search historical events across books by keyword, book, person or kind, with per-source provenance and roles for each source cited to book, chapter and paragraph. Look up a person by name or alias for a profile, verbatim appraisals, attributed qualities, related events and person-to-person relations. Find ancient stories tied to a modern place name, returning candidates when a name is ambiguous. Retrieve representative events, people and stories for a quality from a controlled vocabulary, each with an original-text evidence quote. All results are returned as JSON with citations.
- When to use it
- Useful when you want an assistant to answer questions about pre-Qin to Wei-Jin Chinese history with traceable citations instead of unsourced prose, or to check a claim against a fixed corpus of nine classical texts.
- Requirements
- Runs locally over stdio. Needs Python 3.9 or later (standard library only), or uvx for a zero-install run. The corpus database file is not bundled and must be downloaded separately from the project's Releases and passed with the --db argument or the STORYEXTRACTOR_DB environment variable. No authentication, API keys or network access are declared.
Installation
In SourceWeft
- Open Chinese History Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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.
Source: README.md at commit 62833c5
Tools
0Version history
1- v0.3.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts