跳到正文
FunCoding

Anki MCP Server

官方 MCP Registry 已收录

MCP server for integrating with Anki flashcards through conversational AI

Star
11
分类
其他
版本
v2.0.0
许可证
MIT
最近提交
2026年11月30日

Anki MCP

npm CI License: MIT Glama score

An MCP server for Anki. Your agent can quiz you, turn your notes into cards, tell you what you keep getting wrong, and tidy up your decks, all against your real collection.

Install

You need Anki running with the AnkiConnect add-on (in Anki: Tools → Add-ons → Get Add-ons…, code 2055492159, then restart Anki), and Node.js 20+.

Then add the server to your agent:

npx add-mcp @arielbk/anki-mcp --name anki -g

add-mcp writes the config for Claude Code, Codex, Cursor, VS Code, Claude Desktop and about 20 other agents. To set it up by hand instead, any MCP client takes this:

{
  "mcpServers": {
    "anki": { "command": "npx", "args": ["-y", "@arielbk/anki-mcp"] }
  }
}

Or with your agent's own CLI:

claude mcp add --scope user anki -- npx -y @arielbk/anki-mcp
codex mcp add anki -- npx -y @arielbk/anki-mcp

Start a new session, then ask "what's due in Anki today?" to check it works.

Things to try

  • "Quiz me on 10 cards from my Japanese deck."
  • "Turn this chapter into cards. Write them to a file first so I can check them."
  • "What have I been getting wrong this week?"
  • "I've got an exam on Friday. Put the cardiology cards first in my new queue."
  • "Pause my Spanish deck for now."
  • "Give my interview prep deck its own limit of 15 new cards a day."

What's in the box

Eight tools, each with a handful of operations:

ToolFor
manage_flashcardsCreate, find, edit, tag and delete notes. Batch import from JSON, CSV or TSV, with a dry run.
manage_schedulingDue cards, answering, suspend/unsuspend, forget, relearn, and the order new cards come in.
manage_decksCreate, rename and delete decks, move cards, today's due counts, per-deck limits, display order.
get_analyticsProgress and review history: deck overviews, trouble cards, reviews per day, forecasts.
manage_modelsNote types: fields, templates, styling.
manage_collectionAnkiWeb sync, .apkg import/export, profiles, media.
get_media_fileRead an image or audio file from your collection.
control_guiDrive the Anki app itself: open the browser, add or edit dialogs, review on screen.

There's also a writing_good_flashcards prompt (card-writing guidelines based on Andy Matuschak's and SuperMemo's advice) and read-only anki:/// resources.

Bulk operations take an Anki search query, so "suspend everything in this deck" is one call however big the deck is, and they support dryRun so you can see what would change first.

The full parameter reference is in docs/tools.md. Upgrading from 1.x? Three tools were renamed; see the notes at the top of that page.

Configuration

VariableDefaultPurpose
ANKI_CONNECT_HOSTlocalhostWhere AnkiConnect is running
ANKI_CONNECT_PORT8765AnkiConnect's port
ALLOWED_HOSTS(none)Comma-separated Host allowlist when serving HTTP on non-loopback addresses

The server uses stdio by default. For Streamable HTTP, run npx @arielbk/anki-mcp --http --host=127.0.0.1 --port=3000 and connect to http://127.0.0.1:3000/mcp. HTTP mode is stateless and rejects requests from other hosts and origins on loopback (DNS rebinding protection). Both the 2026-07-28 protocol revision and the 2025-era initialize handshake are supported.

Troubleshooting

  • "Couldn't reach AnkiConnect": Anki isn't running, or AnkiConnect isn't installed. Start Anki and try again. If a batch import was cut off, its result lists which notes were saved and which to resend.
  • Tools don't show up: most agents only load MCP servers when a session starts, so start a new one.
  • Something works in the Anki app but not here: update AnkiConnect. Some features need version 25.2.25.0 or newer.

Development

pnpm install
pnpm dev        # watch mode
pnpm test       # AnkiConnect is mocked; tests never touch your collection
pnpm typecheck && pnpm lint && pnpm format:check   # what CI runs
pnpm build && pnpm inspect   # try the tools in the MCP Inspector

Issues and PRs are welcome.

Thanks

Built on yanki-connect, a fully typed AnkiConnect client, and of course AnkiConnect itself.

MIT licensed.

同类 MCP Server

官方

Time

Current time lookup and conversion between IANA timezones

MOmodelcontextprotocol/servers92k近 7 天新增 200 个 star

官方

Everything

Reference server that exercises every MCP feature: tools, resources, prompts, sampling and more

MOmodelcontextprotocol/servers92k近 7 天新增 200 个 star

官方

Context7

Up-to-date docs for AI agents

UPupstash/context766k近 7 天新增 359 个 star

Reactive Resume

Free open-source resume builder with remote MCP tools for resumes and job applications.

REreactive-resume/reactive-resume46k近 7 天新增 219 个 star

mcp-server

Puter MCP enables AI tools to interact with Puter: manage files, websites, workers, and more

HEHeyPuter/puter44k近 7 天新增 63 个 star