Skip to main content
Glama
johnhnguyen97

Japanese Anki MCP Server

README.md
# Japanese Anki MCP Server

A Model Context Protocol (MCP) server for Japanese language learning with Anki. Features include:

- **Vocabulary Card Creation** - Add Japanese vocabulary cards with furigana, readings, and audio
- **reMarkable Integration** - Extract vocabulary from handwritten notes using Claude Vision OCR
- **Bulk Import** - Add multiple cards at once
- **Full Anki Management** - Decks, models, search, tags, sync

## Installation

```bash
npm install
npm run build
```

## Configuration

Create a `.env` file (see `.env.example`):

```env
# Required for reMarkable OCR
ANTHROPIC_API_KEY=sk-ant-...

# Optional: reMarkable cloud access
REMARKABLE_DEVICE_TOKEN=...
```

## Usage with Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "japanese-anki": {
      "command": "node",
      "args": ["C:/Users/jnguyen/Documents/Project/MCP/japanese_anki_mcp/dist/index.js"]
    }
  }
}
```

## Available Tools

### Anki Connection
- `anki_check_connection` - Verify AnkiConnect is running

### Deck Management
- `anki_list_decks` - List all decks
- `anki_create_deck` - Create a new deck
- `anki_get_deck_stats` - Get deck statistics

### Note Models
- `anki_list_models` - List note models
- `anki_get_model_fields` - Get fields for a model
- `anki_create_japanese_model` - Create a Japanese vocabulary model

### Notes
- `anki_add_japanese_vocab` - Add a single vocabulary card
- `anki_add_bulk_vocab` - Add multiple cards
- `anki_search_notes` - Search notes
- `anki_get_note_info` - Get note details
- `anki_update_note` - Update a note
- `anki_delete_notes` - Delete notes
- `anki_manage_tags` - Add/remove tags

### Sync
- `anki_sync` - Sync with AnkiWeb

### reMarkable Integration
- `remarkable_register` - Register with reMarkable cloud
- `remarkable_list_notebooks` - List notebooks
- `remarkable_extract_vocab` - Extract vocabulary from an image
- `remarkable_extract_vocab_base64` - Extract from base64 image
- `remarkable_to_anki` - Full pipeline: image → OCR → Anki cards

## reMarkable Workflow

### Option 1: Cloud Integration

1. Run `remarkable_register` with a one-time code from https://my.remarkable.com/device/desktop/connect
2. Save the device token to your `.env` file
3. Use `remarkable_list_notebooks` to see your notebooks

### Option 2: Export Images (Recommended)

1. Export pages from reMarkable as PNG/PDF
2. Use `remarkable_extract_vocab` with the image path
3. Or use `remarkable_to_anki` for the full pipeline

## Example Usage

```
# Add a vocabulary card
anki_add_japanese_vocab(
  deck_name="Japanese::Vocabulary",
  model_name="Basic",
  word="食べる",
  reading="たべる",
  meaning="to eat"
)

# Extract vocabulary from handwritten notes
remarkable_to_anki(
  image_path="C:/Users/jnguyen/notes/lesson1.png",
  deck_name="Japanese::Vocabulary"
)
```

## Requirements

- Node.js 18+
- Anki with AnkiConnect plugin (addon code: 2055492159)
- Anthropic API key (for Vision OCR)

## License

MIT