Skip to main content

Standalone MCP server that enables LLMs like Claude to interact with Anki flashcard collections using Anki's Python library

Project description

Mousetail Logo

The simplest and most stable MCP Server for Anki

UV Python 3.10+ MCP License: MIT

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 mousetail

For detailed instructions on integrating with Claude Code, Claude Desktop, and other LLM tools:

Usage Guide

API Reference

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

Use Cases

Selectively commit what you learn in conversation with an LLM to memory

"Create a deck based on our conversation"

Use an LLM to interact with your deck

"Work through the algebra deck with me"

Prompt an LLM to periodically quiz you.

"Every 10 prompts, ignore my prompts until i have worked through 5 cards"

Important Notes

How Collections Are Accessed

The MCP server finds Anki collections at their standard locations:

  • macOS: ~/Library/Application Support/Anki2/[Profile]/collection.anki2
  • Linux: ~/.local/share/Anki2/[Profile]/collection.anki2
  • Windows: %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

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.

  1. Install documentation dependencies:

    uv pip install ".[docs]"
    
  2. Build the documentation:

    uv run python -m sphinx -b html docs docs/_build/html
    
  3. View the documentation: Open docs/_build/html/index.html in 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mousetail-0.1.2.tar.gz (325.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mousetail-0.1.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file mousetail-0.1.2.tar.gz.

File metadata

  • Download URL: mousetail-0.1.2.tar.gz
  • Upload date:
  • Size: 325.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mousetail-0.1.2.tar.gz
Algorithm Hash digest
SHA256 49a2cb29dc00f5f584e4bd05539d38f364a4a5ef2afec11b09b10de6eadee6c9
MD5 3f50484b76036e0b3893a1a4515390aa
BLAKE2b-256 b310f707e762bef800e160df35b455755b5b3efe46ad345ce29c6e92224ca893

See more details on using hashes here.

Provenance

The following attestation bundles were made for mousetail-0.1.2.tar.gz:

Publisher: publish.yml on listfold/mousetail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mousetail-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mousetail-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mousetail-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bdcf5b96efd0321725aaac56b92f94ecd0e58e6a24f632387dd620a2e9d2fba8
MD5 41dda8206c4fb90f7a4b4f92f52b234d
BLAKE2b-256 fe9034472363d43a819beb3d31612e6f13f91fa1b1cf4a4bd0ebc683f9f21e92

See more details on using hashes here.

Provenance

The following attestation bundles were made for mousetail-0.1.2-py3-none-any.whl:

Publisher: publish.yml on listfold/mousetail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page