MCP Server

The main MCP server implementation that exposes Anki functionality to LLMs.

MCP Server implementation for Anki.

This module provides the main MCP (Model Context Protocol) server implementation that exposes Anki functionality to LLMs like Claude. It handles tool registration, request routing, and response formatting.

class mousetail.mcp.server.AnkiMCPServer[source]

Bases: object

MCP Server for Anki operations.

This class implements the Model Context Protocol server that provides LLMs with access to Anki collections. It manages tool definitions, handles incoming requests, and coordinates with the CollectionManager to perform operations on Anki databases.

server

The underlying MCP Server instance.

manager

CollectionManager instance for database operations.

Example

>>> server = AnkiMCPServer()
>>> mcp_server = server.get_server()
__init__()[source]

Initialize the Anki MCP server.

Creates a new MCP server instance named “anki-mcp” and sets up all tool handlers for Anki operations.

get_server()[source]

Get the MCP server instance.

Return type:

Server

Returns:

The configured MCP Server instance ready for use.

AnkiMCPServer Class

class mousetail.mcp.server.AnkiMCPServer[source]

Bases: object

MCP Server for Anki operations.

This class implements the Model Context Protocol server that provides LLMs with access to Anki collections. It manages tool definitions, handles incoming requests, and coordinates with the CollectionManager to perform operations on Anki databases.

server

The underlying MCP Server instance.

manager

CollectionManager instance for database operations.

Example

>>> server = AnkiMCPServer()
>>> mcp_server = server.get_server()
__init__()[source]

Initialize the Anki MCP server.

Creates a new MCP server instance named “anki-mcp” and sets up all tool handlers for Anki operations.

get_server()[source]

Get the MCP server instance.

Return type:

Server

Returns:

The configured MCP Server instance ready for use.