The Anki MCP server provides comprehensive AI-driven integration with Anki flashcards, enabling natural language interaction for enhanced learning and management.
Interactive Learning & Review: Quiz on specific cards, simulate answering with ease ratings, query due or suspended cards, and manage card states (suspend, unsuspend, forget, relearn) through conversational commands.
Smart Content Creation: Generate flashcards from text, create cloze deletion cards, convert lecture notes into study materials, and import external files directly into Anki with custom fields and tags.
Advanced Analytics: Access detailed performance metrics including retention rates, ease factors, review intervals, study patterns, and daily statistics to identify weak areas and track learning progress.
Efficient Bulk Operations: Perform complex search queries using Anki's syntax, execute multiple actions atomically, manage thousands of cards simultaneously, and handle tagging, moving, and duplicate detection at scale.
Comprehensive Management: Create, rename, and delete decks; customize note types and templates with CSS styling; manage media files (images, audio); configure deck settings and learning parameters; and handle profile management, synchronization, and database operations.
GUI Integration: Interact with Anki's interface programmatically for browsing, editing, and advanced database operations while maintaining real-time synchronization.
Provides full access to Anki flashcards through AnkiConnect, enabling deck management, card operations, note management, and statistics retrieval. Allows creating, updating, and organizing flashcards, running quizzes, and analyzing study performance.
🧠 Anki MCP
Transform your Anki flashcard experience with AI! This MCP (Model Context Protocol) server bridges your Anki flashcard collection with AI assistants like Claude, enabling natural conversations about your study materials.
🚀 What Can You Do?
Imagine having an AI tutor that knows your entire flashcard collection and can:
📚 Interactive Learning
"Quiz me on Japanese vocabulary I haven't seen in 3 days"
"Test me on challenging cards from my medical deck"
"Show me cards I've been struggling with recently"
✨ Smart Content Creation
"Create flashcards about photosynthesis with diagrams"
"Turn this PDF chapter into spaced repetition cards"
"Generate cloze deletion cards from my lecture notes"
🔍 Powerful Analytics
"Which topics am I struggling with most?"
"Show me my study patterns for the last month"
"What's my retention rate for different card types?"
🎯 Bulk Operations
"Tag all my chemistry cards with 'exam-prep'"
"Move cards with low retention to an intensive review deck"
"Find and fix duplicate cards across my decks"
🎯 Features
Full Anki Integration: Complete access to decks, cards, notes, and statistics via all 115 AnkiConnect API methods
Conversational Interface: Natural language commands through your AI assistant
Bulk Operations: Efficiently manage thousands of cards at once
Real-time Statistics: Get insights into your learning progress
Media Support: Handle images, audio, and other media in your cards
Advanced Querying: Find cards using complex search criteria
Type Safety: Fully typed API with comprehensive error handling
🛠 Technical Stack
Node.js: Runtime environment (18+ required)
TypeScript: Type safety and developer experience
MCP SDK: Model Context Protocol implementation
yanki-connect: 🙏 Fully-typed, isomorphic AnkiConnect API client
tsup: Fast TypeScript bundler
PNPM: Efficient package manager
Special thanks to the
📋 Prerequisites
1. Install Anki
Download and install Anki if you haven't already.
2. Install AnkiConnect Plugin
Open Anki
Go to Tools → Add-ons
Click Get Add-ons...
Enter code:
2055492159
Restart Anki
📋 Version Requirements: This server requires AnkiConnect version 25.2.25.0 or newer (released 2025-02-25) for full compatibility. Most features work with older versions, but we recommend updating for the best experience.
3. Configure AnkiConnect (Optional)
AnkiConnect works out of the box, but you can customize settings:
Go to Tools → Add-ons
Select AnkiConnect and click Config
Default settings should work fine for most users
🚀 Quick Start
Option 1: Use with Claude Desktop (Recommended)
Install the package
npm install -g @arielbk/anki-mcpConfigure Claude Desktop
Edit your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Windows:%APPDATA%\Claude\claude_desktop_config.json
Add this configuration:
{ "mcpServers": { "anki": { "command": "anki-mcp", "args": [] } } }Restart Claude Desktop
Start using it!
Make sure Anki is running with AnkiConnect enabled
Ask Claude: "Show me my Anki decks" or "Quiz me with 5 cards"
💡 Pro Tip: You can test your setup by asking Claude simple questions like "How many Anki decks do I have?" or "What's in my largest deck?"
Option 2: Development Setup
Clone the repository
git clone https://github.com/arielbk/anki-mcp.git cd anki-mcpInstall dependencies
pnpm installBuild the project
pnpm buildTest the server
# Use the MCP inspector to test functionality pnpm inspect
Option 3: Use with Other MCP Clients
This server works with any MCP-compatible client. You can also use it with:
MCP Inspector: Interactive debugging tool
Cline: VS Code extension for AI coding
Custom MCP clients: Build your own using the MCP SDK
For stdio transport, run:
🎮 Usage Examples
Once configured with Claude Desktop, you can have natural conversations like:
📖 Study Sessions
📝 Content Creation
📊 Study Analytics
🏷️ Organization
🔧 Available Tools & Resources
This MCP server provides comprehensive access to your Anki collection through these capabilities:
📚 Deck Management
List all decks with statistics
Create new decks
Rename and delete decks
Get deck configuration
🗂️ Card Operations
Find cards by search criteria
Answer cards (simulate reviews)
Get card information and statistics
Suspend/unsuspend cards
Bulk card operations
📝 Note Management
Add new notes with custom fields
Update existing notes
Delete notes
Find notes by search query
Bulk note operations
📊 Statistics & Analytics
Deck statistics and performance metrics
Card ease and interval data
Review history and patterns
Learning progress insights
🎨 Media & Models
Access note types and field definitions
Media file management
Template customization support
🔍 Advanced Features
Complex search queries using Anki's search syntax
Batch operations for efficiency
Real-time synchronization with Anki
Error handling and validation
Organized API methods grouped by functionality (cards, decks, notes, models, statistics, media, etc.)
Direct access to all 115 AnkiConnect API methods with full type safety
🛠 Development
🔧 Configuration
AnkiConnect Settings
The server connects to AnkiConnect on localhost:8765
by default. If you've customized your AnkiConnect configuration, you may need to adjust the connection settings.
Important: Make sure Anki is running and AnkiConnect is installed before using the MCP server. The server will fail to connect if AnkiConnect is not accessible.
💡 Note: The underlying yanki-connect library supports auto-launching Anki on macOS, but this feature is not currently exposed in the MCP server configuration. You'll need to start Anki manually.
Claude Desktop Advanced Configuration
For advanced users, you can pass additional parameters:
Troubleshooting
Common Issues:
"Failed to connect to AnkiConnect": Ensure Anki is running and AnkiConnect plugin is installed
"No decks found": Make sure you have at least one deck in Anki
Claude doesn't respond: Restart Claude Desktop after configuration changes
Permission errors: Check that the global npm install worked correctly with
npm list -g @arielbk/anki-mcp
🤝 Contributing
We welcome contributions! Please:
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
📜 License
MIT - see LICENSE file for details.
🙏 Acknowledgments
yanki-connect - Excellent TypeScript client for AnkiConnect
AnkiConnect - The plugin that makes Anki automation possible
Model Context Protocol - Enabling seamless AI integrations
Transform your flashcard experience with AI-powered conversations! 🚀
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
Anki MCP
Related MCP Servers
- MIT License
- MIT License
- MIT License
- MIT License