Anki MCP Server: Complete Setup Guide for Claude & AI Agents
There is no official Anki MCP Server from Ankitects. The Anki MCP Server covered in this guide is a community project — nailuoGG/anki-mcp-server — that connects AI assistants such as Claude to Anki through the AnkiConnect add-on.
The implementation documented here is a TypeScript/Node.js MCP server that runs locally, communicates with supported MCP clients over stdio, and translates MCP tool calls into requests to AnkiConnect.
This guide covers installation, Claude Desktop and Claude Code configuration, the server's documented tools and resources, troubleshooting, security considerations, limitations, and alternative Anki MCP implementations.
Last verified: July 2026.
Quick Facts
| Attribute | Details |
|---|---|
| Official Anki product? | No — community project |
| Selected implementation | nailuoGG/anki-mcp-server |
| Primary language | TypeScript |
| Runtime requirement | Node.js 20.11+ |
| Requires Anki Desktop? | Yes |
| Requires AnkiConnect? | Yes |
| AnkiConnect add-on code | 2055492159 |
| Documented MCP transport | stdio |
| Package command | npx --yes anki-mcp-server |
| MCP resources | Yes |
| Desktop Extension support | Yes |
| Best for | Local Claude Desktop, Claude Code, and other stdio-capable MCP client setups |
| Last verified | July 2026 |
What Is an Anki MCP Server?
MCP (Model Context Protocol) is an open protocol that allows AI applications to interact with external tools and data sources through a standardized interface.
An Anki MCP server acts as an integration layer between an MCP-capable AI client and Anki.
For the implementation covered in this guide, the communication flow looks like this:
Claude or another MCP client
|
stdio
|
v
anki-mcp-server
|
HTTP requests
|
v
AnkiConnect
|
v
Anki Desktop
The MCP client invokes tools exposed by the server. The server translates those requests into AnkiConnect API calls, and AnkiConnect performs operations against the active Anki collection.
This makes it possible to use natural-language instructions to create notes, inspect decks, search existing notes, work with note types, and trigger synchronization.
Is There an Official Anki MCP Server?
No.
Ankitects, the maintainers of Anki, does not publish an official MCP server.
The implementation documented in this guide is an independent community project.
AnkiConnect is also a third-party Anki add-on rather than a built-in MCP integration. It provides the local HTTP API used by the server covered here and by a number of other Anki automation projects.
Because Anki MCP implementations are independently maintained, verify the repository, installation instructions, runtime requirements, available tools, and recent project activity before adopting one.
Which Anki MCP Server Does This Guide Use?
This guide documents:
nailuoGG/anki-mcp-server
It is a TypeScript/Node.js project that runs locally through npx, communicates with MCP clients over stdio, and uses AnkiConnect as its integration layer with Anki Desktop.
The server exposes MCP tools and resources for working with decks, notes, note types, and synchronization.
Later in this guide, the Alternatives section discusses a separate project for readers who need deployment modes or capabilities not documented by the implementation covered here.
Repository Snapshot
The following project details were verified against the repository documentation and project metadata in July 2026.
Repository activity, releases, and GitHub metrics can change over time.
| Attribute | Verified information |
|---|---|
| Repository | nailuoGG/anki-mcp-server |
| Primary language | TypeScript |
| Runtime requirement | Node.js 20.11+ |
| Package execution | npx --yes anki-mcp-server |
| Documented MCP transport | stdio |
| Anki integration | AnkiConnect |
| License | MIT |
| Automated tests | Yes |
| MCP resources | Yes |
| MCPB / Desktop Extension support | Yes |
| Last verified | July 2026 |
How the Anki MCP Server Architecture Works
Two separate connections are involved.
1. AI Client to MCP Server
In the documented local configuration, Claude Desktop or another MCP client starts anki-mcp-server as a subprocess.
The client and server exchange MCP messages through standard input and standard output.
The documented setup does not expose an MCP network endpoint.
This reduces network exposure at the MCP transport layer, but the server process still runs with the permissions of the local user account.
2. MCP Server to AnkiConnect
The MCP server communicates with AnkiConnect through its local HTTP API.
The default AnkiConnect endpoint used by the documented setup is:
http://localhost:8765
AnkiConnect then performs operations against the currently active Anki Desktop environment.
For the implementation covered in this guide, Anki Desktop and AnkiConnect must be available for operations that access Anki data.
The repository documents AnkiConnect as the integration layer and does not document direct .anki2 database access or a headless Anki backend.
Prerequisites
Before configuring the MCP server, you need:
- Anki Desktop installed and working.
- The AnkiConnect add-on installed.
- Node.js 20.11 or newer.
- An MCP-capable client such as Claude Desktop or Claude Code.
- A local environment where the MCP client can execute
npx.
Verify each dependency separately before debugging the full integration.
Step 1: Install AnkiConnect
Open Anki Desktop.
Go to:
Tools → Add-ons → Get Add-ons
Enter the AnkiConnect add-on code:
2055492159
Install the add-on and restart Anki Desktop.
After restarting, confirm that AnkiConnect appears in the installed add-ons list.
Step 2: Verify AnkiConnect
Before configuring MCP, verify that AnkiConnect is reachable.
Keep Anki Desktop running and execute:
curl -s http://localhost:8765 \
-X POST \
-H "Content-Type: application/json" \
-d '{"action":"version","version":6}'
A successful response should contain a result and no error.
For example:
{
"result": 6,
"error": null
}
If the request fails, troubleshoot Anki Desktop and AnkiConnect before debugging the MCP server because operations that access Anki data depend on this connection.
Step 3: Configure the Anki MCP Server
The documented setup uses npx, so a separate global package installation is not required.
Add the server to your Claude Desktop MCP configuration.
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Add:
{
"mcpServers": {
"anki": {
"command": "npx",
"args": [
"--yes",
"anki-mcp-server"
]
}
}
}
If your configuration already contains other MCP servers, add the anki object inside the existing mcpServers object instead of replacing the entire file.
After saving the configuration, fully quit and restart Claude Desktop.
Closing only the application window may not restart the MCP subprocess.
Using a Custom AnkiConnect Port
If AnkiConnect is configured to use a non-default port, pass the port to the server.
For example:
{
"mcpServers": {
"anki": {
"command": "npx",
"args": [
"--yes",
"anki-mcp-server",
"--port",
"8080"
]
}
}
}
The port passed to the MCP server must match the port used by AnkiConnect.
Alternative: Clone and Build from Source
Running the project from source is useful when you want to inspect the implementation, run the project's development scripts, modify server behavior, or debug the integration locally.
Clone the repository:
git clone https://github.com/nailuoGG/anki-mcp-server.git
cd anki-mcp-server
Then install dependencies and run the build command documented by the current repository version.
Because package scripts can change between releases, use the repository's current README and package.json as the source of truth for development commands.
How to Connect Anki MCP Server to Claude Desktop
After configuring the server:
- Start Anki Desktop.
- Confirm AnkiConnect is available.
- Fully restart Claude Desktop.
- Open a new conversation.
- Check whether Claude reports the Anki MCP tools.
You can ask:
What Anki tools do you currently have available?
Claude should return the tools registered by the connected MCP server.
If the server does not appear, inspect Claude Desktop logs and test the server independently before changing multiple configuration values at once.
For more general Claude Desktop configuration guidance, see the Claude Desktop MCP guide.
Alternative: Claude Desktop Extension
The repository also documents support for the MCPB/Desktop Extension format.
This provides a packaged installation workflow for Claude Desktop users who prefer installing an extension instead of manually editing MCP configuration JSON.
The repository includes a packaging script:
npm run pack
Use the current repository documentation to build and install the extension package.
The packaged Desktop Extension and the standard npx workflow serve different use cases.
For normal stdio-based development and debugging, the documented npx --yes anki-mcp-server configuration remains the simplest starting point.
How to Use Anki MCP Server with Claude Code
The project documents a Claude Code Agent Skill that provides Claude Code with instructions for using the Anki integration and common workflows.
The documented command is:
npx skills add nailuoGG/anki-mcp-server@anki
An Agent Skill is not itself an MCP server installation method.
The MCP server still needs to be available through the supported server configuration.
You can also register the MCP server through Claude Code's standard MCP configuration using:
npx --yes anki-mcp-server
Keep the Agent Skill and MCP server configuration conceptually separate:
- the MCP server exposes tools and resources;
- the Agent Skill provides workflow guidance for Claude Code.
How to Test Anki MCP Server with MCP Inspector
MCP Inspector is useful for testing server startup, MCP initialization, tool discovery, and tool calls independently of Claude Desktop.
The repository documents an Inspector script:
npm run inspector
To use the repository's development scripts, clone the project and install its dependencies according to the current README.
Then run the documented Inspector script.
MCP Inspector can help you determine whether a problem occurs:
- before the MCP server starts;
- during MCP initialization;
- during tool discovery;
- between the server and AnkiConnect;
- inside a specific tool call.
The project also includes automated tests.
Automated tests and live integration tests serve different purposes. A passing test suite does not prove that your local Anki Desktop, AnkiConnect configuration, and MCP client setup are working correctly.
For a broader local debugging workflow, see how to test a local MCP server.
Anki MCP Server Tools
The implementation covered in this guide exposes MCP tools for working with decks, notes, note types, and synchronization.
The exact public tool names and tool surface can change between package versions.
Before relying on a specific tool name in automation, inspect the current repository documentation, source code, or the tools returned by your connected MCP client.
Tool Reference
| Tool | Purpose | Classification | Important notes |
|---|---|---|---|
list_decks | List available Anki decks | Read-only | Useful before creating notes so the exact deck name can be confirmed |
create_deck | Create an Anki deck | State-changing | Changes the Anki collection |
create_note | Create a single Anki note | State-changing | Requires valid deck, note type, and field values |
batch_create_notes | Create multiple notes | State-changing | Useful for bulk flashcard generation |
search_notes | Search existing Anki notes | Read-only | Uses Anki search behavior supported by the implementation |
get_note_info | Retrieve information about a note | Read-only | Useful before updating existing content |
update_note | Update an existing note | State-changing | Review fields and note type before modifying data |
delete_note | Delete a note | Destructive | Review destructive tool calls carefully and maintain current backups |
list_note_types | List available note types | Read-only | Useful before creating notes with custom note types |
create_note_type | Create a new note type | State-changing | Modifies the Anki collection schema |
get_note_type_info | Inspect the fields of a note type | Read-only | Useful before writing fields to a note |
sync | Trigger synchronization through Anki | State-changing | Verify synchronization state directly in Anki when needed |
Do not assume that tool names from one Anki MCP implementation apply to another project.
Anki MCP Server Resources
The server also exposes MCP resources.
Resources and tools serve different purposes.
Tools perform actions.
Resources expose URI-addressable information that an MCP client can read into context.
For a deeper explanation, see MCP resources vs tools.
The documented resources include:
| Resource URI | Purpose |
|---|---|
anki://decks/all | List available decks |
anki://note-types/all | List available note types |
anki://note-types/all-with-schemas | Retrieve note types and their field schemas |
anki://note-types/{modelName} | Retrieve information about a specific note type |
Resources can be useful when Claude needs contextual information about your Anki collection without performing a state-changing operation.
Which Installation Method Should You Use?
| Method | Best for | Setup complexity | Update behavior | Debugging control |
|---|---|---|---|---|
| npx | Most users and standard local MCP client setups | Low | Package resolution occurs when the command runs | Standard client and process logs |
| MCPB/Desktop Extension | Claude Desktop users who prefer packaged installation | Low after packaging | Uses the packaged version until updated or rebuilt | Less direct than running from source |
| Clone and build from source | Developers, debugging, customization, and contributing | Medium | You control when the repository is updated | Highest |
For most users, the documented npx configuration is the simplest starting point.
Running from source is more useful when you need to inspect server behavior, execute development scripts, debug the implementation, or modify the project.
Practical Workflows
Create Flashcards from Study Material
Example prompt:
I'm studying the Krebs cycle.
Create 10 Anki flashcards in my "Biochemistry" deck using the "Basic" note type.
Use a question on the Front and a concise answer on the Back.
Before creating cards in bulk, confirm:
- the target deck exists;
- the note type exists;
- the expected field names are correct;
- the generated content is accurate.
Search and Review Existing Notes
Example prompt:
Find notes tagged "needs-review" in my Japanese deck and show me their fields.
Searching existing notes before modifying them is safer than asking the agent to update content based on guessed note identifiers.
Create a New Deck
Example prompt:
List my current Anki decks.
If "Biochemistry::Krebs Cycle" does not exist, create it.
This workflow lets the agent inspect the current state before performing a write operation.
Inspect a Note Type Before Creating Notes
Example prompt:
List my note types.
Show me the fields for the note type named "Basic".
Do not create any notes yet.
Separating inspection from mutation makes AI-assisted workflows easier to review.
Troubleshooting
| Symptom | Likely cause | Diagnostic | Fix |
|---|---|---|---|
| Server does not appear in Claude Desktop | Invalid config, wrong file path, executable problem, or client not restarted | Validate JSON and inspect Claude logs | Correct the configuration and fully restart Claude Desktop |
| Anki operations fail | Anki Desktop or AnkiConnect is unavailable | Send the AnkiConnect version request | Start Anki, verify the add-on, and retry |
| npx fails to start | Unsupported Node.js version or PATH problem | Run node --version and npx --version | Upgrade Node.js or fix executable resolution |
| Server starts but expected tools are missing | Startup, initialization, package-version, or client configuration issue | Inspect client logs and test with MCP Inspector | Verify the executed package and restart the client |
| Note creation or updates fail | Incorrect deck, note type, field names, or input data | Inspect existing Anki metadata before writing | Use values returned by the server instead of guessing |
| Sync does not behave as expected | Anki state, sync state, or UI interaction requires attention | Inspect Anki Desktop and server logs | Resolve the local Anki state and retry |
Anki MCP Server Not Appearing in Claude Desktop
Likely causes:
- invalid JSON;
- wrong configuration file;
- npx cannot be resolved;
- unsupported Node.js version;
- Claude Desktop was not fully restarted;
- the MCP process exited during startup.
Diagnostic steps:
Validate your JSON.
On macOS:
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json | python3 -m json.tool
Check:
node --version
npx --version
Then inspect Claude Desktop logs.
Fix: Correct the configuration, verify that npx --yes anki-mcp-server can start in the relevant environment, fully quit Claude Desktop, and reopen it.
AnkiConnect Connection Refused
Likely causes:
- Anki Desktop is not running;
- AnkiConnect is not installed;
- AnkiConnect is not available on the expected port;
- the local configuration differs from the server configuration.
Diagnostic: Run the AnkiConnect version request shown earlier.
Fix: Start Anki Desktop, verify the add-on, confirm the expected port, and test AnkiConnect directly before retrying through MCP.
npx or Node.js Command Errors
Likely causes:
- Node.js is below the documented minimum;
nodeornpxis not available to GUI applications;- PATH configuration differs between your terminal and Claude Desktop.
Diagnostic:
node --version
npx --version
On macOS and Linux, remember that applications launched from the desktop environment may not inherit the same PATH as an interactive shell.
Fix: Upgrade Node.js if required and make sure the MCP client can resolve the executable.
Anki MCP Tools Are Missing After Connecting
Possible causes include:
- server startup failure;
- MCP initialization failure;
- an unexpected package version;
- client-side configuration problems.
Clone the repository, install dependencies using the current project instructions, and run the documented npm run inspector script to inspect server startup and MCP initialization.
Also check which package version npx is executing and compare the discovered tools with the current project documentation.
Note Type or Deck Errors
Before creating or updating notes:
- list the available decks;
- list the available note types;
- inspect the selected note type's fields;
- use exact names returned by the server.
Do not guess field names or assume that every Anki profile uses the default Basic note type unchanged.
Anki Sync Problems
Triggering synchronization through an MCP tool does not remove the need to inspect Anki Desktop when synchronization requires user attention.
If synchronization does not complete as expected:
- inspect Anki Desktop;
- check for dialogs or sync conflicts;
- inspect MCP/server logs;
- resolve the local Anki state;
- retry synchronization.
MCP stdio Problems
MCP clients expect valid protocol messages on stdout.
Unexpected output written to stdout by a server process or wrapper can interfere with stdio-based MCP communication.
When debugging:
- inspect stderr and client logs;
- test the server with MCP Inspector;
- use the documented npx server command for stdio-based clients;
- avoid assuming that every packaged distribution is interchangeable with the raw server command.
Security and Privacy
The integration has two separate security boundaries.
AI Client to MCP Server
The documented MCP connection uses local stdio and does not expose an MCP network endpoint.
This reduces network exposure at the MCP transport layer.
However, the MCP server process runs with the permissions of the local user account and can perform operations exposed by its registered tools.
MCP Server to AnkiConnect
The server communicates with AnkiConnect through an HTTP API.
AnkiConnect's network binding, origin restrictions, and optional API-key settings determine which processes or hosts can reach that API.
Keep AnkiConnect restricted to the local machine unless you intentionally need remote access and understand the security implications.
The selected MCP server's documentation should be checked before enabling AnkiConnect authentication options because the server must support the corresponding authentication flow.
Write and Destructive Operations
The server exposes operations that can modify the Anki collection.
Depending on the connected package version, these can include:
- creating decks;
- creating notes;
- creating notes in bulk;
- updating notes;
- deleting notes;
- creating note types;
- triggering synchronization.
Review destructive tool calls carefully.
Maintain current backups before allowing bulk modifications.
AI-Generated Content
AI-generated flashcards can contain factual mistakes, ambiguous wording, or misleading answers.
Review generated content before using it for:
- medical study;
- legal study;
- professional certifications;
- high-stakes exams.
Prompt Injection
Untrusted content can contain instructions designed to manipulate an AI agent.
This matters when content from web pages, PDFs, external notes, or other untrusted sources is processed in a session with state-changing MCP tools available.
Use least privilege, review tool calls, separate read workflows from write workflows when possible, and maintain backups.
See MCP security best practices for broader guidance.
Limitations
- Anki Desktop dependency. The documented setup assumes Anki Desktop and AnkiConnect are available locally for operations that access Anki data.
- No documented direct database integration. The selected server uses AnkiConnect rather than directly reading
.anki2files. - Local stdio-oriented setup. The documented configuration is designed for a local MCP client and Anki Desktop environment; the repository does not document a remote MCP endpoint for this implementation.
- Anki profile behavior depends on AnkiConnect and the active Anki environment. Verify the active profile before allowing bulk changes.
- Synchronization still depends on Anki's local state. Inspect Anki Desktop when sync requires user attention.
- Community-maintained project. Review releases, issues, and repository activity before depending on the server for important workflows.
Anki MCP Server Alternatives
nailuoGG/anki-mcp-server is not the only community project connecting MCP clients to Anki.
One alternative is:
ankimcp/anki-mcp-server
This is a separate project with a different architecture and project scope.
Its documentation describes additional deployment modes and a broader tool surface, including operations that interact with the Anki desktop interface.
Because runtime requirements, transports, tool names, tool counts, and project status can change between releases, verify the project's current primary documentation before choosing it.
Do not assume that:
- configuration from one Anki MCP server works with another;
- tool names are interchangeable;
- runtime requirements are identical;
- security characteristics are the same;
- remote deployment support exists in every implementation.
Choose an implementation based on the deployment model and tool surface you actually need.
FAQ
What is an Anki MCP Server?
An Anki MCP server connects an MCP-capable AI client to Anki. The implementation covered in this guide uses AnkiConnect as its integration layer so Claude and other clients can invoke tools for working with Anki data.
Is there an official Anki MCP Server?
No. Ankitects does not publish an official MCP server. The projects discussed in this guide are independent community implementations.
How do I connect Anki to Claude Desktop?
Install AnkiConnect, keep Anki Desktop running, add npx --yes anki-mcp-server to claude_desktop_config.json, and fully restart Claude Desktop.
Does Anki MCP Server require AnkiConnect?
Yes. The implementation covered in this guide uses AnkiConnect as its documented integration layer and does not document direct access to Anki's database.
Does Anki Desktop need to stay open?
For the documented implementation, Anki Desktop and AnkiConnect need to be available for operations that access Anki data.
What tools does Anki MCP Server provide?
The implementation exposes tools for working with decks, notes, note types, and synchronization. Check the current package documentation, source code, or tool discovery response for the exact public tool names available in the version you run.
Can Claude create and delete Anki notes?
Yes. The server exposes state-changing operations for creating notes and a destructive operation for deleting notes. Review destructive tool calls carefully and maintain current backups before allowing bulk changes.
Does Anki MCP Server work with Claude Code?
The project documents Claude Code usage, including an Agent Skill and standard MCP server configuration. The Agent Skill provides workflow guidance and does not replace the MCP server itself.
How do I test Anki MCP Server with MCP Inspector?
Clone the repository, install dependencies according to the current project documentation, and run the documented npm run inspector script. Use Inspector to examine startup, initialization, tool discovery, and tool-call failures.
Is Anki MCP Server safe to use?
The documented MCP connection uses local stdio and does not expose an MCP network endpoint. The main risks come from the server's ability to modify Anki data, AnkiConnect's HTTP API configuration, destructive operations, and unreviewed AI-generated content.
Final Verdict
For users who want to connect a local Anki Desktop installation to Claude or another compatible MCP client, nailuoGG/anki-mcp-server provides a relatively simple integration model: a local Node.js process, stdio-based MCP communication, and AnkiConnect as the bridge to Anki.
Its main strengths are straightforward local configuration, support for common Anki workflows, MCP resources, and compatibility with Claude-focused workflows.
Its main limitations are the dependency on the local Anki environment, the lack of a documented remote MCP endpoint for this implementation, community maintenance, and the risks that come with allowing an AI agent to modify personal data.
Use the documented npx setup for the simplest local configuration, inspect the server with MCP Inspector when debugging, review state-changing tool calls, maintain backups, and verify the current repository documentation before relying on version-specific tool names or behavior.
Want to analyze your API security?
Import your OpenAPI spec and generate a Security Report automatically.
Primary Sources and Project Documentation
nailuoGG/anki-mcp-server— primary community implementation covered in this guideankimcp/anki-mcp-server— alternative community implementation- AnkiConnect add-on page — add-on code
2055492159 - AnkiConnect repository maintained by FooSoft
- Anki Desktop documentation and downloads
- Model Context Protocol specification and documentation