Anki MCP Server
Servidor MCP de Anki
Un servidor MCP (Protocolo de contexto de modelo) para Claude Desktop que se conecta a Anki a través de AnkiConnect y recupera tarjetas etiquetadas con leech.
Características
Se conecta a Anki a través de la API AnkiConnect
Recupera tarjetas con etiquetas "leech"
Agrega etiquetas de revisión con fecha estampada a las tarjetas
Proporciona datos completos de tarjetas para que Claude los analice.
Se puede utilizar con Claude Desktop
Related MCP server: Anki MCP
Prerrequisitos
Anki instalado y funcionando
Complemento AnkiConnect instalado en Anki
Node.js y npm
Instalación
Clonar este repositorio:
git clone https://github.com/yourusername/anki-mcp-server.git cd anki-mcp-serverInstalar dependencias:
npm installConstruir el proyecto:
npm run build
Configuración
El servidor se puede configurar mediante variables de entorno. Copie el archivo de ejemplo proporcionado para crear su propia configuración:
cp .env.example .envLuego edite el archivo .env para personalizar su configuración:
Variable de entorno | Descripción | Valor predeterminado |
| La URL de la API de Anki Connect |
|
| La versión de la API de Anki Connect a utilizar |
|
| Habilitar el modo simulado para realizar pruebas (verdadero/falso) |
|
Si no se configuran las variables de entorno, el servidor utilizará los valores predeterminados.
Cómo encontrar su dirección IP local para AnkiConnect
Si no puede conectarse al localhost , deberá usar la dirección IP local de su computadora. Configure su archivo .env con:
ANKI_CONNECT_URL=http://YOUR_LOCAL_IP:8765Para encontrar su dirección IP local:
macOS : Abra la Terminal y ejecute
ifconfigoipconfig getifaddr en0(para WiFi)Windows : Abra el símbolo del sistema y ejecute
ipconfigLinux : Abra la terminal y ejecute
ip addr showohostname -I
Busque direcciones IPv4 como 192.168.xx o 10.xxx en la salida.
Configuración de prueba
Para realizar pruebas, se proporciona un archivo de configuración separado .env.test :
cp .env.example .env.testEdite .env.test para establecer valores específicos de la prueba:
ANKI_CONNECT_URL=http://localhost:8765
ANKI_CONNECT_VERSION=6
ANKI_MOCK_MODE=truePara ejecutar en modo de prueba:
npm run start:testUso
Asegúrese de que Anki se esté ejecutando con AnkiConnect instalado
Ejecute el servidor MCP:
npm start
Configuración de Claude Desktop
Para utilizar este servidor MCP con Claude Desktop:
Abra Claude Desktop
Edite el archivo de configuración de Claude Desktop ubicado en:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonVentanas:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Agregue la siguiente configuración a la sección
mcpServers:
{
"mcpServers": {
"anki": {
"command": "node",
"args": ["path/to/anki-mcp-server/dist/index.js"]
}
}
}Reemplace "path/to/anki-mcp-server" con la ruta real a donde clonó este repositorio.
Uso de la herramienta MCP
Una vez configurado, podrás utilizar las siguientes herramientas en Claude:
Ejemplo de uso
Could you analyze my Anki leech cards and suggest ways to improve my study?Claude utilizará el servidor MCP para recuperar tus tarjetas sanguijuelas y analizarlas.
Herramientas disponibles
obtener_tarjetas_sanguijuela
Recupera tarjetas etiquetadas como sanguijuelas de Anki.
Parámetros:
detailed(opcional, booleano, predeterminado: verdadero): si se deben devolver datos completos de la tarjeta o solo identificacionescount(opcional, número): Número de cartas aleatorias a devolver (predeterminado: todas las cartas)
tarjetas revisadas por etiqueta
Añade una etiqueta de "revisado" con fecha a tarjetas específicas. Esto te permite rastrear qué tarjetas has revisado con Claude.
Parámetros:
card_ids(obligatorio, matriz de números): Matriz de identificaciones de tarjetas para etiquetar como revisadascustom_tag_prefix(opcional, cadena, predeterminado: "見直し"): prefijo personalizado para la etiqueta
La etiqueta tendrá el formato見直し_YYYYMMDD (o su prefijo personalizado si se especifica).
Ejemplo de uso en Claude:
I've reviewed these cards, please tag them as reviewed: [1234567890, 1234567891]Solución de problemas
"No se pudo conectar a Anki" : asegúrese de que Anki se esté ejecutando y que AnkiConnect esté instalado correctamente.
"No se encontraron tarjetas sanguijuelas" : No tienes ninguna tarjeta etiquetada como "sanguijuela" en Anki.
Problemas de conexión con localhost : si no puede conectarse usando
localhost:Encuentre su dirección IP local como se describe en la sección Configuración
Actualice su archivo
.envpara usarANKI_CONNECT_URL=http://YOUR_LOCAL_IP:8765Asegúrese de que AnkiConnect esté configurado para permitir conexiones desde su dirección IP
Reinicie el servidor MCP después de realizar estos cambios
La etiqueta no aparece : asegúrese de proporcionar identificaciones de tarjetas válidas a la herramienta
tag_reviewed_cards
Modo de prueba
Para realizar pruebas sin afectar los datos reales de Anki, puedes usar el modo simulado:
Establezca
ANKI_MOCK_MODE=trueen su archivo.envo utilice el archivo.env.testproporcionadoEjecute el servidor con
npm run start:test
En el modo simulado, el servidor simulará todas las operaciones de Anki sin conectarse a él. Esto resulta útil para probar las integraciones de Claude sin arriesgarse a modificar los datos.
Desarrollo
Para ejecutar el servidor en modo de desarrollo con recarga en caliente:
npm run devPara el desarrollo con el modo simulado habilitado:
npm run dev:testLicencia
Instituto Tecnológico de Massachusetts (MIT)
Available Tools
2 toolsget_leech_cardsB
Retrieve cards tagged as leeches from Anki
| Name | Required | Description | Default |
|---|---|---|---|
| detailed | No | Whether to return detailed card information or just IDs | |
| count | No | Number of random cards to return (defaults to all) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Retrieve' implies a read operation, it doesn't specify whether this requires authentication, how results are returned (format, pagination), error conditions, or performance characteristics. The description is minimal and lacks behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with zero wasted words. It's appropriately sized for a simple retrieval tool and front-loads the essential information. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a retrieval tool with 2 parameters and 100% schema coverage but no annotations or output schema, the description provides basic purpose but lacks behavioral context and usage guidance. It's minimally adequate but has clear gaps in explaining how the tool behaves and when to use it.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 both parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema. Baseline 3 is appropriate when the schema does the heavy lifting, though no additional semantic context is provided.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Retrieve') and target resource ('cards tagged as leeches from Anki'), making the purpose immediately understandable. It doesn't explicitly differentiate from its sibling tool 'tag_reviewed_cards', but the distinction is implied through the different operations (retrieval vs tagging).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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 or in what context. The description only states what the tool does, without mentioning prerequisites, timing considerations, or relationship to the sibling tool beyond their different names.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tag_reviewed_cardsC
Add a 'reviewed on date' tag to specified cards
| Name | Required | Description | Default |
|---|---|---|---|
| card_ids | Yes | Array of card IDs to tag as reviewed | |
| custom_tag_prefix | No | Custom prefix for the tag (default: '見直し') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a mutation ('Add'), but doesn't clarify if this is destructive (e.g., overwrites existing tags), requires authentication, has side effects, or includes error handling. The description is minimal and lacks critical behavioral details for a write operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's mutation nature (adding tags), no annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions, side effects, or return values, leaving significant gaps for an AI agent to understand how to use it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents both parameters (card_ids and custom_tag_prefix). The description adds no additional parameter semantics beyond implying the tag format ('reviewed on date'), which is already suggested by the schema's default value for custom_tag_prefix. Baseline 3 is appropriate as the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Add') and target resource ('tag to specified cards'), with the specific tag content 'reviewed on date' mentioned. However, it doesn't differentiate from the sibling tool 'get_leech_cards' (which presumably retrieves rather than modifies cards), so it doesn't fully distinguish from alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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. The description doesn't mention the sibling tool 'get_leech_cards' or any other context for selection, nor does it specify prerequisites like required permissions or system states.
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.
2 tool updates
- First observed
get_leech_cards - First observed
tag_reviewed_cards
TDQS
Scored across 2 tools
The two tools have completely distinct purposes: one retrieves cards with a specific tag, while the other adds a tag to cards. There is no overlap in functionality or ambiguity between them.
Both tools follow a consistent verb_noun pattern (get_leech_cards, tag_reviewed_cards) with clear actions and objects, making them predictable and easy to understand.
With only 2 tools, the server feels thin for an Anki integration, lacking basic operations like creating cards, reviewing cards, or managing decks. This minimal set limits agent workflows significantly.
The toolset is severely incomplete for an Anki server, missing core CRUD operations for cards, decks, and reviews. Agents cannot perform essential tasks like adding new cards or scheduling reviews, leading to dead ends.
Maintenance
Related MCP Connectors
Connect Claude to Fathom meeting recordings, transcripts, and summaries
Run UX research from Claude — create card sort studies, list studies, pull headline stats.
- platform7nOAuthtech.p7n
Connect Claude to your Platform7n workspaces — chat, links, and tasks. One-click OAuth.
Connect Claude to your Intervals.icu watch data for fitness, workout review, and plan writing.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with the Anki desktop app for spaced repetition learning. Supports reviewing due cards, creating new flashcards, and managing study sessions through natural language commands.MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants like Claude to interact with Anki flashcard decks through AnkiConnect. Supports creating and managing decks, basic and cloze deletion cards, searching existing cards, and organizing content with tags.-
- AlicenseNot gradedqualityNot gradedmaintenanceConnects Claude to Anki flashcard software via AnkiConnect, enabling users to review due cards, create flashcards, and manage spaced repetition learning through natural language conversations.MIT
- FlicenseNot gradedqualityDmaintenanceProvides programmatic access to Anki flashcard operations through the AnkiConnect API, allowing users to list and create decks and cards. It enables seamless management of flashcards directly from MCP-compatible clients like Claude Desktop.-