Anki Cards (Clanki) MCP server

Integrates with Anki flashcards to provide card creation and deck management capabilities.
Back to servers
Setup instructions
Provider
jasperket
Release date
Jan 20, 2025
Language
TypeScript
Stats
6 stars

This MCP server enables Claude and other AI assistants to interact with Anki flashcard decks, allowing you to create and manage flashcards directly through the AI interface using the Model Context Protocol.

Prerequisites

  • Anki installed and running
  • AnkiConnect plugin installed in Anki
  • Node.js 16 or higher

Installation

First, clone the repository and set up the server:

git clone https://github.com/yourusername/clanki.git
cd clanki

Install the required dependencies:

npm install

Build the project:

npm run build

Configuration

Before using the server, make sure:

  • Anki is running with the AnkiConnect plugin installed and enabled
  • Claude for Desktop is configured to use the server

To configure Claude for Desktop, edit the claude_desktop_config.json file:

{
  "mcpServers": {
    "clanki": {
      "command": "node",
      "args": ["/absolute/path/to/clanki/build/index.js"]
    }
  }
}

Important: Replace /absolute/path/to/clanki with the actual path to your Clanki installation.

Available Tools

Deck Management

create-deck

Creates a new Anki deck.

Parameters:

  • name: Name for the new deck

Card Management

create-card

Creates a new basic flashcard in a specified deck.

Parameters:

  • deckName: Name of the deck to add the card to
  • front: Front side content of the card
  • back: Back side content of the card
  • tags: (Optional) Array of tags for the card

create-cloze-card

Creates a new cloze deletion card in a specified deck.

Parameters:

  • deckName: Name of the deck to add the card to
  • text: Text containing cloze deletions using {{c1::text}} syntax
  • backExtra: (Optional) Extra information to show on the back of the card
  • tags: (Optional) Array of tags for the card

update-card

Updates an existing basic flashcard.

Parameters:

  • noteId: ID of the note to update
  • front: (Optional) New front side content
  • back: (Optional) New back side content
  • tags: (Optional) New tags for the card

update-cloze-card

Updates an existing cloze deletion card.

Parameters:

  • noteId: ID of the note to update
  • text: (Optional) New text with cloze deletions
  • backExtra: (Optional) New extra information for the back
  • tags: (Optional) New tags for the card

Usage Examples

To create a new deck through Claude:

Please create a new Anki deck called "Spanish Vocabulary"

To add a basic flashcard:

Add a flashcard to my "Spanish Vocabulary" deck with "hola" on the front and "hello" on the back

To create a cloze deletion card:

Create a cloze card in my "Biology" deck with the text "Photosynthesis occurs in the {{c1::chloroplasts}} of plant cells"

To update an existing card:

Update card with ID 1234567890 to have "revised front content" on the front

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "clanki" '{"command":"node","args":["/absolute/path/to/clanki/build/index.js"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "clanki": {
            "command": "node",
            "args": [
                "/absolute/path/to/clanki/build/index.js"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "clanki": {
            "command": "node",
            "args": [
                "/absolute/path/to/clanki/build/index.js"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later