Skip to main content
Glama
AnkiWeb MCP Server
by jklnr

claude-ankiweb-plugin

An AnkiWeb plugin for Claude (Claude desktop app and Claude Code). It connects directly to ankiweb.net and ankiuser.net over HTTPS so you can list and manage decks, add or edit flashcards, search notes, and study due cards without running Anki Desktop locally.

Requirements

Related MCP server: mcp-ankiconnect

Installation

Claude Desktop

In the Claude desktop app, open Customize → Plugins:

  • Browse the plugin directory for ankiweb, or

  • Click Add → Add from a Repository and enter jklnr/claude-ankiweb-plugin.

Claude Code

/plugin install ankiweb --marketplace jklnr/claude-ankiweb-plugin

For local development:

claude --plugin-dir /path/to/claude-ankiweb-plugin

Authentication

When you use an AnkiWeb tool while signed out, ankiweb_login opens a local 127.0.0.1 sign-in form in your browser, authenticates against AnkiWeb, and stores the session cookies in your OS keychain (falling back to ~/.config/claude-ankiweb/session.json with 0600 permissions).

You can also configure credentials in Claude's plugin settings (ankiweb_email and ankiweb_password) or via environment variables:

Variable

Description

ANKIWEB_EMAIL

Account email for non-interactive sign-in

ANKIWEB_PASSWORD

Account password paired with ANKIWEB_EMAIL

ANKIWEB_COOKIE

Raw ankiweb.net session cookie string

ANKIUSER_COOKIE

Raw ankiuser.net session cookie string (defaults to ANKIWEB_COOKIE)

ANKIWEB_CONFIG_DIR

Directory for fallback session.json (default: ~/.config/claude-ankiweb)

ANKIWEB_DISABLE_KEYRING

Set to 1 to use session.json instead of the OS keychain

Commands and Tools

Slash commands: /ankiweb:auth, /ankiweb:decks, /ankiweb:add, /ankiweb:study.

MCP Tool

Description

ankiweb_auth_status

Check whether the current AnkiWeb session is signed in and usable

ankiweb_login

Open a local 127.0.0.1 browser sign-in form

ankiweb_logout

Clear saved session cookies from the OS keychain and disk

ankiweb_list_decks

List decks, card totals, and due counts (new, learning, review)

ankiweb_create_deck

Create a deck (supports Parent::Child subdecks)

ankiweb_rename_deck

Rename a deck by deck_id

ankiweb_remove_deck

Delete a deck and its cards

ankiweb_list_notetypes

List note types (Basic, Cloze, etc.) and field names

ankiweb_add_note

Add a flashcard note to a deck

ankiweb_add_notes_batch

Add multiple flashcard notes in one call

ankiweb_search_notes

Search notes using Anki search syntax (deck:..., tag:..., is:due)

ankiweb_get_note

Get field values and tags for a note_id

ankiweb_update_note

Update fields or tags on an existing note_id

ankiweb_get_study_cards

Get the current lookahead window of due study cards

ankiweb_answer_card

Submit a review rating (again, hard, good, easy)

Privacy & Data Handling

  • This plugin runs locally via uv and communicates only with ankiweb.net and ankiuser.net over HTTPS. It uses no third-party servers, analytics, or telemetry.

  • Passwords entered in the local 127.0.0.1 sign-in form are sent directly to ankiweb.net and discarded; only session cookies and a masked email are stored locally in the OS keychain or ~/.config/claude-ankiweb/session.json.

  • Deck names, card counts, note contents, search queries, and review answers are sent directly between your device and your AnkiWeb account during tool calls. Run ankiweb_logout to remove stored session cookies.

Tests

uv run pytest -v

Disclaimer

Independent community project; not affiliated with or endorsed by Ankitects Pty Ltd.

License

Apache-2.0

Available Tools

15 tools
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.

Inputs: deck (required), fields (required), tags, notetype, +1 more. Returns: object

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).

Inputs: deck (required), notes (required), notetype, create_deck_if_missing. Returns: object

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).

Inputs: ease (required), card_id (required), time_taken_ms. Returns: object

ankiweb_auth_statusA
Read-onlyIdempotent

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.

Inputs: no named parameters. Returns: object

ankiweb_create_deckA
Idempotent

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

Inputs: name (required). Returns: object

ankiweb_get_noteA
Read-onlyIdempotent

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

Inputs: note_id (required). Returns: object

ankiweb_get_study_cardsA
Idempotent

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.

Inputs: deck. Returns: object

ankiweb_list_decksA
Read-onlyIdempotent

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

Inputs: no named parameters. Returns: object

ankiweb_list_notetypesA
Read-onlyIdempotent

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

Inputs: no named parameters. Returns: object

ankiweb_loginA
Idempotent

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.

Inputs: wait_seconds. Returns: object

ankiweb_logoutA
Idempotent

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

Inputs: no named parameters. Returns: object

ankiweb_remove_deckB
DestructiveIdempotent

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

Inputs: deck_id (required). Returns: object

ankiweb_rename_deckC

Rename an existing AnkiWeb deck by deck_id.

Inputs: deck_id (required), new_name (required). Returns: object

ankiweb_search_notesA
Read-onlyIdempotent

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.

Inputs: query (required), limit. Returns: object

ankiweb_update_noteA
Idempotent

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.

Inputs: fields (required), note_id (required), tags. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    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

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Connects Claude to Anki flashcard software via AnkiConnect, enabling users to review due cards, create flashcards, and manage spaced repetition learning through natural language conversations.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables reading and writing to your local Anki collection through AnkiConnect, allowing creation, update, and search of notes and decks from MCP clients like Claude Desktop.
      11
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects Claude AI to a running Anki instance via AnkiConnect, exposing 55 tools and resources for AI-powered flashcard generation, note/deck/card management, media handling, sync, and import/export. It also enables natural-language review analytics and study insights, letting users build and maintain their spaced-repetition collection conversationally.
      MIT