Get the FREE Ultimate OpenClaw Setup Guide →

anki

A Model Context Protocol (MCP) server that enables AI assistants to interact with Anki, the spaced repetition flashcard application.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ankimcp-anki-mcp-server npx -y @ankimcp/anki-mcp-server --stdio \
  --env ANKI_CONNECT_URL="http://localhost:8765"

How to use

This MCP server bridges Anki with AI assistants using the Model Context Protocol, allowing natural language interactions to manage Anki notes, decks, media, and more. It exposes a set of tools and commands such as sync, get_due_cards, present_card, rate_card, and various deck, note, and media management endpoints. Run the server in STDIO mode with a local MCP client (for Claude Desktop, Cursor IDE, Cline, or Zed Editor) to enable seamless conversational control over your Anki space. By default it connects to AnkiConnect at http://localhost:8765, so ensure Anki and AnkiConnect are running and reachable. You can also run the HTTP mode for remote AI assistants, enabling secure tunneling and public access when needed.

How to install

Prerequisites:

  • Node.js 20.x or newer installed
  • Anki with AnkiConnect plugin running and accessible at the configured URL (default http://localhost:8765)

Option A: Quick start via npx (no local installation)

  1. Ensure Node.js is installed
  2. Run the MCP server in STDIO mode using npx:
npx -y @ankimcp/anki-mcp-server --stdio
  1. If prompted or required, set the AnkiConnect URL via environment variable:
ANKI_CONNECT_URL=http://localhost:8765 npx -y @ankimcp/anki-mcp-server --stdio

Option B: Install locally or via npm (persistent installation)

  1. Install the package locally in your project:
npm install @ankimcp/anki-mcp-server
  1. Run the server (STDIO mode) using the installed binary:
npx @ankimcp/anki-mcp-server --stdio
  1. To configure a persistent environment variable for AnkiConnect:
export ANKI_CONNECT_URL=http://localhost:8765
npx @ankimcp/anki-mcp-server --stdio

Option C: Run in HTTP mode (for remote AI assistants)

  1. Start the server in HTTP mode (example):
npx @ankimcp/anki-mcp-server --port 8080 --host 0.0.0.0
  1. If you need a public tunnel, use the built-in ngrok support as described in the project docs.

Additional notes

Tips and caveats:

  • Ensure AnkiConnect is running and reachable from the MCP server; the default URL is http://localhost:8765 unless overridden via ANKI_CONNECT_URL.
  • When using STDIO mode, your MCP client (Cursor IDE, Cline, Zed, etc.) should be configured to connect via STDIO transport as shown in the README examples.
  • For remote usage, HTTP mode supports --ngrok to create a public tunnel; use this with caution to expose your local Anki data.
  • If you upgrade from the old package name (anki-mcp-http), migrate configuration to @ankimcp/anki-mcp-server as per the changelog.
  • The MCP server supports a variety of commands under Review & Study, Deck Management, Note Management, and Media Management; consult the docs for exact payload formats and responses.
  • If you customize ANKI_CONNECT_URL, ensure your network allows connections to that endpoint from the MCP server process.

Related MCP Servers

Sponsor this space

Reach thousands of developers