flashcard-mcp
A lightweight MCP server that adds spaced-repetition flashcards (SM-2) to AI assistants, storing data locally in SQLite and enabling card creation, review, and scheduling.
README
<div align="center">
🃏 Flashcard MCP
Give any AI assistant a memory that actually lasts.
A lightweight MCP server that adds spaced-repetition flashcards (the classic SM-2 algorithm behind SuperMemo and Anki) to Claude, Cursor, VS Code, and every other MCP-compatible assistant.
<p align="center"> <img alt="GitHub stars" src="https://img.shields.io/github/stars/cokovali10-sketch/flashcard-mcp?style=for-the-badge&logo=github&color=7c3aed"> <img alt="License" src="https://img.shields.io/badge/license-MIT-7c3aed?style=for-the-badge"> <img alt="Python" src="https://img.shields.io/badge/python-3.10%2B-7c3aed?style=for-the-badge&logo=python"> <img alt="MCP" src="https://img.shields.io/badge/built%20with-MCP-7c3aed?style=for-the-badge"> </p>
Stop re-teaching your AI the same thing every session. Your assistant now learns vocabulary, concepts, and facts once — then reviews them at the optimal moment so they stick forever.
</div>
Why?
Every AI session starts from zero. You ask your assistant to help you learn English words, it makes a nice list — and by tomorrow both of you have forgotten everything.
Flashcard MCP fixes this: it stores flashcards locally and schedules reviews using the SM-2 algorithm, the scientifically-backed method that powers SuperMemo and Anki. The AI creates the cards, you review them, and the server decides exactly when to bring each card back so it moves from short-term to long-term memory.
- 🔒 100% local — your data lives in a single SQLite file. No cloud, no accounts, no tracking.
- 🧠 Real spaced repetition — the SM-2 algorithm, not a random "quiz".
- ⚡ Zero config — install, add two lines to your MCP config, done.
- 🐍 Pure Python, zero heavy dependencies — one tiny package, nothing else.
Installation
pip install flashcard-mcp
Configuration
Add the server to your MCP client. Examples for the most common setups:
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"flashcards": {
"command": "flashcard-mcp",
"args": []
}
}
}
VS Code / Cursor (.mcp.json):
{
"servers": {
"flashcards": {
"type": "stdio",
"command": "flashcard-mcp"
}
}
}
Data location: the database is created at
./data/flashcards.dbnext to the package. Override it with theFLASHCARD_DBenvironment variable.
How it works
- You ask your AI to build a deck — e.g. "Create a deck 'English' and add cards for these phrasal verbs: look up, break down, give up."
- The AI calls the tools — the server creates the deck and cards in SQLite.
- When you want to review — ask "Let's review my due cards." The server returns exactly the cards that are due today, per the SM-2 schedule.
- You grade each card (0–5), the algorithm updates the easiness factor and picks the next review date. Perfect recalls → longer intervals. Misses → the card comes back tomorrow.
- Repeat — over time each card is reviewed at expanding intervals and permanently lands in your long-term memory.
Tools
| Tool | Description |
|---|---|
create_deck |
Create a study deck |
list_decks |
List all decks with card counts |
delete_deck |
Delete a deck and its cards |
add_card |
Add a flashcard (front / back) |
list_cards |
List flashcards, filtered by deck |
delete_card |
Delete a flashcard |
get_due_cards |
Get cards due for review today |
review_card |
Grade a card (quality 0–5) and reschedule it |
get_stats |
Total cards, due today, per-deck breakdown |
export_cards |
Export everything as JSON |
The SM-2 algorithm
When you grade a card, the server updates two numbers:
- Easiness factor (EF) — how easy this card is for you. Starts at 2.5, never drops below 1.3.
- Interval (days) — the gap until the next review.
1 → 6 → 6×EF → 6×EF² → …
A grade below 3 resets the card to a 1-day interval. This is exactly the schedule that makes spaced repetition effective — it targets reviews right before you'd forget.
Development
pip install -e ".[dev]"
pytest
Project structure
flashcard_mcp/
├── src/flashcard_mcp/
│ ├── srs.py # SM-2 scheduling algorithm
│ ├── db.py # SQLite storage layer
│ └── server.py # MCP server + tool definitions
└── tests/ # unit + end-to-end stdio tests
Roadmap
- [ ] Anki
.apkgimport/export - [ ] HTML dashboard with retention graphs
- [ ] Prompt templates for vocabulary / exam / language learning
- [ ] Prebuilt study decks
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.