chinese-history-mcp
chinese-history-mcp is a read-only MCP server providing four traceable tools to query nine classical Chinese history texts (史记, 汉书, 后汉书, 三国志, 左传, 论语, 孟子, 吕氏春秋, 资治通鉴) with full citations and honest review_status. The tools are: search_events for cross-book fused event search with per-source provenance and roles; get_person for LLM-synthesized profiles with appraisals and relations; query_by_place for ancient stories linked to modern place names (with disambiguation); and query_by_quality for events/people exemplifying qualities from a 55-term vocabulary (e.g., 忠, 谋略), backed by evidence_quotes. All results include precise 【book·chapter·paragraph】 citations and machine-generated content with clear review status.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@chinese-history-mcp search events about the Battle of Red Cliffs"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
chinese-history-mcp
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:按事件 / 人物 / 今地名 / 品质四轴查询 先秦-汉魏九部正史子书,每条返回都带原文出处,机器生成/机审内容如实标注。
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
tool | input | returns |
|
| Cross-book fused historical events with per-source provenance (book · chapter · paragraph + role: primary/detailed/brief/comment/corroborating). |
|
| Person profile (LLM-synthesized, |
|
| Ancient stories set on the land of a modern place, with citations. Same-name-different-place returns candidates for you to disambiguate — it never silently picks one. Directional/regional generic names are excluded. |
|
| Representative events, people, and stories for a quality, each with an original-text |
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.
Related MCP server: YRB-HES Evidence MCP
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).
pip install chinese-history-mcp
# then (after downloading corpus.db from Releases — see below):
chinese-history-mcp --db /path/to/corpus.dbOr run without installing, straight from a checkout:
PYTHONPATH=src python3 -m storyextractor.mcp.server --db /path/to/corpus.dbConfigure in an MCP client
Claude Desktop (claude_desktop_config.json), Cline, Continue, etc. — add one
stdio server. After pip install chinese-history-mcp:
{
"mcpServers": {
"chinese-history": {
"command": "chinese-history-mcp",
"args": ["--db", "/path/to/corpus.db"]
}
}
}{
"mcpServers": {
"chinese-history": {
"command": "python3",
"args": ["-m", "storyextractor.mcp.server", "--db", "/path/to/corpus.db"],
"env": { "PYTHONPATH": "src" },
"cwd": "/absolute/path/to/chinese-history-mcp"
}
}
}Or zero-install with uv:
uvx chinese-history-mcp --db /path/to/corpus.db.
Try one handshake by hand
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{}}}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
'{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"query_by_quality","arguments":{"quality":"忠","limit":2}}}' \
| chinese-history-mcp --db /path/to/corpus.dbDemo + 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.
Available Tools
4 toolsget_personA
查人物画像 + 他者评价 + 参与事件 (逐条带出处)。画像 (profile) 为 LLM 综合生成、review_status=draft (未逐条人核); 他者评价 excerpt 是公版原文照抄可溯源; 附史料评为的品质。库内为先秦-汉魏人物。
Inputs: name (required).
query_by_placeA
用今天的地名反查发生在这块土地上的古籍故事 + 出处。今地名可为省/地级市/区县 (如 '西安'、'陕西西安'、'洛阳')。古今映射多为多 LLM 机审共识 (auto_approved); 同名异地/古名多解时返回候选列表让你消歧, 绝不替你单选; 方向性泛称 (江东/关中) 不收录。
Inputs: place (required), limit.
query_by_qualityA
按品质 (德性/才能/性情/为政…) 查代表性最强的事件/人物/故事 + 原文证据。品质取自 55 词受控词表 (如 忠/谋略/勇/仁/残暴/骄), 可用中文名或英文 slug。映射是【判断】非事实: auto_approved=机审高置信、draft=待人审; evidence_quote 是原文真子串; 默认只出机审通过。
Inputs: quality (required), limit, include_draft.
search_eventsA
查跨书融合历史事件 + 逐源出处。同一史事在史记/汉书/资治通鉴等多书的记载被合并为一条, 每个来源带【书·篇·段】与角色 (主叙/详述/简述/评论/旁证)。返回 review_status (approved=机审批量过审的可信推定, 非逐条人审); canonical_summary 为 LLM 融合的机器叙述。
Inputs: book, kind, limit, person, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct search dimension: events, persons, places, and qualities. The descriptions clearly separate their use cases, leaving no ambiguity about which tool to select for a given query.
Most tools follow a clear verb_noun pattern (search_events, get_person), while two use query_by_ (place, quality). This minor deviation is still readable and doesn't confuse the overall naming convention.
With 4 tools, the server is well-scoped for its purpose. Each tool earns its place, covering different aspects of Chinese history knowledge without redundancy or bloat.
The toolset covers core search dimensions (event, person, place, quality), but lacks time-based or dynasty-specific queries and direct source text retrieval. These are minor gaps that agents can work around using the provided tools.
Maintenance
Related MCP Connectors
MCP server for classical Chinese texts: sentence lookup, source attribution and full-text search
MCP server for classical Chinese poetry: search poems by title, author, dynasty or verse, with full
Auditable MCP server for PubMed, Europe PMC, ClinicalTrials.gov, and bioRxiv/medRxiv queries
Human Lineage MCP server — search and query the public genealogical graph of all humanity
Related MCP Servers
- FlicenseAqualityDmaintenanceA local MCP server for querying Chinese scientific literature from the CSL dataset, enabling paper search, detail retrieval, and dataset statistics via MCP clients.5-
- AlicenseAqualityDmaintenanceA read-only MCP server for evidence retrieval in Yellow River Basin human–earth systems reviews, exposing PostgreSQL-backed tools for searching and comparing evidence, entities, and spatiotemporal data while preserving source provenance.9MIT
- AlicenseNot gradedqualityDmaintenanceA stdio MCP server for traceable scholarly retrieval and evidence-grounded literature review, with deterministic provider fusion, conservative ID canonicalization, and provenance-preserving citation traversal.2MIT
- AlicenseNot gradedqualityBmaintenanceEnables agents to query a dated, provenance-backed history distilled from any text stream, turning raw records into observations, bi-temporal facets, and narratives over MCP.12MIT