Standalone MCP server that enables LLMs like Claude to interact with Anki flashcard collections using Anki's Python library
Project description
The simplest and most stable Anki MCP Server.
Selectively commit what you learn in conversation with an LLM to memory using Anki - a flashcard learning system.
Features
- Supports a minimal set of core anki operations, (CRUD & search flashcards and collections).
- Zero dependencies, works directly with anki's fairly stable pylib api.
- Doesn't require any addons, works with a basic anki installation.
- Good documentation.
Installation
Prerequisites
- Python 3.10 or higher
- UV package manager (recommended) or pip
- Anki 2.1.50+ installed.
- Note: Anki application should be closed when using the MCP server.
Usage
Claude Code (CLI)
-
Add the MCP server with user scope (available globally):
claude mcp add --transport stdio --scope user anki -- uvx mousetail
Flags explained:
--transport stdio: Specifies stdio communication--scope user: Makes the server available in all Claude Code sessions (not just current project)anki: The name you want to give this MCP server--: Separates Claude Code flags from the server commanduvx mousetail: Runs the mousetail package from PyPI using uvx
-
Verify it's configured:
claude mcp list
-
Start using it in any Claude Code session:
"List my Anki decks" "Create a flashcard in my Spanish deck"
That's it! Claude Code will now have access to your Anki collections across all sessions.
Note: If you prefer to use pip instead of uvx, you can install with pip install mousetail and then add the server with:
claude mcp add --transport stdio --scope user anki -- python -m mousetail.mcp.stdio_server
Claude Desktop (GUI App)
For the Claude Desktop application:
-
Edit your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
-
Add the MCP server configuration:
{ "mcpServers": { "anki": { "command": "uvx", "args": ["mousetail"] } } }
-
Restart Claude Desktop
Close and reopen Claude Desktop for the changes to take effect.
-
Start Using!
You can now ask Claude to interact with your Anki:
"List my Anki decks" "Create a flashcard in my Spanish deck with 'Hola' on the front and 'Hello' on the back" "Search for all cards in my Physics deck that are tagged 'formulas'"
Important Notes
Anki Must Be Closed
The MCP server and Anki application both access the same SQLite database files directly. Because SQLite uses file-based locking, you must close Anki before using the MCP server. Attempting to use both simultaneously will result in "Collection is locked" errors.
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.
Configuration
Edit config.json to customize settings:
{
"collection": {
"auto_open_default": true,
"default_path": null
},
"logging": {
"level": "INFO",
"file": null
}
}
Development
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/html
-
View the documentation:
open docs/_build/html/index.html # macOS xdg-open docs/_build/html/index.html # Linux start docs/_build/html/index.html # Windows
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.
Acknowledgments
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mousetail-0.1.1.tar.gz.
File metadata
- Download URL: mousetail-0.1.1.tar.gz
- Upload date:
- Size: 97.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
988db455cdde2f87d04642c3b4d61410710924f53ecded2c4ec01c2e630fda8a
|
|
| MD5 |
ac7272374dbcc536be253306332bf25b
|
|
| BLAKE2b-256 |
f8460639077fb5d75509f6b6cc9e934696690f9c76c1fe1cd5635fd49eb71c6f
|
Provenance
The following attestation bundles were made for mousetail-0.1.1.tar.gz:
Publisher:
publish.yml on listfold/mousetail
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mousetail-0.1.1.tar.gz -
Subject digest:
988db455cdde2f87d04642c3b4d61410710924f53ecded2c4ec01c2e630fda8a - Sigstore transparency entry: 689152611
- Sigstore integration time:
-
Permalink:
listfold/mousetail@37c6351ea1a1a2eddb1a3e48bbf61e65045db939 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/listfold
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@37c6351ea1a1a2eddb1a3e48bbf61e65045db939 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mousetail-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mousetail-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c04fe44f7a8f109d65000420594f5d97f8e1415eadb0412a6a8f005ec3b9418f
|
|
| MD5 |
2c14ee9131551d8f9b7ed8838e622d2b
|
|
| BLAKE2b-256 |
f4cfea3fe9bb624060bd68bf349df3c3bf65615c533732e6003555a35187576b
|
Provenance
The following attestation bundles were made for mousetail-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on listfold/mousetail
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mousetail-0.1.1-py3-none-any.whl -
Subject digest:
c04fe44f7a8f109d65000420594f5d97f8e1415eadb0412a6a8f005ec3b9418f - Sigstore transparency entry: 689152666
- Sigstore integration time:
-
Permalink:
listfold/mousetail@37c6351ea1a1a2eddb1a3e48bbf61e65045db939 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/listfold
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@37c6351ea1a1a2eddb1a3e48bbf61e65045db939 -
Trigger Event:
workflow_dispatch
-
Statement type: