Skip to main content
Glama

Anki MCP Server

An MCP (Model Context Protocol) server that provides tools for interacting with the Anki API. This server allows AI assistants to manage Anki decks and cards through simple tool calls.

Features

  • List Anki decks with pagination

  • Create new decks

  • Add cards (basic and cloze types)

  • Batch add multiple cards

  • Get review queue with filtering options

  • Support for dynamically loading additional tools from an external API

Related MCP server: Anki MCP Server

Available Tools

  1. listDecks - List all Anki decks with optional pagination

  2. createDeck - Create a new Anki deck

  3. addCardsBatch - Add multiple cards to a deck in batch

  4. addBasicCard - Add a single basic card to a deck

  5. addClozeCard - Add a cloze deletion card to a deck

  6. getReviewQueue - Get cards due for review with filtering options

Installation

npm install -g @x-mcp/anki
# or
pnpm add -g @x-mcp/anki

Development

# Install dependencies
pnpm install

# Build the project
pnpm run build

# Run in development mode (auto-restart on changes)
pnpm run dev

# Run the server
pnpm start

# Lint and format code
pnpm run lint
pnpm run format

Configuration

MCP Client Configuration

Add this to your MCP client settings:

{
  "mcpServers": {
    "anki-mcp": {
      "command": "npx",
      "args": ["-y", "@x-mcp/anki@latest"],
      "env": {
        "ANKI_BASE_URL": "http://localhost:3000", // Anki API base URL
        "ANKI_API_KEY": "ank_YOUR_API_KEY_HERE" // Your Anki API key
      }
    }
  }
}

Environment Variables

Create a .env file:

# Required: Anki API configuration
ANKI_BASE_URL=http://localhost:3000/api/v1
ANKI_API_KEY=ank_YOUR_API_KEY_HERE

# Optional: External tools API configuration
API_URL=https://your-api-endpoint.com/tools
API_KEY=your-api-key

Usage Example

Once configured, the AI assistant can use commands like:

  • "List all my Anki decks"

  • "Create a new deck called 'Spanish Vocabulary'"

  • "Add a card with front 'Hello' and back 'Hola' to my Spanish deck"

  • "Show me cards due for review"

Each tool makes direct HTTP requests to the Anki API and returns the response data.

API Requirements

The tools interact with an Anki API that should have the following endpoints:

  • GET /api/v1/decks - List decks

  • POST /api/v1/decks - Create deck

  • POST /api/v1/decks/{deckId}/cards/batch - Add cards

  • GET /api/v1/study/queue - Get review queue

License

MIT

Available Tools

6 tools
addBasicCardB

Add a single basic card to a deck

ParametersJSON Schema
NameRequiredDescriptionDefault
backYesBack side of the card
tagsNoTags for the card
frontYesFront side of the card
deckIdYesID of the deck to add card to

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It only says 'add', implying creation, but does not discuss idempotency, duplicate handling, authorization, or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single short sentence, which is concise and waste-free. However, it lacks structure or front-loading of key information for a quick read.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 4 input parameters (all described in schema), no output schema, and siblings, the description is minimal. It does not explain what constitutes a 'basic card', whether the operation is reversible, or behavior for conflicting tags.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters. The description does not add any extra meaning beyond the schema, so a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'add', the resource 'basic card', and the target 'deck'. It distinguishes itself from siblings like addCardsBatch (batch) and addClozeCard (different type).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives such as addCardsBatch or addClozeCard. The description does not mention any prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

addCardsBatchB

Add multiple cards to a deck in batch

ParametersJSON Schema
NameRequiredDescriptionDefault
cardsYesArray of cards to add
deckIdYesID of the deck to add cards to

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It only says 'Add multiple cards' without disclosing atomicity, error handling, or validation behavior for batch operations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence. It is concise but perhaps too terse, missing useful context without being verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the batch complexity and absence of output schema, the description is incomplete. It does not explain the return value or how to handle partial failures, which is critical for agents.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds no extra meaning beyond the schema; it does not clarify order or partial failure semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Add', the resource 'cards', and the mode 'batch'. It effectively distinguishes from sibling tools like addBasicCard and addClozeCard, which handle single cards.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this batch tool versus single-card alternatives, nor any mention of batch size limits or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

addClozeCardB

Add a cloze deletion card to a deck

