
Anki Mcp
io.github.arielbk由 GitHub 账号 arielbk 发布v0.3.2更新于 Oct 24, 2026
MCP server for integrating with Anki flashcards through conversational AI
概览
本地 MCP 服务器,通过 AnkiConnect 把 AI 助手连接到你的 Anki 卡片库,用于测验、制卡、整理和学习分析。
- 可以做什么
- 创建、更新、删除和搜索卡片,支持批量修改与打标签
- 开展互动测验、管理卡片排程并找出待复习卡片
- 创建和整理牌组、在牌组间移动卡片并调整牌组设置
- 读取学习统计、复习历史与记忆保持情况
- 自定义笔记类型、字段、模板和卡片样式
- 处理同步、媒体文件、导入导出,并取回卡片中的图片或音频
- 适用场景
- 适合用 Anki 学习、希望助手针对指定牌组或卡片出题测验、根据笔记或文档生成新卡片、批量打标签或重新整理卡片,或汇报学习规律与薄弱环节的场景。
- 运行要求
- 以 npm 包形式在桌面本地运行,需要 Node.js 18 或更高版本。需安装并运行 Anki,并装好 AnkiConnect 插件(建议 25.2.25.0 或更新版本);默认连接 localhost:8765,可通过 ANKI_CONNECT_HOST 和 ANKI_CONNECT_PORT 调整。Anki 需手动启动。
安装
在 SourceWeft 中
- 打开 控制台中的 Anki Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
🧠 Anki MCP
[NPM Package anki-mcp]
[License: MIT]
[Anki MCP server]
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
- 🎯 Smart Tool Design: Intuitive, high-level tools designed specifically for AI agents
- 💬 Natural Conversations: Talk to Claude about your flashcards like you would a study buddy
- ⚡ Lightning Fast: Efficient operations that don't bog down your AI assistant
- 📦 Bulk Operations: Update thousands of cards at once with simple commands
- 📊 Study Insights: Deep analytics on your learning progress and patterns
- 🎨 Rich Media: Full support for images, audio, and other media in your cards
- 🔍 Powerful Search: Leverage Anki's advanced search syntax through natural language
- 🔒 Rock Solid: Fully typed TypeScript 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 yanki-connect library for providing the robust AnkiConnect interface that powers this integration!
📋 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
-
Configure Claude Desktop
Edit your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:%APPDATA%\Claude\claude_desktop_config.jsonAdd this configuration:
-
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
-
Install dependencies
-
Build the project
-
Test the server
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:
For localhost HTTP (Streamable HTTP) transport, run:
Clients that support Streamable HTTP can connect directly. Legacy SSE clients may still work via client-side fallback.
🎮 Usage Examples
Once configured with Claude Desktop, you can have natural conversations like:
📖 Study Sessions
📝 Content Creation
📊 Study Analytics
🏷️ Organization
🔧 Available Tools
The server provides 7 intuitive tools that cover everything you need:
📝 Manage Flashcards
Create, update, delete, and search your flashcards. Perfect for content creation, bulk updates, and organization.
🎯 Study Sessions
Run interactive quiz sessions, manage card scheduling, and track which cards need review.
📚 Manage Decks
Create and organize decks, move cards around, and configure deck settings.
📊 Get Analytics
Dive into your study statistics, review history, and learning patterns.
🎨 Manage Models
Customize note types, add fields, modify templates, and style your cards.
🔧 Anki Operations
Handle sync, media files, imports/exports, and other utility operations.
🖼️ Get Media File
Retrieve media files (images, audio, etc.) from your Anki collection. AI assistants can analyze images directly (though they won't display in the UI).
💡 Pro Tip: Many operations support pagination to prevent overwhelming your context window. Use
limitandoffsetparameters when working with large result sets.
🛠 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! 🚀
来源:README.md,提交 de77ac5
工具
0版本历史
1- v0.3.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分