mankey-cli
Original:🇺🇸 English
Translated
Comprehensive reference for the Mankey Anki CLI and MCP server. Use when working with Anki flashcards via the mankey command, creating notes, managing decks, reviewing cards, querying collection data, or building MCP tool integrations. Covers all 96 tools across 8 categories (deck, note, card, model, media, stats, gui, system) with full parameter details.
3installs
Sourcebriansunter/mankey
Added on
NPX Install
npx skill4agent add briansunter/mankey mankey-cliTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Mankey CLI & MCP Tool Reference
Mankey is an MCP server and CLI for managing Anki via Anki-Connect. Works with Node.js (npx) or Bun.
Prerequisites
- Anki Desktop must be running
- Anki-Connect add-on must be installed: Anki > Tools > Add-ons > Get Add-ons > Code: > Restart Anki
2055492159
Setup
MCP Server (Claude Desktop / Claude Code)
Add to your MCP config ( or ):
claude_desktop_config.json.mcp.jsonjson
{
"mcpServers": {
"anki": {
"command": "npx",
"args": ["mankey"]
}
}
}CLI
bash
npx mankey deck list # List decks
npx mankey tools # List all 96 tools
npx mankey note add --deck Default --model Basic --front "Q" --back "A"
npx mankey run <toolName> '<json>' # Run any tool by nameConfiguration
| Option | Description |
|---|---|
| Anki-Connect server URL |
| Environment variable (default: |
Troubleshooting
- Cannot connect: Ensure Anki is running with Anki-Connect installed
- Permission dialog: Click "Yes" on first Anki-Connect connection
- macOS background: Run if Anki sleeps
defaults write net.ankiweb.dtop NSAppSleepDisabled -bool true
CLI Subcommands
deck
| Command | Description |
|---|---|
| List all deck names |
| Create a deck (use |
| Get new/learn/review/total counts |
| Delete decks and their cards |
note
| Command | Description |
|---|---|
| Create a note |
| Search notes |
| Get note details |
| Update a note |
| Delete notes permanently |
| Get tags for a note |
card
| Command | Description |
|---|---|
| Search cards |
| Get card details |
| Suspend cards |
| Unsuspend cards |
| Answer card (1=Again 2=Hard 3=Good 4=Easy) |
| Get next due cards in review order |
model
| Command | Description |
|---|---|
| List all note types |
| Get field names for a model |
| Create model |
stats
| Command | Description |
|---|---|
| Today's review count |
| Due cards with learning/review breakdown |
| Full collection statistics HTML |
Generic Runner
bash
npx mankey run <toolName> '<jsonArgs>'
# Example:
npx mankey run addNote '{"deckName":"Default","modelName":"Basic","fields":{"Front":"Hello","Back":"World"}}'
npx mankey run findCards '{"query":"deck:Default is:due","limit":20}'Any of the 96 tools below can be called via . Arguments are validated with Zod before execution.
runComplete Tool Reference
For full parameter schemas, types, and defaults, see .
references/tools-by-category.mdDeck Tools (6)
- deckNames - List all decks with pagination (,
offset)limit - createDeck - Create deck (name,
deckfor nesting) returns ID:: - getDeckStats - Stats for decks () returns new/learn/review/total
decks[] - deckNamesAndIds - Deck name-to-ID mapping with pagination
- getDeckConfig - Get config group for a deck ()
deck - deleteDecks - Delete decks (,
decks[]default true)cardsToo
Note Tools (16)
- addNote - Create single note (,
deckName,modelName,fields{},tags[])allowDuplicate - addNotes - Bulk create () returns array of IDs (null for failures)
notes[] - findNotes - Search (,
query,offset) returns IDs + paginationlimit - notesInfo - Full note data () auto-batches >100
notes[] - updateNote - Update fields/tags (,
id,fields{})tags[] - updateNoteFields - Update only fields (,
note.id)note.fields{} - deleteNotes - Delete permanently ()
notes[] - getTags - All collection tags with pagination
- getNoteTags - Tags for one note (ID)
note - addTags - Add tags to notes (,
notes[]space-separated)tags - removeTags - Remove tags from notes (,
notes[]space-separated)tags - replaceTags - Replace tag in specific notes (,
notes[],tagToReplace)replaceWithTag - replaceTagsInAllNotes - Global tag replace (,
tagToReplace)replaceWithTag - clearUnusedTags - Remove orphaned tags (no params)
- removeEmptyNotes - Delete notes with no cards (no params)
- notesModTime - Modification timestamps ()
notes[]
Card Tools (19)
- findCards - Search (,
query,offset) returns IDs + paginationlimit - getNextCards - Due cards in review order (,
deck,limit)offset - cardsInfo - Full card data () auto-batches >100
cards[] - answerCards - Batch answer (,
answers[].cardId1-4)answers[].ease - suspend / unsuspend - Toggle suspension ()
cards[] - areSuspended - Check suspension status () returns booleans
cards[] - areDue - Check due status () returns booleans
cards[] - getEaseFactors / setEaseFactors - Get/set ease (,
cards[])easeFactors[] - getIntervals - Current intervals in days (,
cards[])complete - cardsToNotes - Map card IDs to note IDs ()
cards[] - cardsModTime - Modification timestamps ()
cards[] - forgetCards - Reset to new state ()
cards[] - relearnCards - Move to relearning queue ()
cards[] - setSpecificValueOfCard - Modify internal properties (,
card,keys[])newValues[] - getDecks - Deck names for cards ()
cards[] - changeDeck - Move cards to deck (,
cards[])deck - canAddNotes - Validate without creating () returns booleans
notes[]
Model Tools (9)
- modelNames - List all models with pagination
- modelFieldNames - Field names for model ()
modelName - modelNamesAndIds - Model name-to-ID mapping with pagination
- createModel - Create note type (,
modelName,inOrderFields[],cardTemplates[],css)isCloze - modelFieldsOnTemplates - Fields used per template ()
modelName - modelTemplates - Get templates for model ()
modelName - modelStyling - Get CSS for model ()
modelName - updateModelTemplates - Update templates (,
model.name)model.templates{} - updateModelStyling - Update CSS (,
model.name)model.css
Media Tools (5)
- storeMediaFile - Store file (, one of:
filenamebase64 /data/url,path)deleteExisting - retrieveMediaFile - Get file as base64 ()
filename - getMediaFilesNames - List files (with wildcards)
pattern - deleteMediaFile - Delete file ()
filename - getMediaDirPath - Get media folder path (no params)
Stats Tools (7)
- getNumCardsReviewedToday - Today's review count (no params)
- getDueCardsDetailed - Due cards breakdown (optional)
deck - getNumCardsReviewedByDay - Reviews by day (no params)
- getCollectionStatsHTML - Full stats HTML ()
wholeCollection - cardReviews - Review history (,
deck)startID - getLatestReviewID - Latest review ID ()
deck - getReviewsOfCards - Reviews for specific cards ()
cards[]
GUI Tools (17)
- guiBrowse - Open browser (,
query)reorderCards{} - guiAddCards - Open add dialog ()
note{} - guiCurrentCard - Current review card (no params)
- guiAnswerCard - Answer current card (1-4)
ease - guiShowQuestion / guiShowAnswer - Toggle card sides
- guiStartCardTimer - Start review timer
- guiDeckOverview - Open deck overview ()
name - guiDeckBrowser - Open deck list
- guiDeckReview - Start reviewing ()
name - guiSelectedNotes - Get selected notes in browser
- guiSelectCard - Select card in browser ()
card - guiEditNote - Open edit dialog ()
note - guiUndo - Undo last action
- guiCheckDatabase - Run integrity check
- guiImportFile - Open import dialog ()
path - guiExitAnki - Close Anki
System Tools (17)
- sync - Sync with AnkiWeb
- getProfiles / loadProfile / getActiveProfile - Profile management
- exportPackage - Export .apkg (,
deck,path)includeSched - importPackage - Import .apkg ()
path - version - Anki-Connect version
- requestPermission - Request API permission
- apiReflect - API metadata (,
scopes[])actions[] - reloadCollection - Reload from disk
- multi - Batch multiple actions ()
actions[] - setDueDate - Override due date (,
cards[])days - suspended - Check single card suspension ()
card - saveDeckConfig - Update deck config ()
config{} - setDeckConfigId - Assign config to decks (,
decks[])configId - cloneDeckConfigId - Clone config (,
name)cloneFrom - removeDeckConfigId - Delete config ()
configId
Common Workflows
Check learning progress and mastery
bash
# Deck overview: new/learning/review/total counts
npx mankey deck stats "Japanese::JLPT N5"
# Today's study stats
npx mankey stats today
# Due cards with queue breakdown (learning vs review vs new)
npx mankey stats due --deck "Japanese::JLPT N5"
# Find well-known cards (high interval = strong retention)
npx mankey run findCards '{"query":"deck:Default prop:ivl>30"}'
# Get full learning data for specific cards (interval, ease, reps, lapses)
npx mankey card info <cardId1> <cardId2>
# Returns: interval (days until review), factor (ease multiplier),
# reps (successful reviews), lapses (times forgotten),
# queue (0=new, 1=learning, 2=review, 3=relearning),
# type (0=new, 1=learning, 2=review, 3=relearn)Find struggling cards
bash
# Cards failed many times (high lapse count)
npx mankey run findCards '{"query":"deck:Default prop:lapses>5"}'
# Cards with low ease (difficulty multiplier, 2500 = default)
npx mankey run findCards '{"query":"deck:Default prop:ease<2.0"}'
# Cards currently in relearning (recently forgotten)
npx mankey run findCards '{"query":"deck:Default is:learn -is:new"}'
# Get ease factors for specific cards
npx mankey run getEaseFactors '{"cards":[123,456]}'Create cards from content
bash
# Single card
npx mankey note add --deck "Japanese" --model Basic --front "日本語" --back "Japanese language" --tags japanese,vocabulary
# Bulk create via generic runner
npx mankey run addNotes '{"notes":[
{"deckName":"Japanese","modelName":"Basic","fields":{"Front":"猫","Back":"cat"},"tags":["japanese"]},
{"deckName":"Japanese","modelName":"Basic","fields":{"Front":"犬","Back":"dog"},"tags":["japanese"]}
]}'
# Cloze deletion
npx mankey run addNote '{"deckName":"Science","modelName":"Cloze","fields":{"Text":"The {{c1::mitochondria}} is the powerhouse of the cell"}}'
# Check what fields a model needs before creating
npx mankey model fields "Basic (and reversed card)"Review cards programmatically
bash
# Get next due cards in review order (Learning > Review > New)
npx mankey card next --deck Default --limit 5
# Answer cards: 1=Again 2=Hard 3=Good 4=Easy
npx mankey card answer <cardId> 3
# Batch answer multiple cards
npx mankey run answerCards '{"answers":[
{"cardId":123,"ease":3},
{"cardId":456,"ease":4}
]}'Manage tags and organize
bash
# Find all cards with a tag
npx mankey note find "tag:japanese"
# Add tags to notes
npx mankey run addTags '{"notes":[123,456],"tags":"vocab important"}'
# Replace a tag across entire collection
npx mankey run replaceTagsInAllNotes '{"tagToReplace":"old-tag","replaceWithTag":"new-tag"}'
# Clean up unused tags
npx mankey run clearUnusedTags '{}'
# Move cards between decks
npx mankey run changeDeck '{"cards":[123,456],"deck":"Japanese::Advanced"}'Bulk operations and search
bash
# Search with Anki query syntax
npx mankey card find "deck:Japanese is:due" --limit 50
npx mankey note find "tag:vocab added:7" # Added in last 7 days
npx mankey card find "prop:ivl>90 deck:Default" # Well-known cards
# Suspend/unsuspend cards
npx mankey card suspend 123 456 789
npx mankey card unsuspend 123 456 789
# Reset cards to new state (clear scheduling)
npx mankey run forgetCards '{"cards":[123,456]}'
# Reschedule cards
npx mankey run setDueDate '{"cards":[123,456],"days":"0"}' # Due today
npx mankey run setDueDate '{"cards":[123,456],"days":"7"}' # Due in 7 daysSearch Query Syntax
| Query | Matches |
|---|---|
| Cards in deck (use quotes for |
| Notes with tag |
| Notes without tag |
| Cards due for review |
| New cards (never reviewed) |
| Review cards (graduated from learning) |
| Cards in learning phase |
| Suspended cards |
| Cards with interval > N days |
| Cards with ease factor < N |
| Cards failed more than N times |
| Cards reviewed more than N times |
| Cards added in last N days |
| Cards rated in last N days |
| Cards where field contains value |
Combine queries with spaces (AND). Example:
deck:Japanese is:due prop:lapses>3Key Patterns
Pagination: Tools returning lists support /. Response includes .
offsetlimitpagination: { total, offset, limit, hasMore, nextOffset }Auto-batching: and auto-split requests >100 items.
notesInfocardsInfoInput flexibility: IDs accept number/string/array. Tags accept array, space-separated string, or JSON string.