Get the FREE Ultimate OpenClaw Setup Guide →

anki

MCP server for Anki via AnkiConnect

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio nailuogg-anki-mcp-server npx --yes anki-mcp-server

How to use

This MCP server provides an interface for LLMs to interact with Anki via the AnkiConnect API. It exposes tools for deck and note management, including listing decks, creating decks and notes (Basic or Cloze), batch note creation, searching notes, retrieving note information, updating and deleting notes, and inspecting or creating note types. These tools enable programmatic manipulation of Anki content from a language model, with the server acting as a bridge between MCP protocol messages and AnkiConnect requests. You can use the server through Claude Desktop or other MCP clients by pointing your client configuration at the anki MCP server and invoking the available tool commands.

To use it, configure the MCP server in your client (e.g., Claude Desktop or another MCP consumer) to run the Anki MCP server via npx with the provided package name. You can connect to the default AnkiConnect port (typically 8765) or specify a custom port if your AnkiConnect instance runs elsewhere. The suite of tools lets you list decks, create or modify notes, search content, and fetch note details, enabling rich interactions with your Anki collection from LLM-driven workflows.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Anki installed with the AnkiConnect add-on configured and running (default port 8765)
  • Internet access to install the MCP server package

Installation steps:

  1. Install dependencies and build (if applicable):
npm install
  1. Build the server (if the project uses a build step):
npm run build
  1. Run the MCP server via npx (as shown in the configuration):
npx --yes anki-mcp-server
  1. Optional: pack as a Desktop Extension package for Claude Desktop usage as described in the repository (produces a .mcpb file):
npm run pack
  1. If you need a custom AnkiConnect port, launch the server with the port flag (as shown below in the examples) and ensure AnkiConnect is listening on that port.

Notes:

  • Ensure AnkiConnect is installed in Anki and accessible from the machine running the MCP server.
  • When testing locally, you can validate MCP configuration with your client’s built-in tooling or the MCP inspection utilities.

Additional notes

Tips and notes:

  • Custom port: If AnkiConnect uses a non-default port, start the MCP server with the --port option to match (for example, --port 8080) and update your client configuration accordingly.
  • Environment variables: The server typically runs with default settings; if needed, set NODE_ENV or other runtime vars as required by your deployment environment.
  • Debugging: Use the MCP Inspector tool to monitor messages and interactions between the MCP server and clients when troubleshooting tool invocations or AnkiConnect errors.
  • Compatibility: Ensure the AnkiConnect add-on version you are using is compatible with the Anki version installed.
  • Deployment: For Claude Desktop, packaging as a .mcpb bundle simplifies installation; you can host the server via npx during development and switch to packaged deployments for distribution.

Related MCP Servers

Sponsor this space

Reach thousands of developers