srs-mcp
srs-mcp
与代理无关的 MCP 服务器,用于间隔重复学习——**无需 Anki GUI、无需 Xvfb、无需 AnkiConnect。**自带代理;它提供卡片盒 + 调度器。
它将 FSRS(Free Spaced Repetition Scheduler,现代 Anki 使用的同款算法)封装在一个小巧的 SQLite 存储之上,因此代理可以创建卡片、查看到期卡片并记录回忆情况——完全无头运行。
为什么不用无头 Anki?
无头驱动 Anki 桌面应用意味着需要 Qt + 虚拟帧缓冲(Xvfb)+ AnkiConnect 插件——既脆弱又和版本强耦合。如果你需要与手机上的 Anki 互通,anki PyPI 包可以在无 GUI 的情况下驱动真实的 .anki2 集合。但如果你只是想要 API 背后的间隔重复,你根本不需要 Anki:FSRS 是一个库,而这个服务器只是围绕它的约 200 行代码。
Related MCP server: Memory MCP Server
工具
add_card(front, back) -> {card_id, due}— 创建并调度一张卡片。保持back简短——一个词或一个短语;无法在几秒内评分的卡片是笔记,而不是闪卡due_cards(q=None, limit=20) -> [{card_id, front, back, deck, due}]— 当前到期的卡片,可选地按主题缩小范围(q="horace")grade_card(card_id, rating) -> {card_id, rating, next_due, reps}— 记录回忆情况(again/hard/good/easy,或 1-4)edit_card(card_id, front=None, back=None)— 就地编辑内容;调度保持不变(修正拼写错误/缩短冗长答案,而不是重复创建)suspend_card(card_id)/unsuspend_card(card_id)— 搁置一张卡片(保留其历史,从到期队列中移除)/ 恢复它list_cards(q=None, limit=50)— 无论到期日期如何,概览所有卡片delete_card(card_id)— 删除一张(重置/清理)stats(deck=None) -> {total, due_now, suspended, reviews, decks}
查找卡片:搜索,而非牌组
卡片通过搜索其文本来查找——due_cards(q="horace")——而不是预先将它们归档到牌组中。不再有任何东西写入 deck 字段;把主题写进卡片本身("Horace, Odes 1.11: …"),它就能保持可被找到。
牌组是单值、自由文本、精确匹配的标签,没有附加任何按牌组的调度,所以它们没有带来搜索做不到的事情,反而牺牲了准确性:在用于衡量的牌组上,代理们发明了十个 Horace 的名称,跨越五种分隔符约定,因此最好的 deck="Horace" 只能从 97 张 Horace 卡片中返回 20 张,而 q="horac" 返回 89 张——包括那些被错误归档到 Talks 下的。due_cards/list_cards/stats 上的列和 deck= 过滤器保留给旧版本标记的卡片。参见 plans/002-decks.md。
复习循环:due_cards → 用 front 考问用户 → 对照 back 检查 → grade_card。FSRS 根据评分计算下一个到期日期。
运行
uv sync
# HTTP (default; for Railway / remote agents)
PORT=8000 uv run srs-mcp
# or stdio (local agent)
MCP_TRANSPORT=stdio uv run srs-mcp存储
两种后端,启动时选择:
Postgres(共享牌组) — 将
SRS_DATABASE_URL(或DATABASE_URL)设置为 Postgres 连接字符串(例如 Neon DB)。指向同一 URL 的每个部署都读写一个共享牌组,因此你可以从任何地方(本地、Railway 等)添加和复习卡片。FSRS 卡片 ID 很大,所以 Postgres 上的cards.card_id列是BIGINT。需要psycopg依赖(已声明)。SQLite(回退) — 当未设置
*DATABASE_URL时,卡片存放在SRS_DB指定的 SQLite 文件中(默认./srs.db)。单主机/离线。在 SQLite-on-Railway 设置中,在/data挂载一个卷并保持SRS_DB=/data/srs.db,这样卡片盒就能在重新部署后存活。
模式完全相同(表 cards),并在首次使用时自动创建。
Available Tools
9 toolsadd_cardA
Author a new flashcard and schedule it. front is the prompt/question,
back is the answer. Optional deck groups cards (default 'default').
Returns JSON {card_id, due}. The card is due immediately (first review).
| Name | Required | Description | Default |
|---|---|---|---|
| back | Yes | ||
| deck | No | default | |
| front | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
delete_cardC
Delete a card by id (reset / cleanup).
| Name | Required | Description | Default |
|---|---|---|---|
| card_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
due_cardsA
List cards due for review now (due <= now), soonest first. Optionally
filter by deck. Returns a JSON array of {card_id, front, back, deck, due}.
Quiz the user with front, check against back, then call grade_card.
Returns '[]' when nothing is due.
| Name | Required | Description | Default |
|---|---|---|---|
| deck | No | ||
| limit | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
edit_cardA
Edit a card's content without disturbing its schedule. Update any of
front, back, deck (omit or pass null to leave unchanged); the FSRS
review state (difficulty, stability, due date, reps) is preserved. Use
this to fix typos or add context instead of creating a duplicate card.
Returns JSON {card_id, front, back, deck}.
| Name | Required | Description | Default |
|---|---|---|---|
| back | No | ||
| deck | No | ||
| front | No | ||
| card_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
grade_cardA
Record a review of a card. rating is how well it was recalled:
'again' (forgot), 'hard', 'good', or 'easy' (1-4 also accepted). FSRS
updates the schedule; returns JSON {card_id, rating, next_due, reps}.
| Name | Required | Description | Default |
|---|---|---|---|
| rating | Yes | ||
| card_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
list_cardsA
List cards (newest first) regardless of due date, for an overview.
Optionally filter by deck. Returns JSON array of
{card_id, front, back, deck, due, reps, suspended}.
| Name | Required | Description | Default |
|---|---|---|---|
| deck | No | ||
| limit | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
statsA
Summary of the card box: total cards, how many are due now, total
reviews, and the deck list. Optionally scope counts to one deck.
| Name | Required | Description | Default |
|---|---|---|---|
| deck | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
suspend_cardA
Shelve a card: keep it (with its full history and schedule) but remove it from the due queue, so it won't surface in due_cards until unsuspended. Reversible, non-destructive alternative to delete_card for cards you're unsure about. Returns JSON {card_id, suspended}.
| Name | Required | Description | Default |
|---|---|---|---|
| card_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
unsuspend_cardA
Un-shelve a previously suspended card, returning it to the review queue (it becomes due again per its existing schedule). Returns JSON {card_id, suspended}.
| Name | Required | Description | Default |
|---|---|---|---|
| card_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
9 tool updates
v0.2.1- First observed
add_card - First observed
delete_card - First observed
due_cards - First observed
edit_card - First observed
grade_card - First observed
list_cards - First observed
stats - First observed
suspend_card - First observed
unsuspend_card
TDQS
Scored across 9 tools
Each tool has a clearly distinct purpose: adding, deleting, editing, listing, reviewing, grading, stats, suspending, and unsuspending cards. No two tools overlap in functionality.
All tool names follow a consistent verb_noun pattern in snake_case, e.g., add_card, delete_card, grade_card. Names are predictable and readable.
9 tools is well-scoped for a spaced repetition system, covering all essential operations without bloat. Each tool earns its place.
Covers core CRUD, review workflow, statistics, and suspension. Missing explicit deck management (e.g., create/delete deck) but decks are manageable via card properties.
Maintenance
Related MCP Connectors
Build and study spaced-repetition flashcards with your agent.
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.
Agent-native spaced-recall system of record. Deterministic dueAt via remote MCP for Muse/any agent.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides a privacy-first adaptive review engine with local SQLite storage, enabling item creation, due review retrieval, grading, and statistics via MCP tools.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to store, search, and manage persistent memories, todos, kanban boards, reminders, and progress trackers in a local SQLite database.1Apache 2.0
- AlicenseAqualityCmaintenanceProvides spaced-repetition scheduling with the SM-2 algorithm as MCP tools, enabling agents to manage review items like flashcards or vocab locally. It supports adding, grading, and listing due items, plus optional pro features for export and forecast.6MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI clients to create spaced-repetition flashcards from material being learned, quiz users aloud, grade answers, and schedule reviews using the FSRS algorithm through a self-hosted MCP server.7AGPL 3.0