DictDeck is a self-hosted AI dictionary, translator, and vocabulary flashcard app. It brings together built-in dictionaries, streaming LLM explanations (OpenAI, Gemini, Vertex AI, Anthropic, Workers AI, and OpenAI Codex OAuth), a Master-Detail vocabulary notebook, tactile review flashcards, a cross-browser extension, a Streamable HTTP MCP server, a Telegram bot, and Cloudflare Workers deployment.
- Cloudflare API token requires
D1andWorkers AIpermissions. - Either
d1 database idord1 database namemust be provided.
- Dictionary Desk: Look up words and sentences across built-in dictionaries (Weblio, コトバンク, Hujiang, Google Translate) or custom LLM providers with live streaming, collapsible thinking notes, language swap, and
⌘K/⌘↵/⌘Sshortcuts. - Vocabulary Workbench: Master-Detail lexicon browser with a compact index on the left, spacious reading pane on the right, optional Quiz veil self-test mode, and keyboard navigation (
↑/↓,Space,R,E). - Daily Review Deck: Multi-card physical flashcard stack with drag gestures, directional stamps, keyboard shortcuts (
Space,←,→,Backspace), and review progress tracking. - Themes & Settings: Built-in Light / Auto / Dark theme switching, LLM provider management, Telegram integration, and MCP access token management.
| Dictionary Desk | Vocabulary Workbench |
|---|---|
![]() |
![]() |
| Daily Review Deck | Dark Mode |
|---|---|
![]() |
![]() |
Local development (includes MSW mock handlers):
cd web
npm install
npm run devDictDeck includes a browser extension (Chrome, Firefox, and Safari) for translating selected text on any webpage:
- In-Page Selection Panel: Floating Shadow DOM lookup card with streaming responses, collapsible thinking notes, quick source/language/prompt-mode switching, one-click save to Words or Grammar, and automatic Light/Dark theme matching.
- Popup & Options: Quick connection status, recent lookup history, server authentication with locally encrypted credentials, and default translation settings.
| Selection Panel (Light) | Selection Panel (Dark) |
|---|---|
![]() |
![]() |
| Popup (Light) | Popup (Dark) | Options |
|---|---|---|
![]() |
![]() |
![]() |
Local build:
cd web
npm install
npm run build:extensionBuild outputs:
web/extension-dist/chrome— unpacked Chrome extensionweb/extension-dist/firefox— unpacked Firefox extensionweb/extension-dist/safari— generated Safari projectweb/extension-dist/safari-app— built Safari macOS app
Notes:
- Safari packaging is built on macOS and requires Xcode / Command Line Tools.
- The Safari app is generated so the extension can be enabled through Safari on macOS.
The GitHub Actions workflow at .github/workflows/rust.yaml builds and uploads extension artifacts on macOS:
dictdeck-extension-chrome.zipdictdeck-extension-firefox.zipdictdeck-extension-safari-project.zipdictdeck-extension-safari-app.zip
These files are uploaded as workflow artifacts in CI, and the release workflow also includes them in release assets.
Build and run:
cargo build --release
./target/release/hj jc こんにちはSupported commands:
jc <word>— Japanese to Chinesecj <word>— Chinese to Japanesekr <word>— Korean <-> Chineseen <word>— English <-> Chineseweblio <word>— Weblioktbk <word>— コトバンクgoogle <target> <words>— Google Translate, e.g.google en こんにちは
Examples:
./target/release/hj jc こんにちは
./target/release/hj cj 你好
./target/release/hj kr 안녕하세요
./target/release/hj en hello
./target/release/hj en 你好
./target/release/hj weblio こんにちは
./target/release/hj ktbk 子供
./target/release/hj google ja Hello world!Telegram bot, HTTP API, and scheduled reminder jobs run on Cloudflare Workers.
Configure wrangler.toml and deploy:
vim wrangler.toml
# set the production JWT signing secret outside source control
npx wrangler secret put AUTH_SECRET
# build web frontend
cd web && npm install && npm run build && cd ..
# build and deploy worker
cargo install worker-build --version 0.8.6
npx wrangler deploywrangler.toml config example:
WORKER_NAME="dictdeck" # cloudflare workers name
SCHEDULE="*/20 0-15 * * *" # cron scheduleRegister Telegram webhook:
curl https://<workers-url>/tgbot/registerThe Worker exposes a Streamable HTTP MCP endpoint at /mcp. In the web Settings page, generate a token with dictionary:read and/or dictionary:write permission. The plaintext token is shown only once; send it as a Bearer token:
curl https://<workers-url>/mcp \
-H 'Authorization: Bearer mcp_...' \
-H 'Accept: application/json, text/event-stream' \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Read access provides dictionary.search and dictionary.get. Write access adds save, rename, delete, priority, and preview/apply batch-change tools. Set MCP_ALLOWED_ORIGINS to a comma-separated origin allowlist when browser-based MCP clients are used.
If using Cloudflare Workers Git integration, configure the following commands:
Build Command:
cd web && npm install && npm run build && cd ..
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh
sh rustup.sh -y
export PATH="$HOME/.cargo/bin:$PATH"
cargo install worker-build --version 0.8.6Deploy Command:
export PATH="$HOME/.cargo/bin:$PATH"
npx wrangler deploy











