Skip to content
Back to search

anki-mcp-server

MCP server for Anki via AnkiConnect

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/nailuoGG/anki-mcp-server with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/nailuoGG/anki-mcp-server'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/nailuogg--anki-mcp-server/badge.svg)](/listings/nailuogg--anki-mcp-server)

HTML

<a href="/listings/nailuogg--anki-mcp-server"><img src="/api/listings/nailuogg--anki-mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

This repository supports Anthropic Desktop Extensions (MCPB). The easiest way to use this server in Claude Desktop is by installing the packaged `.mcpb` bundle.

1. Generate the `.mcpb` file locally using the provided script:

npm run mcpb

2. Open Claude Desktop Settings → Extensions and drag the generated `.mcpb` file in, then click Install.

This validates `manifest.json` and outputs a `.mcpb` archive you can install as above. Learn more about Desktop Extensions in Anthropic's announcement: [Desktop Extensions: One-click MCP server installation for Claude Desktop](https://www.anthropic.com/engineering/desktop-extensions).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 287 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Anki MCP Server
  2. A Model Context Protocol (MCP) server that enables LLMs to interact with Anki flashcard software through AnkiConnect.
  3. ![Anki Icon](./assets/icon.png)
  4. ## Features
  5. ### Tools
  6. - `anki_check_connection` - Check whether AnkiConnect is reachable
  7. - `anki_list_decks` - List all available Anki decks, optionally with deck IDs
  8. - `anki_create_deck` - Create a new Anki deck
  9. - `anki_list_tags` - List all tags currently used in the collection
  10. - `anki_add_note_tags` - Add tags to one or more notes
  11. - `anki_remove_note_tags` - Remove tags from one or more notes
  12. - `anki_create_note` - Create a new note
  13. - `anki_batch_create_notes` - Create multiple notes at once
  14. - `anki_search_notes` - Search for notes using Anki query syntax
  15. - `anki_get_note_info` - Get detailed information about a note
  16. - `anki_update_note` - Update an existing note's fields and/or tags
  17. - `anki_delete_note` - Delete one or multiple notes
  18. - `anki_list_note_types` - List all available note types
  19. - `anki_create_note_type` - Create a new note type
  20. - `anki_get_note_type_info` - Get detailed structure of a note type
  21. - `anki_sync` - Trigger AnkiWeb sync; requires `{"confirm": true}` because a full sync can merge or overwrite local and remote collections. Success means Anki accepted the request, not that AnkiWeb received the data; a blocking dialog in Anki can silently keep the sync queued
  22. Legacy unprefixed tool names such as `create_note` and `list_decks` remain callable for existing clients, but new agent integrations should use the `anki_*` names.
  23. ### Resources
  24. - `anki://decks/all` - Complete list of available decks with deck IDs
  25. - `anki://tags/all` - Complete list of tags
  26. - `anki://note-types/all` - List of all available note types
  27. - `anki://note-types/all-with-schemas` - Detailed structure information for all note types
  28. - `anki://note-types/{modelName}` - Detailed structure information for a specific note type
  29. ## Prerequisites
  30. 1. [Anki](https://apps.ankiweb.net/) installed on your system
  31. 2. [AnkiConnect](https://ankiweb.net/shared/info/2055492159) add-on installed in Anki
  32. 3. Node.js 20.11 or newer
  33. ## Configuration
  34. ### Install via Desktop Extension (.mcpb)
  35. This repository supports Anthropic Desktop Extensions (MCPB). The easiest way to use this server in Claude Desktop is by installing the packaged `.mcpb` bundle.
  36. 1. Generate the `.mcpb` file locally using the provided script:
  37. ```bash
  38. npm run mcpb
  39. ```
  40. 2. Open Claude Desktop Settings → Extensions and drag the generated `.mcpb` file in, then click Install.
  41. This validates `manifest.json` and outputs a `.mcpb` archive you can install as above. Learn more about Desktop Extensions in Anthropic's announcement: [Desktop Extensions: One-click MCP server installation for Claude Desktop](https://www.anthropic.com/engineering/desktop-extensions).
  42. ### Usage with Claude Desktop
  43. Add the server to your claude_desktop_config.json:
  44. ```json
  45. {
  46. "mcpServers": {
  47. "anki": {
  48. "command": "npx",
  49. "args": ["--yes", "anki-mcp-server"]
  50. }
  51. }
  52. }
  53. ```
  54. #### Using Custom AnkiConnect Port
  55. If your AnkiConnect is running on a different port, you can specify it using the `--port` parameter:
  56. ```json
  57. {
  58. "mcpServers": {
  59. "anki": {
  60. "command": "npx",
  61. "args": ["--yes", "anki-mcp-server", "--port", "8080"]
  62. }
  63. }
  64. }
  65. ```
  66. ### Configuration for Cline
  67. Add the server to your Cline MCP settings file inside VSCode's settings `cline_mcp_settings.json`
  68. ```json
  69. {
  70. "mcpServers": {
  71. "anki": {
  72. "command": "npx",
  73. "args": ["--yes", "anki-mcp-server"]
  74. }
  75. }
  76. }
  77. ```
  78. #### Using Custom AnkiConnect Port
  79. For Cline, you can also specify a custom port:
  80. ```json
  81. {
  82. "mcpServers": {
  83. "anki": {
  84. "command": "npx",
  85. "args": ["--yes", "anki-mcp-server", "--port", "8080"]
  86. }
  87. }
  88. }
  89. ```
  90. ## Agent Skills (Claude Code)
  91. Install the Anki skill to give Claude Code built-in knowledge of all Anki tools and workflows:
  92. ```bash
  93. npx skills add nailuoGG/anki-mcp-server@anki
  94. ```
  95. Once installed, Claude Code will automatically use the skill when you ask it to create flashcards, manage decks, or batch import notes.
  96. > **Note:** Do not use the `.mcpb` packaged version as the MCP server — it outputs Electron metadata to stdout which breaks the MCP stdio protocol. Use `npx -y anki-mcp-server` instead.
  97. ## Development
  98. ### Packaging a Desktop Extension (.mcpb)
  99. Create a distributable Desktop Extension bundle for Claude Desktop:
  100. ```bash
  101. npm run mcpb
  102. ```
  103. This will build the project and generate a `.mcpb` archive from the current repository, validating `manifest.json`. Test by dragging it into Claude Desktop's Extensions settings. Reference: [Desktop Extensions: One-click MCP server installation for Claude Desktop](https://www.anthropic.com/engineering/desktop-extensions).
  104. ### Publishing to MCP Registry
  105. This server is automatically published to the MCP Registry when a new version is released. The publishing process includes:
  106. 1. **Automated CI/CD**: GitHub Actions automatically publishes to both NPM and MCP Registry on successful releases
  107. 2. **Schema Validation**: The `server.json` file is validated against the MCP schema before publishing
  108. 3. **Version Synchronization**: Versions are kept in sync between `package.json`, `manifest.json`, and `server.json`
  109. 4. **Comprehensive Testing**: Multi-version Node.js testing, linting, and validation before publishing
  110. 5. **Beta Support**: Automated beta releases for testing new features
  111. #### Manual Validation
  112. You can validate the MCP server configuration locally:
  113. ```bash
  114. npm run validate-mcp
  115. ```
  116. This will download the latest MCP schema and validate your `server.json` file.
  117. #### Manual Publishing
  118. If you need to publish manually, you can use the MCP Publisher CLI:
  119. ```bash
  120. # Install MCP Publisher
  121. curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.1.0/mcp-publisher_1.1.0_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
  122. chmod +x mcp-publisher
  123. sudo mv mcp-publisher /usr/local/bin/
  124. # Login to MCP Registry
  125. mcp-publisher login github-oidc
  126. # Publish to MCP Registry
  127. mcp-publisher publish
  128. ```
  129. ### Setup
  130. 1. Install dependencies:
  131. ```bash
  132. npm install
  133. ```
  134. 2. Build the server:
  135. ```bash
  136. npm run build
  137. ```
  138. 3. For development with auto-rebuild:
  139. ```bash
  140. npm run watch
  141. ```
  142. ### Testing
  143. Run the test suite:
  144. ```bash
  145. npm test
  146. ```
  147. This executes unit tests for MCP tool schemas, structured tool results, note creation, search/update/delete workflows, and error handling. These tests use mocked AnkiConnect clients; use MCP Inspector with a running Anki instance for manual integration checks.
  148. ### MCP Evaluations
  149. Read-only agent evaluation assets live in `evals/`. Load the fixture into a disposable Anki profile, then run the XML questions against the MCP server to verify that agents can discover decks, tags, note type schemas, resources, and structured tool results.
  150. ### Debugging
  151. Since MCP servers communicate over stdio, we recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector):
  152. ```bash
  153. npm run inspector
  154. ```
  155. This provides a browser-based interface for:
  156. - Monitoring MCP messages
  157. - Testing tool invocations
  158. - Viewing server logs
  159. - Debugging communication issues
  160. ## Example Usage
  161. 1. Create a new deck:
  162. ```
  163. Create a new Anki deck called "Programming"
  164. ```
  165. 2. Add a basic card:
  166. ```
  167. Create an Anki card in the "Programming" deck with:
  168. Front: What is a closure in JavaScript?
  169. Back: A closure is the combination of a function and the lexical environment within which that function was declared.
  170. ```
  171. 3. Add a cloze deletion card:
  172. ```
  173. Create a cloze card in the "Programming" deck with:
  174. Text: In JavaScript, {{c1::const}} declares a block-scoped variable that cannot be {{c2::reassigned}}.
  175. ```
  176. 4. Delete a single note:
  177. ```
  178. Delete note ID 1234567890
  179. ```
  180. 5. Delete multiple notes at once:
  181. ```
  182. Delete note IDs 1234567890, 9876543210, and 1122334455
  183. ```
  184. 6. Add tags to notes:
  185. ```
  186. Add tags "review" and "mcp" to note IDs 1234567890 and 9876543210
  187. ```
  188. ## Contributing
  189. 1. Fork the repository
  190. 2. Create your feature branch
  191. 3. Run tests: `npm test`
  192. 4. Submit a pull request
  193. ## Star History
  194. [![Star History Chart](https://api.star-history.com/svg?repos=nailuoGG/anki-mcp-server&type=Date)](https://star-history.com/#nailuoGG/anki-mcp-server&Date)
  195. ## Credits
  196. Icon courtesy of [macOS Icons](https://macosicons.com/#/?icon=mWDBpVXqbc)
  197. ## License
  198. MIT License - see LICENSE file for details

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.