Explore and cite historical primary sources with OCR, translations, semantic search, and DOI-linked scholarly metadata.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
One-click editor setup isnβt available for this listing yet β we donβt have a confirmed install command, and weβd rather show nothing than point your editor at the wrong package or host. Follow the projectβs own setup instructions, linked above.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Source Library.
A digital library of historical primary sources with AI-aided OCR, translation, and scholarly curation.
π Visit Library β’ π Docs β’ πΊοΈ System Map β’ π€ Contribute
Explore thousands of digitized historical texts with AI-enhanced translations and scholarly curation.
Source Library is an open digital library dedicated to making early printed books and primary sources readable and citable. We specialize in alchemy, Hermetica, Kabbalah, Rosicrucianism, and early modern scienceβtexts that bridge historical scholarship with contemporary exploration.
The platform ingests ~15K pages monthly from Internet Archive, Gallica, Bodleian, Wellcome, and other digital heritage partners.
| π¨ Frontend | Next.js 16, React 19, TailwindCSS, Lucide icons |
| βοΈ Backend | Next.js API routes, AWS Lambda for async processing |
| πΎ Database | MongoDB Atlas (primary), Supabase (embeddings) |
| π€ AI/ML | Google Gemini 3.1 (OCR, translation, summarization) |
| ποΈ Storage | Vercel Blob (images), AWS S3 (archive), Cloudflare R2 (archive) |
| π Auth | NextAuth v5 with MongoDB adapter |
| π DevOps | Vercel (hosting), GitHub (VCS), Playwright (E2E tests) |
| βοΈ Testing | Vitest (unit/integration), Playwright (E2E) |
| π Search | PostgreSQL FTS + semantic search via Supabase |
π¦ Key Dependencies:
sharp β Image resizing and cropping@google/generative-ai β Gemini API integrationxml2js β USTC metadata parsing@modelcontextprotocol/sdk β MCP server for agent integrationstripe β Donation and subscription handlingbph.sourcelibrary.org)π Books contain structured metadata:
π Pages store individual page data:
πΌοΈ Gallery images are extracted illustrations:
All page images are resized on-demand via /api/image:
| Tier | Dimensions | Quality | π± Use Case |
|---|---|---|---|
| Thumbnail | 400px wide | 70% JPEG | Grids, navigation, social sharing |
| Display | 1200px wide | 80% JPEG | Main reading view, comfortable for annotation |
| Full | 2400px wide | 90% JPEG | Magnifier, fullscreen detail, printing |
Split pages are cropped non-destructively via coordinates; original images are always preserved.
visible: true, mint DOI, push to search indexBatch endpoints process up to 5 pages/request using Gemini Batch API (50% cheaper).
Base URL: https://sourcelibrary.org (production) or http://localhost:3000 (local dev with .env.local configured).
Common 404 mistake: paths like
/api/bph/booksor/api/bph/books/[id]do not exist. BPH catalogue APIs live under/api/embed/bph/.... There is also no top-level/api/[tenant]/booksroute β tenant book listings use/api/books/libraryor the embed routes below.
| Endpoint | Method | Purpose |
|---|---|---|
/api/search?q=<query> | GET | Full-text search across books and page translations |
/api/books?limit=100&offset=0 | GET | Simple book list (global catalogue; visible: true, indexed only) |
/api/books/library?limit=100&skip=0 | GET | Rich browse API β search, sort, filters, collections |
/api/books/[id] | GET | Book metadata (accepts Mongo id or slug) |
/api/books/[id]/quote?page=<n> | GET | Citable quote + formatted citations (inline, footnote, BibTeX, DOI) |
/api/gallery?limit=24 | GET | Illustration / artwork search |
/api/image?url=<encoded-url>&w=400 | GET | On-demand image resize & crop |
/api/embed/bph/books?limit=24 | GET | BPH catalogue (paginated, searchable) |
/api/embed/bph/books/[slug] | GET | Single BPH book detail |
/api/embed/bph/featured | GET | Featured BPH books |
/api/embed/bph/collections | GET | BPH collection list |
/api/embed/bph/languages | GET | BPH language facets |
/api/embed/bph/suggest?q=alch | GET | BPH search autocomplete |
/api/embed/bph/stats | GET | BPH catalogue stats |
/api/bph/...)Use one of these patterns to filter by partner tenant (e.g. BPH):
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/source-library)<a href="https://allmcps.com/mcp/source-library"><img src="https://allmcps.com/api/badge/source-library?style=directory" alt="Source Library on AllMCPs" /></a>