MCP-AnkiConnect

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
ANKI_HOSTNoThe host where AnkiConnect is runninglocalhost
ANKI_PORTNoThe port AnkiConnect is using8765

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
num_cards_due_today

Get the number of cards due today with an optional deck filter

list_decks_and_notes

Get all decks and note types with their fields

get_examples

Get example notes from Anki to guide your flashcard making. Limit the number of examples returned and provide a sampling technique:

- random: Randomly sample notes - recent: Notes added in the last week - most_reviewed: Notes with more than 10 reviews - best_performance: Notes with less than 3 lapses - mature: Notes with interval greater than 21 days - young: Notes with interval less than 7 days
fetch_due_cards_for_review

Fetch cards that are due for learning and format them for review. Takes optional arguments: - deck: str - Filter by specific deck. - limit: int - Maximum number of cards to fetch (default 5). More than 5 is overwhelming for users. - today_only: bool - If true, only fetch cards due today, else fetch cards up to 5 days ahead.

submit_reviews

Submit multiple card reviews to Anki.

Args: reviews: List of dictionaries containing: - card_id (int): The ID of the card being reviewed - rating (str): The rating to give the card, one of: "wrong" - Card was incorrect (Again) "hard" - Card was difficult (Hard) "good" - Card was good (Good) "easy" - Card was very easy (Easy)
add_note

Add a flashcard to Anki. Ensure you have looked at examples before you do this, and that you have got approval from the user to add the flashcard. Args: deckName: str - The name of the deck to add the flashcard to. modelName: str - The name of the note type to use. fields: dict - The fields of the flashcard to add. tags: List[str] - The tags to add to the flashcard.