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.
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
Before using the server, make sure:
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.
Creates a new Anki deck.
Parameters:
name
: Name for the new deckCreates a new basic flashcard in a specified deck.
Parameters:
deckName
: Name of the deck to add the card tofront
: Front side content of the cardback
: Back side content of the cardtags
: (Optional) Array of tags for the cardCreates a new cloze deletion card in a specified deck.
Parameters:
deckName
: Name of the deck to add the card totext
: Text containing cloze deletions using {{c1::text}} syntaxbackExtra
: (Optional) Extra information to show on the back of the cardtags
: (Optional) Array of tags for the cardUpdates an existing basic flashcard.
Parameters:
noteId
: ID of the note to updatefront
: (Optional) New front side contentback
: (Optional) New back side contenttags
: (Optional) New tags for the cardUpdates an existing cloze deletion card.
Parameters:
noteId
: ID of the note to updatetext
: (Optional) New text with cloze deletionsbackExtra
: (Optional) New extra information for the backtags
: (Optional) New tags for the cardTo 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
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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