obs-5m-mcp
MCP server for Open Bible Stories + Theological Formation (Five Movements) content, providing tools like fetch_obs_study_manual to retrieve study manuals, story details, and PDF resources for translation workflows.
README
obs-5m-mcp
MCP server for Open Bible Stories + Theological Formation (Five Movements).
Content resolution: DCS catalog subject=OBS Theological Formation + topic=tc-ready (same defaults as Translation Helps MCP). English comes from Door43 unfoldingWord/en_obs_tf. When DCS has no entry (Indonesian today), tools use extracted text from self-hosted PDFs (R2) — not just a download link (bt-servant-engine#215).
Implements the study-manual surface requested in translation-helps-mcp#36 via fetch_obs_study_manual.
Content license: CC BY-SA 4.0 (unfoldingWord / partners).
Quick start
npm install
npm test # unit + contracts
npm run test:unit
npm run test:contracts
npm run dev # http://localhost:8790
# Chat UI (needs OPENAI_API_KEY in .dev.vars):
# http://localhost:8790/chat
# with wrangler running:
npm run test:smoke
Copy .dev.vars.example → .dev.vars and set OPENAI_API_KEY for the chat UI. Deployed: wrangler secret put OPENAI_API_KEY.
Endpoints:
| Path | Purpose |
|---|---|
/ |
Website home |
/docs |
Agent guide — how AI agents run translator sessions with these tools |
/chat |
Simple LLM chat UI (OpenAI + in-process MCP tools) |
/api/chat |
Chat SSE API (status / token / done; "debug": true for X-ray) |
/mcp |
MCP (Streamable HTTP / SSE via agents/mcp) |
/api |
JSON discovery (Accept: application/json on / also works) |
/api/mcp-manifest |
Tool catalog JSON |
/api/tool |
Direct tool invoke; pass "debug": true for X-ray traces |
/debug |
X-ray UI (tool runner + pipeline report) |
/assets/pdf/<r2Key> |
Stream self-hosted PDF from R2 |
/health |
Liveness |
Tests & X-ray
Modeled on translation-helps-mcp:
| Suite | Command | What it covers |
|---|---|---|
| Unit | npm run test:unit |
Parser, study manual, handlers (mocked Door43), X-ray events |
| Contracts | npm run test:contracts |
Tool module shape + outputSchema / RESOURCE_NOT_AVAILABLE |
| Smoke | npm run test:smoke |
Live /health, manifest, fetch_obs_study_manual + X-ray |
X-ray (pipeline transparency): POST /api/tool with "debug": true returns { result, xray, xrayReport }. Open /debug for an interactive panel. Chat also supports X-ray via the checkbox on /chat (or "debug": true on /api/chat).
Chat (LLM + MCP tools)
Cloned from Translation Helps /chat (SvelteKit + ChatDock + X-ray), rewired for OBS study-for-translation instead of scripture/TN/TW.
# Terminal A — MCP worker (tools, PDFs, docs)
npm run dev
# Terminal B — Svelte chat (primary UI)
npm run dev:web
# → http://localhost:8174/chat
- Study / Translate / Check map onto OBS sessionFlow parts (not Bible workflow modes).
- Session side panel replaces the TH Helps/scripture panel with Five Movements parts.
- API:
web/src/routes/api/chat→src/chat/chatHandler+ in-processTOOL_REGISTRY(OBS tools). - Worker
:8790/chatstill serves a slim HTML fallback if the Svelte app is not running.
Tools
Discovery: list_languages, list_resources, list_collections, list_stories
Study manual (#36): fetch_obs_study_manual
Helpers: get_framework, get_story, get_movement, get_devotional, get_study_guide, search_content
PDFs: get_pdf (Indonesian pack)
fetch_obs_study_manual (preferred for BT Servant)
{
"tool": "fetch_obs_study_manual",
"arguments": {
"reference": "1:1",
"language": "en",
"movement": 1,
"format": "json"
}
}
| Param | Description |
|---|---|
reference |
OBS story:frame — "1:1", "1" (whole story), "1:0" (intro). Optional obs prefix. |
language |
Default en (Door43 en_obs_tf). |
part |
Optional session slice: intro | frames | community | movement1–5 | drafting | checking | conclusion. Preferred for paced translator sessions. |
movement |
Optional 1–5 (same as part=movementN). Prefer part for drafting/checking/conclusion. |
format |
json (default), md, or text — md/text always render from the same parsed data (never falsely empty). |
Returns intro, frames, Community Study, Observation / Translation / Discourse / Theological / Journal, drafting, checking, Ministry / Mission, and conclusion — packaging resolved (shared TX and story-inline look the same). Response includes sections and sessionFlow for agent routing.
Related Translation Helps issues (out of scope here)
| Issue | Topic | Where it lives |
|---|---|---|
| #36 | en_obs_tf study manual |
This server (fetch_obs_study_manual) |
| #34 | OBS tn/tq/sn/sq format:md empty |
Translation Helps MCP (classic OBS TSV tools) |
| #35 | OBS translation-word links (en_obs-twl) |
Translation Helps MCP |
Indonesian PDFs → OBS-TF markdown (DCS fallback)
Used only when catalog search finds no OBS Theological Formation for id.
Canonical pipeline: PDF → font-aware plain MD → DCS-shaped MD (do not convert from coarse txt when plain MD is available).
# 1) PDF → plain MD (headings, **NN-NN** frames)
npm run plain-md -- --story=1
# 2) plain MD → en_obs_tf-shaped MD + transclusions
npm run convert:id -- --story=1
# Or generate missing plain MD then convert all:
npm run convert:id:from-pdf
# Force re-extract plain MD from PDF, then convert:
npm run convert:id -- --regen-plain --story=1
Setup steps:
- Download the zip from bt-servant-engine#215 (or Google Drive).
- Unpack PDFs into
data/incoming/(names likeOBS 1 (Indonesia).pdf). - Optional txt fallback:
npm run ingest:id -- --text-only→data/indonesian-text.json - Run the canonical pipeline above →
data/obs-tf-md/id/obs_story_N.mdwith unique sections (community study, divergent movements) inlined, shared movement/conclusion as![[…]]transclusions, plusstructure-report.json(soft metrics: translation terms, skeleton flags, shared-tx drift). --offlineuses the story-1 fixture for DCS compare when network is unavailable.- Upload PDF + text to R2:
npm run ingest:idor--localfor wrangler dev.
Structure cues live in data/structure-maps/id.json. Runtime prefers converted MD (sourceKind: local-md) over coarse PDF text. get_pdf still returns the file URL and extracted text.
Export a Door43 repo tree
After convert, build an upload-ready Resource Container folder (manifest + stories + transclusions):
npm run export:dcs
# or regenerate convert first:
npm run export:dcs -- --convert
# custom output:
npm run export:dcs -- --out=./tmp/id_obs_tf --force
Output: exports/id_obs_tf/ (gitignored). Create an empty Door43 repo, then git init / push from that folder — see exports/id_obs_tf/README.md.
Cloudflare setup
This app deploys as a Cloudflare Worker (MCP Durable Object + Workers Assets for the Ezer chat UI). That is the right host for MCP — not a static Pages site alone.
npx wrangler kv namespace create OBS_5M_CACHE
npx wrangler kv namespace create OBS_5M_CACHE --preview
# Optional (Indonesian PDF hosting) — enable R2 in the dashboard first:
npx wrangler r2 bucket create obs-5m-mcp-assets
Paste the KV ids into wrangler.toml, set PUBLIC_BASE_URL, then:
npm run deploy
npx wrangler secret put OPENAI_API_KEY
Chat: https://<worker>/chat · MCP: https://<worker>/mcp
BT Servant registration
- Deploy this worker.
- Register the MCP URL (
https://<worker>/mcp) in BT Servant admin (seebt-servant-workercurl examples). - Responses include
_meta.downstream_api_callsand_meta.cache_statusper MCP integration guidelines. - Smoke:
fetch_obs_study_manualwithreference: "1:1",language: "en";list_resourcesforid+get_pdf.
Architecture
Modeled on translation-helps-mcp v2: Cloudflare Worker + McpAgent Durable Object, Zod tools, RESOURCE_NOT_AVAILABLE with isError: false.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。