anki-exam-forge
Provides tools for building, validating, inspecting, diffing, and updating Anki .apkg decks with deterministic GUIDs, preserving review history and supporting mnemonic writeback into Anki note fields.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
anki-exam-forge
A closed-loop Antigravity plugin, MCP server, and universal cross-platform Agent Skill for turning past exam papers and lecture slides into high-yield, zero-duplicate Anki .apkg decks. Designed with zero third-party runtime dependencies on Node.js >=20 and Python >=3.9 stdlib (pymupdf or pdftoppm optional for PDF rendering).
The 4-Stage Closed Loop
Past-Exam Ingestion & Deterministic Frequency Analysis
extractreads.pdf(extracting text + rasterizing scanned/illustrated pages to PNGs for multimodal inspection),.pptx(slide text, speaker notes, and embedded images via stdlib XML/ZIP),.docx(paragraphs, tables, and images),.md/.txt, and image folders.freqaggregates exam items by normalizedconcept_key, counts exact appearances deterministically, summarizes source years and alternative phrasings, writes a Markdown frequency report, and outputs a prioritizeddeck.jsontagged withfreq::high/freq::medium/freq::low.
Zero-Dependency Stable-GUID
.apkgBuilder & InspectorPure-stdlib Python builds Anki v11
.apkgarchives (collection.anki2+media) with light/dark-aware templates across three Note Types:ExamForge-Basic(Q&A cards)ExamForge-MCQ(Interactive click-to-highlight options + rationale on back)ExamForge-Cloze(Multi-cloze{{c1::...}}/{{c2::...}}card expansion)
Orders
cards.dueso high-frequency past-exam concepts appear first, bundles referenced images, and assigns deterministicguids so future updates apply in place without losing Anki review history.inspectreads.apkgarchives (preferringcollection.anki21overcollection.anki2), extracts media, and filters by tag (leech), deck, keyword, orminLapses.
Lecture PPT / Notes Incremental Supplement (Zero Duplicates)
diffcompares candidate cards from lecture slides/notes against an existingdeck.jsonor.apkgusing canonical key matching + hybrid bigram Jaccard similarity — skipping exact duplicates, surfacing near-duplicates (with optional--merge-nearenrichment), and appending only genuinely new cards into04-课件补充while preserving every existingguid.
Leech / Stuck Card Mnemonic Writeback
inspectisolates stubborn high-lapse orleech-tagged cards;mnemonicwrites structured hooks (acronyms, rhymes, homophones, mechanism chains, contrast tables, visual/loci cues) strictly into theMnemonicfield and exports a surgical.apkgupdate preserving originalguids.
Core Principle: Mnemonics solve initial encoding for stubborn items; Anki spaced repetition maintains long-term retrievability.
Related MCP server: study-mcp
8 Tools (MCP & CLI)
MCP Tool | CLI Subcommand | Purpose |
|
| Inspect Python, SQLite, OOXML ( |
|
| Extract text, speaker notes, rendered PNG pages, and images from PDF/PPTX/DOCX/text |
|
| Deterministically count past-exam frequencies and generate Markdown report + deck JSON |
|
| Validate card fields, |
|
| Compile deck JSON into a deterministic-GUID |
|
| Inspect |
|
| Diff lecture supplement candidates against an existing deck or |
|
| Write memory hooks into matching cards' |
Prerequisites
Python
>= 3.9(core.apkg, frequency engine,.pptx/.docxextraction use stdlib only)Node.js
>= 20(for MCP server, Node CLI, and installer)Optional PDF rendering:
pymupdf(pip install pymupdf) orpdftoppmonPATH(only needed when processing.pdffiles)
Quick Start
# 1. Install as an Antigravity global plugin (~/.gemini/config/plugins/anki-exam-forge/)
node scripts/install.mjs --antigravity-global
# 2. Or install into a specific workspace (.agents/plugins/anki-exam-forge/)
node scripts/install.mjs --antigravity-workspace /path/to/workspace
# 3. Or install as a self-contained universal Skill (includes engine/ for Claude Code / Codex / OpenCode)
node scripts/install.mjs --skill-only ~/.agents/skills
# 4. Or print portable MCP JSON config for Claude Code / Cursor / Gemini CLI / Codex
node scripts/install.mjs --print-mcpRun diagnostics:
node server/cli.mjs doctor
# or directly via Python:
python engine/cli.py doctorEnd-to-End Walkthrough (examples/)
# 1. Count past-exam frequencies -> Markdown report + v1 deck
node server/cli.mjs freq examples/sample-medical-exams.json --preset clinical-medicine --report-out out/freq.md --deck-out out/deck_v1.json
# 2. Validate & build v1 .apkg
node server/cli.mjs validate out/deck_v1.json
node server/cli.mjs build out/deck_v1.json --out out/med_v1.apkg
# 3. Diff lecture PPT candidates against existing .apkg -> merge & rebuild v2
node server/cli.mjs diff --base out/med_v1.apkg --candidates examples/sample-ppt-supplement.json --merge-near --out-deck out/deck_v2.json
node server/cli.mjs build out/deck_v2.json --out out/med_v2.apkg
# 4. Inspect & write mnemonics back while preserving GUIDs
node server/cli.mjs inspect out/med_v2.apkg --query 垂腕
node server/cli.mjs mnemonic --base out/med_v2.apkg --patches examples/sample-mnemonics.json --out-deck out/deck_v3.json --out-apkg out/med_mnemonic_patch.apkgRunning Tests
npm test
# Or individually:
npm run test:py
npm run test:jsCompanion Android & Web App: 玖记 (anki-forge-app)
Generated .apkg and deck.json files pair natively with 玖记 / Jiuji (anki-forge-app) — an offline-first Android APK & Web/PWA companion featuring system-level .apkg file association, FSRS-5 + exam-frequency sprint mode, tap-to-grade MCQs, zoomable diagrams, and one-tap leech export back to anki-exam-forge.
License
Released under the MIT License.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Make Anki flashcards from lecture PDFs, slides, notes and YouTube videos, each with its source page.
Build study flashcards and exam-prep decks from your AI chat, all stored locally.
Spaced-repetition flashcards in Markdown: create cards, manage decks and study with FSRS.
Spaced-repetition flashcards your AI writes, quizzes you on by voice, and schedules with FSRS.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceBridge between AI assistants and Anki Desktop, enabling automated flashcard management and study document processing.380 npmMIT
- AlicenseNot gradedqualityDmaintenanceConverts study materials like PDFs, slides, and DOCX into a searchable vector database with semantic search, summarization, and flashcard generation, integrated with Notion.5MIT
- AlicenseAqualityCmaintenanceTurns your PDFs into locally stored flashcards and quizzes, grades your answers, and schedules spaced-repetition reviews entirely on your machine.12MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude users to turn lecture PDFs, PowerPoint and Word files, photos of notes, pasted text, and YouTube videos into Anki flashcard decks (basic, cloze, and image occlusion) with the exact quote and page on every card. Finished decks can be reviewed, edited, and downloaded as .apkg or CSV files for Anki, AnkiMobile, and AnkiDroid.1MIT