ParametersJSON Schema
NameRequiredDescriptionDefault
backYesBack side of the card
tagsNoTags for the card
frontYesFront side of the card
deckIdYesID of the deck to add card to
clozeTextYesCloze text with {{c1::text}} format

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description bears full responsibility for behavioral disclosure. It only states 'add', implying creation, but omits critical details like whether duplicates are checked, required permissions, or what happens if the deck doesn't exist. This lack of transparency is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, succinct sentence communicates the core purpose without any superfluous words. It is front-loaded and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 5 parameters, no output schema, and no annotations. The description does not explain the relationship between front, back, and clozeText (e.g., whether front/back are derived or static). It also fails to mention return value or side effects, leaving the agent underinformed for proper invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so each parameter has a description in the schema. The tool's description adds no extra parameter information beyond what the schema already provides. Baseline score of 3 is appropriate here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add'), the resource ('cloze deletion card'), and the destination ('to a deck'). It effectively distinguishes from siblings like addBasicCard (adds a different card type) and addCardsBatch (batch operation).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like addBasicCard or addCardsBatch. The agent is left to infer usage context from the name alone, which is insufficient for choosing correctly among similar tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

createDeckB

Create a new Anki deck

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesName of the deck
isPublicNoWhether the deck should be public
descriptionYesDescription of the deck

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, description must disclose behavior but only states creation. Does not mention side effects (e.g., duplicate handling, permissions, or irreversible actions).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single, concise sentence with no wasted words. Perfectly front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema or behavioral context. Missing details on success/error outcomes, validation rules, or default values for optional parameter isPublic.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so description does not need to explain parameters. Schema descriptions already document each parameter adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Create' and specific resource 'Anki deck', which is distinct from sibling tools focused on cards and reviewing. No ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like listDecks or addBasicCard. The description lacks context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

getReviewQueueB

Get cards due for review with filtering options

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of cards to return
deckIdNoOptional deck ID to filter cards
includeNewNoInclude new cards
includeReviewNoInclude review cards
includeLearningNoInclude learning cards

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description does not disclose behavioral traits like idempotency, side effects, or rate limits. It only implies a read operation without explicit confirmation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no unnecessary words. It is concise and front-loaded with the main action and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 5 optional parameters and no output schema, the description lacks details about return format, pagination, or behavior when no parameters are provided. It is too minimal to fully inform an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already describes all parameters. The description adds 'filtering options' but provides no additional semantic value beyond what the schema offers.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'cards due for review', and mentions 'filtering options', which distinguishes it from sibling tools that create cards or list decks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives, nor any conditions or prerequisites mentioned. The description only states what the tool does, not when to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

listDecksB

List all Anki decks with optional pagination

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of decks to return
offsetNoNumber of decks to skip

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, and the description only states basic functionality without disclosing side effects, auth needs, or other behavioral traits beyond listing decks.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence, front-loaded with key info, with no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with no output schema, the description is adequate but could mention expected return format or default pagination behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds 'optional pagination' but doesn't provide parameter-specific details like defaults or bounds.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (list) and resource (all Anki decks), and distinguishes it from sibling tools that add cards or create decks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies pagination use but provides no explicit guidance on when to use this tool vs alternatives or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updates
    • First observedaddBasicCard
    • First observedaddCardsBatch
    • First observedaddClozeCard
    • First observedcreateDeck
    • First observedgetReviewQueue
    • First observedlistDecks

TDQS

B3.4/5.0

Scored across 6 tools

Disambiguation4/5

Tools are mostly distinct: addBasicCard, addClozeCard, and addCardsBatch target different card types or batch operations; createDeck, listDecks, and getReviewQueue are clearly separate. However, addCardsBatch could overlap with addBasicCard or addClozeCard if used for multiple cards of a specific type.

Naming Consistency4/5

All tools follow a verb_noun pattern with imperative verbs (add, create, get, list). Minor inconsistencies: 'CardsBatch' uses plural and compound noun, while others use singular (BasicCard, ClozeCard). Capitalization is consistent with CamelCase.

Tool Count5/5

With 6 tools, the server is well-scoped for basic Anki operations: deck creation, card addition (basic, cloze, batch), deck listing, and review queue retrieval. The number is appropriate for a focused subset.

Completeness2/5

Significant gaps exist: no update or delete operations for cards or decks, no ability to list cards within a deck, and no support for managing models or tags. Agents can create and add but cannot modify or remove content.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers