Skip to main content
Glama
AnkiWeb MCP Server
by jklnr

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
ANKIWEB_EMAILNoAccount email for non-interactive sign-in.
ANKIWEB_COOKIENoRaw ankiweb.net session cookie string.
ANKIUSER_COOKIENoRaw ankiuser.net session cookie string (defaults to ANKIWEB_COOKIE).
ANKIWEB_PASSWORDNoAccount password paired with ANKIWEB_EMAIL.
ANKIWEB_CONFIG_DIRNoDirectory for fallback session.json (default: ~/.config/claude-ankiweb).
ANKIWEB_DISABLE_KEYRINGNoSet to 1 to use session.json instead of the OS keychain.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

AnkiWeb MCP Server for Claude.

Authorization & usability rules:

  • NEVER ask the user to type or paste their AnkiWeb password in chat, and NEVER ask them to run terminal scripts.

  • Whenever a tool fails with error_code: "not_authenticated" (or ankiweb_auth_status returns signed_in: false), call ankiweb_login immediately to open the secure local sign-in form in the user's browser.

  • If ankiweb_login returns pending_in_browser: true, share login_url as a backup link and call ankiweb_auth_status once the user says they have signed in.

  • Check usable (and blocked_reason / action_required_url) on ankiweb_auth_status: an account can be signed_in: true while usable: false (e.g. email_verification_required or terms_confirmation_required). In that case, share action_required_url so the user can finish that step on AnkiWeb.

Study session rules:

  • Show cards[0].question_text first; when flipping, show cards[0].answer_only_text so the front question is not repeated.

  • AnkiWeb streams a 1-2 card lookahead window per call. ankiweb_answer_card automatically returns updated counts and the next due cards—do not call ankiweb_get_study_cards again after every answer.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
ankiweb_auth_statusA

Check whether AnkiWeb is signed in AND usable for deck/card calls.

Returns signed_in, usable (authenticated), blocked_reason, and next_action:

  • signed_in: false -> call ankiweb_login.

  • signed_in: true, usable: false -> account needs an action at action_required_url (e.g. email_verification_required).

  • signed_in: true, usable: true -> ready to list decks and study.

ankiweb_loginA

Open a secure local browser form for the user to sign in to AnkiWeb.

Waits up to wait_seconds (1..55) for the user to submit the browser form. If pending_in_browser: true is returned, keep login_url visible to the user and call ankiweb_auth_status once the user confirms they finished signing in.

ankiweb_logoutA

Clear saved AnkiWeb and AnkiUser session cookies from keychain and disk.

ankiweb_list_decksA

List all decks in the user's AnkiWeb collection with card and due counts.

ankiweb_create_deckA

Create a deck on AnkiWeb. Use Parent::Child for nested subdecks.

ankiweb_rename_deckC

Rename an existing AnkiWeb deck by deck_id.

ankiweb_remove_deckB

Permanently delete a deck and all of its cards from AnkiWeb.

ankiweb_list_notetypesA

List available note types (e.g. Basic, Cloze) and their ordered field names.

ankiweb_add_noteA

Add a single flashcard note to AnkiWeb.

Args: deck: Target deck name (e.g. "Spanish::Verbs") or numeric deck ID string. fields: Mapping of note type field names to values (e.g. {"Front": "...", "Back": "..."} for Basic, or {"Text": "{{c1::Paris}} is the capital of France", "Back Extra": ""} for Cloze). HTML formatting and MathJax are supported; <img> tags are not. notetype: Note type name (default "Basic") or ID. tags: Optional list of tags (no spaces inside individual tags). create_deck_if_missing: Automatically create deck if it does not yet exist.

ankiweb_add_notes_batchB

Add multiple flashcard notes to AnkiWeb in a single batch.

Each item in notes should contain {"fields": {"Front": "...", "Back": "..."}, "tags": [...]} (and optionally "notetype" to override the batch default for a specific note).

ankiweb_search_notesA

Search notes on AnkiWeb using Anki query syntax (e.g. deck:Default, tag:leech, is:due).

AnkiWeb returns up to 100 matching notes per search. Pass note_id from search results to ankiweb_get_note or ankiweb_update_note for full details.

ankiweb_get_noteA

Fetch full field values, field names, and tags for a specific note_id.

ankiweb_update_noteA

Update field values and/or tags on an existing note.

fields supports partial updates: unspecified fields retain their current values. If tags is omitted (None), existing tags are preserved.

ankiweb_get_study_cardsA

Fetch the current lookahead window (1-2 cards) of due study cards from AnkiWeb.

Pass deck (case-insensitive deck name, subdeck leaf name, or ID) to select that deck first; if not found, returns deck_not_found with available_decks and closest_matches.

Each returned card provides clean question_text (CSS stripped) and answer_only_text (back side only, split past <hr id=answer>). When you submit a rating via ankiweb_answer_card, it automatically returns the next due cards and updated counts—do not call ankiweb_get_study_cards again after every answer.

ankiweb_answer_cardA

Submit a review answer (again, hard, good, or easy) for card_id.

Automatically returns updated counts and the next due cards lookahead window (cards[0] is the next card to quiz).

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.7/5.0

Scored across 15 tools

Disambiguation5/5

Each tool maps to a distinct resource/action pair: auth (status/login/logout), decks (list/create/rename/remove), notes (add/add_notes_batch/search/get/update), and study (get_study_cards/answer_card). The only near-overlap is add_note vs add_notes_batch, and the descriptions make the single-vs-batch split unambiguous. get_study_cards and answer_card are also clearly delineated by the explicit note that answering returns the next window.

Naming Consistency5/5

All 15 tools share the ankiweb_ prefix followed by a consistent snake_case verb_noun pattern (list_decks, create_deck, search_notes, answer_card, etc.). The only minor deviation is ankiweb_auth_status being a noun phrase, but it is still readable and predictable within the set.

Tool Count5/5

15 tools is well within the ideal 3-15 range for an AnkiWeb client. Each tool covers a needed operation across auth, deck management, note CRUD, and study review, with no redundant or filler tools.

Completeness3/5

The surface covers auth, deck lifecycle (list/create/rename/delete), note read/write/search, and study review, but there is no way to delete a note or card, which is a notable gap for collection management. Note types are also read-only (list only), and there is no bulk update/remove path despite the batch add.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues