Web app to scan Magic: The Gathering cards with a laptop or phone camera, identify them using local AI (Ollama), look them up on Scryfall, and store them in a local collection database compatible with Archidekt.
Works on desktop and mobile browsers — no cloud AI required.
- Python 3.12+
- Node.js 18+
- Ollama installed and running
- Git
git clone https://github.com/cflury/mtg-scanner.git
cd mtg-scannersetup.batThis will:
- Install frontend npm packages
- Create a Python virtual environment
- Install Python dependencies
- Pull the
moondream2vision model via Ollama
start.batOpens two terminal windows (backend + frontend) and launches http://localhost:5173 in your browser.
- Allow camera access when prompted
- Toggle Front / Rear camera as needed
- Hold a card up to the camera viewfinder
- Click Scan Card
- Review the match (card image, name, set, rarity)
- Adjust quantity/condition/finish, then click Add to Collection
- Search by name
- Filter by rarity or color
- Export your collection as an Archidekt-compatible CSV
- Import an existing Archidekt CSV (bulk import)
If you already have an Archidekt export, import it via the Collection tab → Import CSV button, or run directly:
cd backend
venv\Scripts\python.exe importer.py "C:\path\to\your\archidekt-export.csv"Frontend (React + Tailwind, port 5173)
↕ /api/* (proxied by Vite)
Backend (FastAPI, port 8000)
↕ ↕
SQLite DB Ollama (local)
moondream2 — card vision
qwen2.5:7b — text tasks
↕
Scryfall API (card metadata, images)
| Layer | Technology |
|---|---|
| Backend | FastAPI, SQLAlchemy, SQLite |
| Vision AI | Ollama moondream2 |
| Text AI | Ollama qwen2.5:7b |
| OCR fallback | EasyOCR |
| Card data | Scryfall REST API |
| Frontend | React, TypeScript, Tailwind CSS, Vite |
While running locally, other devices on the same WiFi can access the app at:
http://<your-local-ip>:5173
Find your local IP with ipconfig (look for IPv4 under your WiFi adapter).
Camera access on mobile requires HTTPS or localhost. For full mobile support, consider running behind a local reverse proxy with a self-signed cert.
ollama pull moondream2 # Vision recognition (~1.7 GB)
ollama pull qwen2.5:7b # Text tasks (~4.4 GB) — likely already installed