mcpField
A
Anki MCP

Anki MCP

Local
github.comScience & Education0Updated 2d ago

About Anki MCP

Anki MCP connects an MCP client to Anki Desktop through AnkiConnect, letting users manage study materials from an AI chat app. It supports note and deck operations, card previews, media, and deck packages.

Key features

  1. 01Search, create, and edit notes
  2. 02Manage decks and cards
  3. 03Preview card HTML and CSS
  4. 04Work with media files
  5. 05Import and export .apkg packages

Use cases

  1. 01Find notes by text or tags
  2. 02Draft vocabulary notes for a deck
  3. 03Inspect card content before changes
  4. 04Preview deck exports

MCP support

The local stdio MCP server exposes AnkiConnect-backed tools to MCP clients for working with Anki Desktop. Anki Desktop must be running with AnkiConnect enabled.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"ryhus-anki": {
"command": "npx",
"args": [
"-y",
"@ryhus/anki-mcp"
],
"env": {
"ANKI_URL": "<ANKI_URL>",
"ANKI_API_MODE": "<ANKI_API_MODE>",
"ANKI_REQUEST_TIMEOUT_MS": "<ANKI_REQUEST_TIMEOUT_MS>",
"ANKI_MEDIA_IMPORT_DIRS": "<ANKI_MEDIA_IMPORT_DIRS>",
"ANKI_PACKAGE_IMPORT_DIR": "<ANKI_PACKAGE_IMPORT_DIR>",
"ANKI_PACKAGE_EXPORT_DIR": "<ANKI_PACKAGE_EXPORT_DIR>"
}
}
}
}
Run commandnpx -y @ryhus/anki-mcp
Environment variables to set
ANKI_URLAnkiConnect base URL on your computer. Keep Anki Desktop open; omit /api/v1.
ANKI_API_MODEUse v1 for the full tool set with compatible AnkiConnect, or legacy for older add-ons.
ANKI_REQUEST_TIMEOUT_MSRequest deadline in integer milliseconds, including queue wait: 1 to 300000.
ANKI_MEDIA_IMPORT_DIRSOptional trusted local media folders. Separate with : on macOS/Linux or ; on Windows.
ANKI_PACKAGE_IMPORT_DIROptional existing absolute folder for local .apkg imports. Requires API v1.
ANKI_PACKAGE_EXPORT_DIROptional existing absolute folder for local .apkg exports. Requires API v1.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@ryhus/anki-mcp0.1.1

Tools

73

Saved tool list · updated 2d ago

This tool takes no parameters.

Details

From the project README

Anki MCP

Use Anki Desktop from your AI chat app. Search, create, and edit notes; manage decks and cards; preview card HTML/CSS; and work with media and .apkg deck packages.

Your MCP client is the app you chat with, not Anki Desktop. It needs to support launching local MCP servers (also called stdio servers). It starts Anki MCP so your assistant can use the Anki tools.

Quick start

  1. Install Node.js 24 or newer with npm.
  2. In Anki Desktop, install AnkiConnect via Tools → Add-ons → Get Add-ons with code 2055492159. Restart Anki and keep it open.
  3. Add the server configuration below in your MCP client's settings. No clone or global install is needed.
{
  "mcpServers": {
    "anki": {
      "command": "npx",
      "args": ["--yes", "--prefer-online", "--package=@ryhus/anki-mcp@latest", "anki-mcp"],
      "env": {
        "ANKI_URL": "http://127.0.0.1:8765",
        "ANKI_API_MODE": "v1"
      }
    }
  }
}

If your client has a form, put only npx in Command, enter the four Arguments separately, and add the two Environment variables shown above. ANKI_URL is the AnkiConnect address, not a remote MCP URL.

Reload the client and ask: “List my Anki decks without changing anything.”

@latest checks for the current release when the server starts; it does not update a running server. To control updates yourself, replace @latest with an exact published version, for example @0.1.0.

Try it

  • “Find German notes tagged a1 that mention Haus.”
  • “Draft three vocabulary notes for my German deck. Show me the drafts before creating them.”
  • “Show me the front and back HTML of this card without changing it.”
  • “Preview an export of my German deck without review history.”

Settings

  • ANKI_API_MODE=v1 enables the full tool set with a compatible AnkiConnect build. For an older add-on, use legacy for the supported subset.
  • To enable local .apkg import or export, set ANKI_PACKAGE_IMPORT_DIR or ANKI_PACKAGE_EXPORT_DIR to an existing, trusted absolute folder. Each is enabled separately and requires local AnkiConnect v1.
  • To import media from disk, allowlist its source folder with ANKI_MEDIA_IMPORT_DIRS. Public HTTPS and base64 sources do not need this setting.

Review previews before approving destructive changes. Not every tool offers a preview. The server does not make backups or automatically retry writes; after an error, check Anki before repeating the action.

Troubleshooting

  • The client cannot find npx: make sure both Node and npm are on the client's PATH. On Windows, use npx.cmd if your client needs the shim.
  • Anki is unreachable: check that Anki is open and AnkiConnect is enabled. Use the base address in ANKI_URL without /api/v1.
  • The package is not found: check that the requested version has been published and that your client can reach the npm registry.

MIT License.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.