AnkiConnect

by spacholski1225

Not rated
GitHub

About

AnkiConnect MCP server for interacting with Anki via AnkiConnect.

Details

Author
spacholski1225
Categories
Productivity, Community, Other

Setup

Install AnkiConnect in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/spacholski1225/anki-connect-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

A Model Context Protocol (MCP) server that provides seamless integration with Anki through the AnkiConnect add-on. This server enables AI assistants and other MCP clients to interact with your Anki flashcard collection programmatically.

AnkiConnectis a powerful Anki add-on that exposes Anki's functionality through a REST API. It allows external applications to:

- Create, modify, and delete flashcards
- Manage decks and their configurations
- Control Anki's GUI programmatically
- Search and retrieve card information
- Manage tags and note types
- Perform bulk operations on cards and notes

The Model Context Protocol is a standardized way for AI assistants to connect to external data sources and tools. This MCP server acts as a bridge between MCP clients (like Claude Desktop) and AnkiConnect, allowing AI assistants to help you manage your Anki flashcards naturally through conversation.

This MCP server provides comprehensive access to AnkiConnect functionality through the following tools:

- create_flashcard()- Create new flashcards with front and back content
- add_note()- Add notes with custom fields and tags
- add_notes()- Bulk add multiple notes
- update_note_fields()- Update existing note fields
- find_notes()- Search for notes using Anki's query syntax

- deck_names()- Get all deck names
- deck_names_and_ids()- Get deck names with their IDs
- change_deck()- Move cards between decks
- delete_decks()- Delete decks and optionally their cards
- get_deck_config()- Retrieve deck configuration settings

- find_cards()- Search for cards
- cards_info()- Get detailed card information
- suspend()/unsuspend()- Suspend/unsuspend cards
- are_suspended()/are_due()- Check card status

- gui_deck_browser()- Open deck browser
- gui_deck_review()- Start deck review
- gui_browse()- Open card browser with search
- gui_add_cards()- Open add cards dialog

- version()- Get AnkiConnect version
- get_tags()- Retrieve all tags
- multi()- Execute multiple AnkiConnect requests in batch
- Open Anki
- Go toToolsAdd-ons
- ClickGet Add-ons...
- Enter the code:2055492159
- ClickOKand restart Anki

AnkiConnect works out of the box, but you can customize its settings:
- Go toToolsAdd-ons
- SelectAnkiConnectand clickConfig
- Modify settings if needed (default port is 8765)
- Restart Anki after making changes

git clone https://github.com/spacholski1225/anki-connect-mcp.git cd anki-connect-mcp

To use this MCP server with Claude Desktop, add the following configuration to your MCP settings file:

- Windows:%APPDATA%\Claude\claude_desktop_config.json
- macOS:~/Library/Application Support/Claude/claude_desktop_config.json
- Linux:~/.config/Claude/claude_desktop_config.json

Option 1: Using Node.js (Local Installation)

{ "mcpServers": { "anki-connect-mcp": { "command": "node", "args": [ "dist/index.js" ], "env": {}, "disabled": false, "alwaysAllow": [ "deck_names", "cards_info", "deck_names_and_ids", "gui_deck_browser" ] } } }
{ "mcpServers": { "anki-connect": { "command": "npx", "args": [ "@spacholski1225/anki-connect-mcp" ], "env": {}, "disabled": false, "alwaysAllow": [ "deck_names", "cards_info", "deck_names_and_ids", "gui_deck_browser" ] } } }
{ "mcpServers": { "anki-connect": { "command": "docker", "args": [ "run", "--rm", "-i", "--network=host", "-e", "ANKI_CONNECT_URL=http://host.docker.internal:8765", "spacholski/anki-connect-mcp:latest" ], "env": {}, "disabled": false, "alwaysAllow": [ "deck_names", "cards_info", "deck_names_and_ids", "gui_deck_browser" ] } } }

Docker-Specific AnkiConnect Configuration:

When using the Docker option, youmustconfigure AnkiConnect with specific settings to allow Docker container access:
- Go toToolsAdd-onsin Anki
- SelectAnkiConnectand clickConfig
- Update the configuration with the following settings:

{ "apiKey": null, "apiLogPath": null, "ignoreOriginList": [], "webBindAddress": "0.0.0.0", "webBindPort": 8765, "webCorsOriginList": [ "http://localhost", "http://host.docker.internal", "http://host.docker.internal:3000" ] }

- webBindAddress: "0.0.0.0"- Allows AnkiConnect to accept connections from any IP address (required for Docker containers)
- webCorsOriginList- Must include"http://host.docker.internal"and related origins to allow cross-origin requests from Docker containers
- Restart Anki after making these configuration changes

- For Node.js option: Replace the path inargswith the actual path to your builtindex.jsfile
- For npx option: Uses the published NPM package@spacholski1225/anki-connect-mcp- no local installation required
- For Docker option: Uses the pre-built Docker imagespacholski/anki-connect-mcp:latest
- ThealwaysAllowarray contains tools that won't require confirmation each time
- Make sure Anki is running with AnkiConnect enabled before using the MCP server
- For Docker option, the--network=hostflag allows the container to access AnkiConnect on the host machine

Once configured with an MCP client like Claude Desktop, you can interact with your Anki collection naturally:

- "Create a flashcard about the capital of France"
- "Show me all my deck names"
- "Find all cards tagged with 'vocabulary'"
- "Suspend all cards in the 'Difficult Words' deck"
- "Open the deck browser in Anki"
- Connection refused: Make sure Anki is running and AnkiConnect is installed
- Port conflicts: Check if port 8765 is available or configure AnkiConnect to use a different port
- Permission errors: Ensure the MCP server has proper file system permissions
- Tool not found: Verify the MCP client configuration and restart the client

Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

- AnkiConnect Documentation
-
Model Context Protocol Specification
-
MCP SDK Documentation

An MCP Server Integration with Apple Shortcuts

Add smart Backup ability to coding agents like Windsurf, Cursor, Cluade Coder, etc

This server enables LLMs to use calculator for precise numerical calculations.

A CalDAV MCP server to expose calendar operations as tools for AI assistants.

MCP server for easy access to education data through your Canvas LMS instance.

Tools to the query and execute of Dify workflows

Excel manipulation including data reading/writing, worksheet management, formatting, charts, and pivot table

Access and analyze Fathom Analytics data and reports

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.