Install Anki MCP for Cursor, Cline & MCP Clients
This guide is for Cursor IDE, Cline, and other MCP clients that support STDIO. If you use Claude Desktop, see the Desktop Installation Guide instead.
What You Need
Install these first:
Anki Desktop - Your flashcard app Download: apps.ankiweb.net
AnkiConnect Plugin - Lets other apps talk to Anki Download: ankiweb.net/shared/info/2055492159
An MCP Client - Choose one:
- Cursor IDE - AI-powered code editor
- Cline - VS Code extension
Basic Configuration
All MCP clients use a similar configuration format. Choose one of the methods below:
Method 1: Using npx (recommended - no installation needed)
Add this to your client’s MCP configuration file:
{
"mcpServers": {
"anki-mcp": {
"command": "npx",
"args": ["-y", "@ankimcp/anki-mcp-server", "--stdio"],
"env": {
"ANKI_CONNECT_URL": "http://localhost:8765"
}
}
}
}Method 2: Using global installation
First, install the package globally:
npm install -g @ankimcp/anki-mcp-serverThen add this to your client’s MCP configuration file:
{
"mcpServers": {
"anki-mcp": {
"command": "anki-mcp-server",
"args": ["--stdio"],
"env": {
"ANKI_CONNECT_URL": "http://localhost:8765"
}
}
}
}Client-Specific Setup
Cursor IDE
Configuration File Location:
- macOS/Linux:
~/.cursor/mcp.json - Windows:
%USERPROFILE%\.cursor\mcp.json
Steps:
- Create or edit the configuration file
- Add the basic configuration from above
- Save and restart Cursor IDE
Cline (VS Code Extension)
Configuration:
Cline has a built-in settings UI for managing MCP servers:
- Open VS Code
- Open Cline extension
- Click “Configure MCP Servers”
- Add the basic configuration from above
- Save and restart VS Code
Alternative: Edit cline_mcp_settings.json directly with the basic configuration.
Windows users: If you encounter spawn npx ENOENT errors, use "command": "cmd" with "args": ["/c", "npx", "-y", "@ankimcp/anki-mcp-server", "--stdio"]
Try It Out
After configuration, restart your MCP client and try:
Create a flashcard:
You: "Create an Anki flashcard with 'What is MCP?' on the front and
'Model Context Protocol - a standard for AI assistants to connect to
external tools' on the back"List your decks:
You: "Show me my Anki decks"Start a review session:
You: "Let's review my Spanish deck"Troubleshooting
“Command not found: npx”
Install Node.js from nodejs.org. The npm package manager (which includes npx) comes with Node.js.
“Cannot connect to AnkiConnect”
- Make sure Anki is running
- Verify AnkiConnect plugin is installed (Tools → Add-ons)
- Check that AnkiConnect is using port 8765 (default)
- If using a different port, update the
ANKI_CONNECT_URLin your configuration
“spawn npx ENOENT” (Windows + Cline)
This is a common Windows issue. Use the Windows-specific configuration with cmd /c:
{
"mcpServers": {
"anki-mcp": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@ankimcp/anki-mcp-server", "--stdio"]
}
}
}Server not appearing in client
- Check that your configuration JSON is valid (no trailing commas, proper quotes)
- Restart your MCP client after configuration changes
- Check client logs for error messages
Advanced Configuration
Custom AnkiConnect URL
If your AnkiConnect runs on a different port or computer:
{
"mcpServers": {
"anki-mcp": {
"command": "npx",
"args": ["-y", "@ankimcp/anki-mcp-server", "--stdio"],
"env": {
"ANKI_CONNECT_URL": "http://192.168.1.100:8765"
}
}
}
}Need Help?
- GitHub Discussions - Ask questions and share tips
- Discord Server - Chat with the community
- Email Support - Direct support
Happy learning! 📚