Skip to content

How to Connect Cursor, Cline & Other MCP Clients to Anki

Connect Cursor, Cline, or Zed to Anki so your AI coding assistant can read your decks and build cards for you. Add the AnkiMCP server to your client’s config, keep Anki open, and you’re done. No cloud, no account.

Two ways to connect: the add-on (HTTP, recommended) or the CLI (STDIO). The add-on is simplest and most capable. Use the CLI only if your client needs STDIO.

MCP (Model Context Protocol) is the open standard that lets AI assistants talk to tools like Anki.

Install the AnkiMCP add-on, then point your client at its local web address. The add-on runs a server inside Anki, so you skip Node.js and any extra add-on.

The add-on runs a local HTTP server at http://127.0.0.1:3141/. Your client connects to that address. This is the simplest path and gives access to the most Anki features.

What you need

  • Anki 25.07 or newer, open on your computer. Check in Anki → About. Get it from apps.ankiweb.net.
  • The AnkiMCP add-on for Anki, code 124672614. You’ll install it below.
  • A client that supports remote HTTP MCP servers: Cursor, Cline, or Zed.

Time: about 3 minutes.

Step 1: Install the AnkiMCP add-on

The add-on starts a small server inside Anki. It launches on its own every time you open Anki.

  1. Open Anki.
  2. Go to Tools → Add-ons → Get Add-ons…
  3. Enter this code: 124672614
  4. Click OK, then restart Anki.

The server starts at http://127.0.0.1:3141/. You can check its status under Tools → AnkiMCP Server Settings…

Anki's Install Add-on dialog with the AnkiMCP add-on code 124672614 entered in the Code field.

Step 2: Add the server to your client

Each client points at the same address: http://127.0.0.1:3141/. Pick your client below.

Cursor. Create or edit ~/.cursor/mcp.json (macOS/Linux) or %USERPROFILE%\.cursor\mcp.json (Windows). Add the server with its url:

{
  "mcpServers": {
    "anki-mcp": {
      "url": "http://127.0.0.1:3141/"
    }
  }
}

If the file already exists, add only the anki-mcp entry inside the existing mcpServers block.

Cline. In VS Code, open Cline, go to the MCP Servers panel, and use the Remote Servers tab. Enter a name and the URL http://127.0.0.1:3141/, then pick Streamable HTTP. To edit the file directly, set type to streamableHttp:

{
  "mcpServers": {
    "anki-mcp": {
      "url": "http://127.0.0.1:3141/",
      "type": "streamableHttp"
    }
  }
}

Zed. Open Zed’s settings.json and add the server under context_servers (not mcpServers):

{
  "context_servers": {
    "anki-mcp": {
      "url": "http://127.0.0.1:3141/"
    }
  }
}

If your settings already have a context_servers block, add only the anki-mcp entry inside it.

Cursor's mcp.json open in the editor with an AnkiMCP HTTP server entry pointing at localhost port 3141.

Step 3: Restart your client and verify

Quit your client fully, then open it again. With Anki open, ask your assistant: “List my Anki decks.” If it names your decks, the connection works.

Keep Anki open. The server only reaches your cards while the Anki app is running.

Fix common problems

The assistant can’t reach Anki. Make sure Anki is open. Check the server status under Tools → AnkiMCP Server Settings… The server runs at http://127.0.0.1:3141/.

The server doesn’t appear in my client. Check that your config uses the right key: mcpServers for Cursor and Cline, but context_servers for Zed. Then restart your client.

The connection fails or times out. Open http://127.0.0.1:3141/ in your browser to confirm the add-on is running. If it isn’t, restart Anki. Another app may also be using port 3141.

Common questions

Which should I use, the add-on or the CLI? Use the add-on (HTTP). It’s the simplest to install and the most capable, and it needs no Node.js or AnkiConnect. Choose the CLI (STDIO) only if your client needs STDIO.

Do I need both? No. Pick one. The add-on talks to Anki directly; the CLI talks through the AnkiConnect add-on.

Does either one work without Anki open? No. Both need the Anki desktop app open and running. They act on your real collection, so Anki has to be there.

Does my client support remote HTTP servers? Cursor, Cline, and Zed all do. If your client supports only STDIO, use the CLI tab instead.

Next steps


Disclaimer: “Anki” is a registered trademark of Ankitects Pty Ltd. AnkiMCP is an independent, community-built project and is not affiliated with, endorsed by, or sponsored by Ankitects. MCP is an open standard originated by Anthropic; AnkiMCP is likewise not affiliated with or endorsed by Anthropic.