FoJin 佛津
MCP serverSearchfojin connects your AI to the Buddhist canon. Once added, your AI can search the texts, pull up passages, find parallels across different canons, and look up terms in dictionaries. Every answer comes with a citable reference back to the source text.
Use FoJin 佛津 in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add FoJin 佛津 and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use FoJin 佛津 to search corpus
No key or account is asked for. Not verified by us yet: Ahel has not run a call through it.
Details
Available today. Use it from your connected AI after setup.
No key or account is asked for. Not verified by us yet: Ahel has not run a call through it.
Add fojin, then ask your AI to search the canon for a topic or quote a passage. You can also ask it to find parallels to a text you are studying.
What your AI can do with it
- Search the Buddhist canon
- Retrieve specific passages
- Find parallels for a text across different canons
- Look up terms in Buddhist dictionaries
- Cite every result with a reference to the source text
Install FoJin 佛津
The server’s own address, for the clients that take one directly. Or connect Ahel once and every client you use reads it from one address, with the account kept on Ahel rather than in each client’s config.
Claude Code
claude mcp add --transport http --scope user fojin 'https://mcp.fojin.ai/mcp'Run it once in your project, then open /mcp to approve any sign-in the server asks for.
Claude Desktop
https://mcp.fojin.ai/mcpAdd a custom connector in Settings, paste this address, and approve the sign-in.
Cursor
cursor://anysphere.cursor-deeplink/mcp/install?name=fojin&config=eyJ1cmwiOiJodHRwczovL21jcC5mb2ppbi5haS9tY3AifQ==Open the link and Cursor adds the server at that address.
ChatGPT
https://mcp.fojin.ai/mcpIn Settings, enable Developer mode, create an MCP app, and paste this address. Your plan and workspace must allow custom apps.
Codex
codex mcp add fojin --url 'https://mcp.fojin.ai/mcp'Run it once, then sign in with codex mcp login fojin if the server asks for an account.
From the project's README
As published by xr843/fojin in README.md.
Ask the Buddhist canon — get cited, verifiable answers.
AI Q&A grounded in the world's largest open aggregation of Buddhist texts: 600+ sources, 30+ languages, trilingual cross-canon retrieval — every answer linked back to its source passage.
Ask a question in plain language and FoJin's assistant "XiaoJin" answers from the canon itself — Retrieval-Augmented Generation over 670K+ embedded passages, optional cross-encoder reranking and root-sutra recall, clickable 【《sutra》juan N】 citations that open the exact source text, anti-hallucination guards, and a citation drawer with side-by-side 汉 / 巴利 / 藏文 cross-canon parallels. You can also ask in the voice of 15 historical Buddhist masters, each scoped to their own tradition's scriptures.
What makes those answers trustworthy is the corpus underneath. FoJin aggregates 612 data sources into one searchable platform — 10,500+ texts with 19,000+ volumes of full content in Classical Chinese, Pali, Tibetan and Sanskrit, the first LLM-driven trilingual cross-canon parallel reading platform (CBETA × SuttaCentral × 84000) with LLM-verified chunk-level alignment, a 110K+ entity knowledge graph on a Deck.GL geo map, and 39 dictionaries with 747K entries. Every feature exists to make the answers more grounded — and to let you go deeper once you have one.
FoJin is built to be open, cross-canon, verifiable Buddhist knowledge infrastructure — not just a site to read, but a corpus other tools can call. Every passage carries a stable, resolvable cross-canon URN (fojin:cbeta/T0001.1), and the fojin-mcp server lets AI assistants (Claude, ChatGPT, any MCP client) answer from FoJin's cited passages directly — hosted at mcp.fojin.ai, anonymous, no key required. Any model can also check its own work through the open /api/verify/quote endpoint: hand it a sentence and a citation, and it answers is this quote real and is the citation right as two separate questions. See fojin.app/agents.
Live Demo · API Docs · 中文文档 · Discussions · Discord · Report Bug
Why FoJin?
Buddhist texts are scattered across hundreds of databases worldwide — CBETA, SuttaCentral, BDRC, SAT, 84000, GRETIL, and many more. Each has its own interface, language, and data format. When you have a question — "what does the Heart Sutra mean by 'form is emptiness'?", "how do the Pali and Chinese versions of this passage differ?" — you spend more time hunting for the right passage than understanding it.
FoJin answers the question for you. Ask in plain language; XiaoJin retrieves the relevant passages from 612 sources and answers with clickable citations you can verify. Everything else FoJin does — full-text reading, cross-canon alignment, the knowledge graph, 39 dictionaries — exists to make those answers more grounded, and to let you go deeper once you have one:
| What you need | How FoJin helps |
|---|---|
| Ask a question, get a sourced answer | AI Q&A ("XiaoJin") — RAG over 670K+ passages, reranking, root-sutra recall, clickable 【《sutra》juan N】 citations, cross-canon citation drawer, anti-hallucination guards |
| Trust the answer | Verifiable answers — deterministic citation whitelist + verbatim-quote downgrade + per-answer trust state; ~98% of citing answers served-trustworthy at temp 0 |
| Research a hard, multi-step question | Research Assistant (/research) — plans across corpus + dictionaries + knowledge graph, then synthesises a cited answer behind the same guards |
| Call FoJin from an AI assistant | MCP server — hosted at mcp.fojin.ai (no install, no key) or uvx fojin-mcp; 8 read-only, URN-addressable tools for Claude / ChatGPT |
| Check whether a quotation is real | Open verbatim verification (/api/verify/quote) — for any sentence, not just ours: exact / near-miss / absent, with a character-level diff and the right juan when the citation points at the wrong one |
| See how the tradition read a passage | Commentary alignment (/api/commentary/passage) — for one passage, what the historical commentators wrote on it, anchored to juan and line |
| Listen while you read | Read-aloud (/read-aloud) — sentence-by-sentence highlighting synced to audio, lock-screen playback |
| Ask in a master's voice | Master Persona Mode — 15 historical masters, each with tradition-scoped RAG |
| Find a sutra across databases | Multi-dimensional search across 10,500+ texts from 612 sources |
| Read the full text online | 8,900+ texts with 19,000+ volumes of full content, CBETA-style layout |
| Compare translations | Parallel reading in 30+ languages side by side |
| Compare sutras across Buddhist canons | Trilingual cross-canon parallel reading — 4,000+ LLM-verified chunk alignments across Chinese / Pali / Tibetan covering Heart Sutra, Vimalakīrti, Lotus Sutra (法华 ↔ Toh 113, 259 pairs), 8,000-verse Prajñāpāramitā (小品般若 ↔ Toh 11, 127 pairs), Satipaṭṭhāna + the full Āgama ↔ Nikāya corpus (MN/DN/SN/AN), Dhammapada |
| Look up Buddhist terms | 39 dictionaries, 747K entries (Chinese/Sanskrit/Pali/Tibetan/English) |
| Explore relationships | Knowledge graph with 110K+ entities and 27,900+ relations (22K+ lineage chains) |
| Discover similar texts | Semantic similarity powered by 670K+ embedding vectors (pgvector + HNSW) |
| Explore Buddhist geography | Knowledge Graph Map — geo-enabled entities, monastery locations, lineage arcs on Deck.GL |
| Track source updates | Activity Feed — real-time updates from 612 data sources |
| Explore history visually | Timeline & Dashboard — dynasty charts, translation trends, category analytics |
| Save and organize | Collections, bookmarks, annotations for personal study |
| Cite in research | Citation export (BibTeX, RIS, APA) for academic use |
Quick Start
git clone https://github.com/xr843/fojin.git
cd fojin
cp .env.example .env # edit POSTGRES_PASSWORD before starting
docker compose up -d # database migrations run automatically
Then visit: http://localhost:3000
API docs at http://localhost:8000/docs
After first startup, the platform has the database schema and source metadata but no text content. To import texts from public data sources:
# Import CBETA catalog (auto-scans local xml-p5 directory or fetches from remote)
docker exec fojin-backend python scripts/import_catalog.py
# Import CBETA full text content (requires xml-p5 repository)
docker exec fojin-backend python scripts/import_content.py --all --xml-dir /data/xml-p5
# Generate embeddings for AI Q&A (supports incremental processing)
docker exec fojin-backend python -m scripts.archive.misc.generate_embeddings --source cbeta
# Import SuttaCentral Early Buddhist Texts
docker exec fojin-backend python scripts/archive/imports/import_suttacentral.py
# See all available importers (one-off importers live under archive/)
ls backend/scripts/archive/imports/
Each importer downloads data directly from the original source (CBETA, SuttaCentral, etc.) — no data is bundled in this repository.
Use FoJin from your AI tools (MCP)
FoJin's verified, cross-canon corpus is callable directly from AI assistants (Claude Desktop, ChatGPT, or any MCP client) via the published fojin-mcp server — so the assistant answers Buddhist questions from FoJin's cited passages instead of hallucinating.
Point any MCP client at the hosted endpoint — nothing to install, no key to get:
claude mcp add --transport http fojin https://mcp.fojin.ai/mcp
Or run it locally over stdio against your own instance:
uvx fojin-mcp # zero-install run
# or: pip install fojin-mcp && fojin-mcp
It exposes eight read-only tools over the public API, each returning passages with a stable, resolvable cross-canon URN (fojin:cbeta/T0001.1):
| Tool | What it does |
|---|---|
search_corpus | Semantic search across the aggregated canon |
read_passage | Read a specific text / volume |
get_parallels | Cross-canon parallels (汉 ↔ 巴利 ↔ 藏) for a passage |
lookup_dictionary | Term lookup across 39 dictionaries |
lookup_entity | Knowledge-graph entity facts |
resolve_urn | Resolve a FoJin URN to its source location |
verify_quote | Verbatim check — is this sentence really in the canon, and really where you said? Answers "is the quote real" and "is the citation right" separately, with a character-level diff when it is close but not exact |
commentaries | For one passage, what the historical commentators wrote on it — anchored to juan and line |
Claude Desktop config and ChatGPT setup are in mcp-server/README.md. The server is a thin, read-only client: it holds no credentials, bundles no corpus, and only calls FoJin's public endpoints — its default target is https://fojin.app/api, overridable via FOJIN_API_BASE_URL to point at a self-hosted instance.
Features
Multi-Dimensional Search
Search across Buddhist canons by title, translator, catalog number, or full-text keyword. Powered by Elasticsearch with ICU tokenizer for multi-language support.
Full-Text Reading
Read 8,900+ Buddhist texts with 19,000+ volumes of full content online. CBETA-style typography with intelligent verse/prose detection, paragraph reflow, and adjustable font size. Navigate by volume, scroll through content, and jump between related texts.
Parallel Reading (30 Languages)
Compare translations side by side — Classical Chinese, Sanskrit, Pali, Tibetan, English, Japanese, Korean, Gandhari, and 21 more languages.
Dictionary Lookup
32 authoritative dictionaries with 748,000+ entries across Chinese, Pali, Sanskrit, Tibetan, and English:
Chinese Buddhist Dictionaries (14)
- NTI Reader (佛学辞典) — 161K entries, Chinese↔English
- Suihan Lu (新集藏經音義隨函錄) — 72K entries, Tang dynasty phonetic glossary
- Fo Guang (佛光大辭典) — 32K entries
- Ding Fubao (丁福保佛学大辞典) — 31K entries
- Yiqiejing Yinyi (一切經音義, 慧琳音義) — 23K entries, Buddhist scriptural phonetics
- Faxiang Dictionary (法相辭典, 朱芾煌) — 15K entries, Yogācāra terminology
- Zhonghua Encyclopedia (中華佛教百科全書) — 6K entries
- Common Buddhist Terms (佛學常見詞彙, 陳義孝) — 6K entries
- Agama Dictionary (阿含辭典, 莊春江) — 5K entries
- Fanfanyu (翻梵語) — 4K entries, Sanskrit-Chinese translation glossary
- Xu Yinyi (續一切經音義, 希麟) — 2K entries
- Yogācāra Glossary (唯識名詞白話新解) — 2K entries
- Sanzang Fashu (三藏法數) — 1K entries
- Buddhist Origins of Idioms (俗語佛源) — 567 entries
Pali Dictionaries (5)
- Digital Pali Dictionary (DPD) — 89K entries, grammar + etymology + examples
- NCPED (New Concise Pali-English Dictionary) — 21K entries
- PTS PED (Pali Text Society) — 16K entries
- Buddhadatta (巴利語辭典, 達摩比丘中譯) — 11K entries, Pali→Chinese
- SuttaCentral Glossary — 6K entries
Sanskrit Dictionaries (4)
- Apte (Practical Sanskrit-English Dictionary) — 35K entries
- Monier-Williams (Sanskrit-English Dictionary) — 32K entries
- Edgerton BHS (Buddhist Hybrid Sanskrit Dictionary) — 18K entries
- Fanyi Mingyi Ji (翻譯名義集) — 1K entries
Tibetan Dictionaries (2)
- Rangjung Yeshe (Tibetan-English Dictionary) — 74K entries
- Hopkins (Tibetan-Sanskrit-English Dictionary) — 18K entries
Multilingual Reference (4)
- Soothill-Hodous (Chinese Buddhist Terms, Chinese↔English) — 17K entries
- Mahāvyutpatti (翻譯名義大集, Sanskrit↔Tibetan↔Chinese) — 9K entries
- Nanshan Vinaya (南山律学辞典) — 3K entries
- Pentaglot (五體清文鑑, Manchu-Mongolian-Tibetan-Chinese-Sanskrit) — 1K entries
Specialized (3)
- Abhidharma Dictionary (阿毗達磨辭典) — 1K entries
- Tiantai Dictionary (天台教學辭典) — 1K entries
- DDB (Digital Dictionary of Buddhism) — CJK Buddhist terminology
Knowledge Graph
110,000+ entities (monasteries, persons, texts, schools, concepts) and 28,000+ relationships — including 22,000+ teacher-student lineage chains from the DILA Authority Database — visualized as an interactive force-directed graph. Click any node to explore connections.
Trilingual Cross-Canon Parallel Reading (三语对读)
The first LLM-driven cross-canon parallel reading system for Buddhist texts. No other platform provides this: CBETA (汉文), SuttaCentral (Pali), and 84000 (Tibetan) each operate in their own language silo. FoJin bridges them via LLM-verified chunk-level alignment.
Current coverage (4,000+ chunk-level alignments across 11 pair definitions):
| Sutra / Corpus | Source | Target | Pairs | Type |
|---|---|---|---|---|
| 《妙法蓮華經》Lotus Sutra (2026-06-08) | T0262 罗什 (Chinese) | Toh 113 Kangyur (Tibetan) | 259 | 汉 ↔ 藏 |
| 《小品般若波羅蜜經》8,000-verse Prajñāpāramitā (2026-06-09) | T0227 罗什 (Chinese) | Toh 11 Aṣṭasāhasrikā (Tibetan) | 127 | 汉 ↔ 藏 |
| 《維摩詰所說經》Vimalakīrti | T0475 罗什 (Chinese) | Toh 176 (Tibetan) | 20 | 汉 ↔ 藏 |
| 《般若波羅蜜多心經》Heart Sutra | T0252 (Chinese) | Toh 21 Kangyur (Tibetan) | 6 | 汉 ↔ 藏 |
| Mahāsatipaṭṭhāna Sutta 念处经 | MN 10 (Pali) | T0026 中阿含 (Chinese) | 50 | 巴 ↔ 汉 |
| Dhammacakkappavattana 转法轮经 | SN 56.11 (Pali) | T0099 杂阿含 (Chinese) | 17 | 巴 ↔ 汉 |
| Dhammapada 法句经 | T0210 (Chinese) | SC 26 vaggas (Pali) | 49 | 汉 ↔ 巴 |
| Majjhima Nikāya ↔ 中阿含 | All MN suttas (Pali) | T0026 (Chinese) | ~1,800 | 巴 ↔ 汉 |
| Dīgha Nikāya ↔ 长阿含 | All DN suttas (Pali) | T0001 (Chinese) | ~700 | 巴 ↔ 汉 |
| Saṃyutta Nikāya 56 ↔ 杂阿含 | SN 56 suttas (Pali) | T0099 (Chinese) | ~150 | 巴 ↔ 汉 |
| Aṅguttara Nikāya 4 ↔ 增一阿含 | AN 4 suttas (Pali) | T0125 (Chinese) | ~400 | 巴 ↔ 汉 |
Confidence distribution: all pairs ≥ 0.75. Hand-verified precision on the original MVP sample: 100%. Mahāyāna 汉藏 batches: Lotus Sutra (2026-06-08) at $1.70 / 259 pairs (8.6% accept rate); 8,000-verse Prajñāpāramitā (2026-06-09) at $3.64 / 127 pairs (3.4% accept rate, lower because the sūtra's repetitive paratactic style yields fewer 1:1 chunk-level correspondences).
How to use:
-
In AI Q&A — When XiaoJin cites an aligned sutra, the citation drawer shows tabs
[ 汉文 ] [ 巴利 (5) ] [ 藏文 (3) ]. Click a tab to see the corresponding passage in another canon, rendered with proper Devanagari / Tibetan fonts. -
In the reader — Click the 🌐 「多语对读」 (Multilingual Parallel) button in the toolbar. Default tab 「按经对读」 shows sutta-level parallels from SuttaCentral's authoritative Akanuma-style table (3,293 pairs covering all 4 Āgamas ↔ Nikāyas), with Pāli original + Sujato English previews and "read full text" links. Alternate tab 「按段对读」 retains the experimental embedding+LLM chunk-level alignment (pipeline-generated, known to have noise). The panel sits to the left of the AI reading panel; both can be open simultaneously and independently resized.
Pipeline (backend/scripts/build_alignments.py):
- pgvector top-20 candidate recall within target text's embeddings
- LLM verification (DeepSeek V3) returns
{is_parallel, confidence, reason}JSON per candidate - Pairs with
confidence ≥ 0.75persisted toalignment_pairswith unique(text_a, text_b)chunk tuple for idempotent re-runs $50cost ceiling guard (actual MVP spend: ~$0.15)- Multi-target resolver supports cases where target is split across rows (e.g., SC Dhammapada's 26 separate vagga texts)
RAG layer automatically includes parallel_chunks in the LLM context when a retrieved chunk has alignments, so answers can naturally reference "the Pali version says…" without hallucinating.
Growing the alignment set — the flywheel: beyond the batch pipeline above, an alignment flywheel (backend/app/services/alignment_flywheel.py) mines new candidate parallels by expanding outward from already-verified pairs — neighbouring chunks tend to align too, so this is both fast and precise where blind nearest-neighbour search drowns in same-language matches. Candidates are staged for human review (admin UI at /admin/alignment/review) and only promoted into the ground-truth alignment_pairs once accepted (method='flywheel-verified'). Nothing is auto-promoted — human review is the precision gate — and each verified alignment makes the next round of mining better. A margin-based candidate router in build_alignments.py routes recalled candidates into auto-accept / LLM-verify / auto-reject bands by ratio-margin, cutting LLM cost while keeping auto-accept off by default so the precision guarantee holds.
From chunks to sentences — the depth play: verified chunk pairs seed sentence-level alignment (backend/scripts/refine_sentence_alignments.py + services/sentence_align.py): a pure-Python bertalign-style dynamic program subdivides each aligned paragraph into 1-1 / 1-2 / 2-1 sentence pairs over BGE-M3 cosine similarity, anchored to stable character offsets and stored in sentence_alignments. This backs precise 逐句对读 and cross-lingual sentence lookup. Two consumption surfaces already ship: cross-lingual sentence search (GET /api/search/parallel-sentences — query in Chinese, get aligned Sanskrit/Tibetan sentences over the ~896K-pair MITRA store) and a versioned, license-stamped public dataset export (GET /exports/alignments.jsonl) that turns the alignment corpus into a citable research artifact. Alignment quality is guarded by a dedicated eval harness (gold set + precision/recall/calibration metrics + regression gate) alongside the RAG eval, and MITRA cross-canon parallels feed the RAG context gated by a proxy quality score (mitra_e_score).
AI Q&A — "XiaoJin"
This is FoJin's core. Ask questions in natural language; XiaoJin answers from canonical Buddhist texts using RAG (Retrieval-Augmented Generation) over 670K+ embedding vectors with an HNSW index for fast semantic search. Answers stay grounded because retrieval combines vector similarity, keyword reranking, and root-sutra recall (the sutra you asked about is always pulled into context), and every quoted passage is checked against the retrieved sources before it can become a clickable citation. Features include:
- Multi-turn conversation with context awareness
- Keyword + optional API cross-encoder reranking for higher answer quality
- Clickable citations in 【《经名》第N卷】 format — click to open a side drawer with surrounding context, plus multi-language tabs for cross-canon parallels when available (see Trilingual section above)
- GFM markdown tables — comparative answers (e.g., "Madhyamaka vs Yogācāra") render as proper tables instead of raw pipe syntax
- Progressive follow-up suggestions (concept → related texts → practice)
- Smart data source recommendations — when users ask about finding databases, AI automatically recommends relevant sources from 612 data sources via semantic similarity
- Meta-question handling — detects self-introduction queries ("who are you" / "what can you do") and skips RAG to give a clean functional overview, instead of randomly citing scriptures
- Anti-hallucination citation rules — the system prompt strictly forbids wrapping a text name in 【…】 unless that exact source appeared in the retrieved context, preventing broken citation links
- Inline split-view in reader — AI panel opens by default beside the text with a draggable divider; independent scrolling on each side, resizable width persisted to localStorage
- "Ask XiaoJin" button on the reader page — select text to ask about it
- Tab key cycles through suggested questions in the input box
- BYOK (Bring Your Own Key) support for multiple LLM providers
Verifiable answers — 每一句都能点回原典
Trust is the point. Every answer passes three deterministic guards before it reaches you:
- Citation whitelist — a 【《sutra》juan N】 citation is stripped or corrected unless that exact source was actually retrieved, so a citation link never points at something FoJin didn't read.
- Quote verification — text inside quote marks is checked to be a verbatim substring of the retrieved passage (traditional/simplified folded); a non-verbatim "quote" is downgraded to plain prose rather than passed off as scripture.
- Trust state — each answer is labelled
verified/citation_corrected/quote_relaxed/no_sourcesso you can see how grounded it is.
Measured on the eval harness at temperature 0, the raw model is verbatim-faithful only a small fraction of the time — but after the guards ~98% of citing answers are trustworthy: FoJin either points you to a real source or honestly hedges, and never fabricates scripture. The metric (served_trustworthy_rate) is tracked in backend/eval/faithfulness.py as a regression gate.
Read that denominator precisely, because we'd rather you knew than were impressed: it counts answers that cite at all. An answer that reaches you with no 【…】 citation cites nothing, so it verifies nothing, and it is not in that 98% — the guards can only vouch for claims that name a source. Quote fidelity is reported separately (verbatim_quote_rate), on purpose: a run must not be able to improve its score by quoting less.
Research Assistant (研究助手)
For multi-step questions a single search can't answer — "how is śūnyatā treated across Prajñāpāramitā, Madhyamaka and Yogācāra, with cited cross-canon parallels?" — the research assistant plans the question into steps, retrieves across the corpus, dictionaries and knowledge graph, then synthesises a grounded answer. The synthesis runs through the same citation guards as chat, so the agent can plan freely but cannot cite what it didn't retrieve. Available at /research (sign-in required); API at POST /api/research/query.
Master Persona Mode (法师模式)
Select a specific Buddhist master to receive answers in their teaching style, grounded in their tradition's core scriptures. 15 historical masters available:
Shortened here. Read the whole README on GitHub.
Tools it offers (8)
What this server listed when Ahel dialed its public endpoint in Oct 2026, with no key and no account of yours. The names are the server’s own.
search_corpusread_passageget_parallelslookup_dictionarylookup_entityresolve_urnverify_quotecommentaries
Signals
- GitHub stars
- 346
- Forks
- 64
- Last commit
- Sep 2026
Advanced
- Delivery
- fojin-mcp MCP server → your Ahel connector (mcp.ahel.ai) → your AI.
- Item type
- mcp-server
- Key
app-fojin-fojin-mcp- Source
- github.com/xr843/fojin
- Hosted endpoint
https://mcp.fojin.ai/mcp