Mousetail
Provides tools for managing Anki collections and cards, including create, read, update, delete operations, as well as synchronization with AnkiWeb or self-hosted sync servers.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Mousetail Create a card for the definition of photosynthesis"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
The simplest and most stable MCP Server for Anki
Mousetail's goal is to be the simplest and most reliable way of connecting Anki to an LLM. It does not require any addons, just have anki installed and an LLM you'd like to connect to your decks.
Running the server is as simple as:
uvx mousetailFor detailed instructions on integrating with Claude Code, Claude Desktop, and other LLM tools:
Features
Minimal - supports core anki operations: create, read, update and delete
Stable - works directly with anki's stable pylib api, no addons or deps
Simple - no configuration required, automatically discovers your Anki collections
Related MCP server: @lifeng688/anki-mcp
Use Cases
Selectively commit what you learn in conversation with an LLM to memory
"Create a deck based on our conversation so I don't forget critical details"
Use an LLM to interact with your deck
"Create a card - what is a coeffcient?, create a card - id the first coefficient in this polynomial"
Use an LLM to cleanup a deck
"Check my french vocab deck for correctness and correct any mistakes, typos or errors"
Syncing
Mousetail supports synchronizing your Anki collection with AnkiWeb or a self-hosted sync server. This allows you to keep your collection in sync across devices.
Quick Start
Sync with AnkiWeb (saves credentials for future syncs):
> "Save my AnkiWeb credentials: username is myuser@example.com and password is mypassword"
> "Sync my collection with AnkiWeb"Credential Management
Mousetail stores credentials securely in your system's credential manager:
macOS: Keychain
Windows: Credential Manager
Linux: Secret Service (GNOME Keyring, KWallet, etc.)
Available credential tools:
save_sync_credentials- Save username/password securelyload_sync_credentials- Load saved credentialsdelete_sync_credentials- Remove saved credentials
Sync Options
The sync_collection tool supports:
AnkiWeb sync (default) - Leave endpoint empty
Self-hosted servers - Provide custom endpoint URL (e.g.,
https://sync.example.com)Media sync - Enabled by default, includes images and audio files
Collection-only sync - Set
sync_media: falseto skip media
Examples
First-time setup with AnkiWeb:
> "Save my sync credentials for AnkiWeb - username: user@example.com, password: mypass123"
> "Sync my collection"Using a self-hosted server:
> "Save my sync credentials - username: john, password: secret, endpoint: https://sync.myserver.com"
> "Sync my collection"One-time sync without saving credentials:
> "Sync my collection with AnkiWeb using username user@example.com and password mypass123"Collection-only sync (skip media):
> "Sync my collection but don't sync media files"Configuration
You can set a default sync endpoint in config.json:
{
"sync": {
"endpoint": "https://sync.example.com"
}
}Leave endpoint as null to use AnkiWeb by default.
Important Notes
Close Anki first: Sync will fail if the Anki application is running
Media sync: Media sync is slower and uses more bandwidth but ensures images/audio are synced
Conflicts: If conflicts occur, try syncing from Anki desktop first to resolve them
Security: Credentials are never stored in plain text - they're kept in your system's secure credential storage
Self-Hosted Sync Server Setup
To sync with your own server:
Set up an Anki sync server
Configure credentials on the server (using environment variables like
SYNC_USER1=user:password)Save your credentials in Mousetail with the server endpoint
Sync normally
For detailed sync server setup, see the official Anki documentation.
Important Notes
How Collections Are Accessed
The MCP server finds Anki collections at their standard locations:
macOS:
~/Library/Application Support/Anki2/[Profile]/collection.anki2Linux:
~/.local/share/Anki2/[Profile]/collection.anki2Windows:
%APPDATA%\Anki2\[Profile]\collection.anki2
You don't need to configure paths - the server automatically discovers available collections, this can be customized using configuration.
Configuration
The server can be customized through a config.json file. See the Usage Guide for configuration options.
Development
Local Development Setup
To develop and test Mousetail locally with Claude Code:
Clone the repository:
git clone https://github.com/listfold/mousetail.git cd mousetailInstall dependencies:
uv syncConfigure Claude Code: The project includes a
.mcp.jsonfile that configures the MCP server for local development:{ "mcpServers": { "mousetail": { "type": "stdio", "command": "uv", "args": ["run", "python", "-m", "mousetail.mcp.stdio_server"], "env": { "PYTHONUNBUFFERED": "1" } } } }Restart Claude Code: After the configuration is in place, restart Claude Code to load the MCP server.
Verify the server:
Use
/contextin Claude Code to see available MCP toolsThe mousetail server should appear with all available tools (list_collections, create_note, sync_collection, etc.)
Testing sync functionality:
Close the Anki desktop application before testing
Test credential management:
save_sync_credentials,load_sync_credentials,delete_sync_credentialsTest sync:
sync_collectionwith your AnkiWeb credentials or self-hosted server
Core goals
Mousetail was written because all the existing MCP Anki tools depend on the AnkiConnect addon.
AnkiConnect is a HTTP server for Anki, it was originally created to support connecting browser extensions like yomichan to Anki. For MCP development, it is not necessary and introduces issues:
introduces complexity e.g. a dedicated HTTP server for Anki occupies a port
introduces risk e.g. if the AnkiConnect API changes or has a bug the MCP tool will break
introduces an extra step e.g. all current MCP tools require installing the AnkiConnect addon
Mousetail has a much simpler approach. It integrates directly with Anki's pylib. This is a stable API that's part of Anki's core, it therefore is not subject to arbitrary or frequent change, and does not require any 3rd-party addons.
Because it prioritizes simplicity, mousetail will remain more stable than the alternatives. The tradeoff is that Mousetail will never integrate with the Anki UI. It is also reasonable to assume that Mousetail will only ever work with colocated (same system) LLM tools and Anki decks.
Building Documentation
The project uses Sphinx with the Furo theme to generate documentation from Python docstrings.
Install documentation dependencies:
uv pip install ".[docs]"Build the documentation:
uv run python -m sphinx -b html docs docs/_build/htmlView the documentation: Open
docs/_build/html/index.htmlin your browser.
The documentation is automatically built and deployed to GitHub Pages on every push to the main branch.
License
MIT License - see LICENSE file for details.
Available Tools
13 toolscreate_deckB
Create a new deck in the collection
Inputs: deck_name (required), collection_path.
create_noteA
Create a new note (flashcard) in Anki. A note generates one or more cards based on the note type template.
Inputs: deck_name (required), note_type_name (required), fields (required), tags, +1 more.
delete_sync_credentialsB
Delete saved sync credentials from system keychain
Inputs: no named parameters.
get_collection_infoA
Get information about an Anki collection (name, card count, note count)
Inputs: collection_path.
get_noteA
Get detailed information about a specific note by ID
Inputs: note_id (required), collection_path.
list_collectionsB
List all available Anki collections on the system
Inputs: no named parameters.
list_decksB
List all decks in the collection with their names and IDs
Inputs: collection_path.
list_note_typesB
List all note types (card templates) available in the collection
Inputs: collection_path.
load_sync_credentialsA
Load saved sync credentials from system keychain
Inputs: no named parameters.
save_sync_credentialsB
Save sync credentials securely to system keychain (macOS Keychain, Windows Credential Manager, or Linux Secret Service)
Inputs: username (required), password (required), endpoint.
search_notesB
Search for notes using Anki search syntax. Examples: 'deck:MyDeck', 'tag:important', 'front:python'
Inputs: query (required), limit, collection_path.
sync_collectionA
Synchronize Anki collection with AnkiWeb or a self-hosted sync server. Uploads local changes and downloads remote changes. By default syncs both collection data and media files.
Inputs: username, password, endpoint, sync_media, +1 more.
update_noteB
Update an existing note's fields and/or tags
Inputs: note_id (required), fields, tags, collection_path.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Each tool targets a distinct entity or action (deck, note, collection, sync, credentials, note types). No two tools have overlapping purposes; listing tools are clearly differentiated by entity.
All tool names follow a consistent verb_noun pattern in snake_case, e.g., create_deck, get_note, sync_collection. No mixing of styles or ambiguous verbs.
13 tools is well-scoped for Anki management, covering deck, note, collection, sync, and credential operations without unnecessary bloat.
Missing delete operations for notes and decks, and no update_deck. These are significant gaps for a CRUD-oriented flashcard server, potentially causing agent failures when trying to remove content.
Maintenance
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants to seamlessly manage Anki flashcards, decks, and templates through the AnkiConnect API. It supports intelligent querying, batch note creation, and detailed study progress analysis using natural language.4MIT
- AlicenseAqualityCmaintenanceMCP stdio server for controlling local Anki via AnkiConnect. Enables LLMs to manage Anki decks and notes through a standardized tool interface.119 npmMIT
- AlicenseAqualityDmaintenanceMCP server for Anki via AnkiConnect, enabling creation, search, and management of flashcards directly from Claude Code or any MCP client.11MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server that integrates with Anki flashcard application, allowing LLM applications like Claude to interact with your Anki decks and cards.11430 npm1MIT