Skip to main content

MCP server bridging Claude (Desktop / Code / .ai) to a flashcard-jp deployment.

Project description

flashcard-jp-mcp

MCP server that lets Claude (Desktop, Code, or .ai web via Connectors) add words to a flashcard-jp deployment. Once installed, you can chat with Claude like:

"Aggiungi al mio Test Mazzo: kau (acquistare), matsu (aspettare), asobu (giocare). Genera anche le frasi mnemoniche italiane."

Claude calls add_cards_bulk once and the words land in the deck.

Install (one line)

// ~/.claude/settings.json  (or `claude mcp add flashcard-jp -- uvx flashcard-jp-mcp`)
{
  "mcpServers": {
    "flashcard-jp": {
      "command": "uvx",
      "args": ["flashcard-jp-mcp"]
    }
  }
}

Restart Claude. The 6 tools below are available in chat.

How auth works

The first tool call asks you for an API token via MCP elicitation — Claude pops up a prompt explaining where to mint it. Paste the fjp_… value, the server saves it to ~/.config/flashcard-jp-mcp/config.json (perm 600), and you're done. Token resolution order:

  1. FLASHCARD_API_TOKEN env var (per-deployment override).
  2. ~/.config/flashcard-jp-mcp/config.json (set by the elicit prompt or by flashcard-jp-mcp-setup).
  3. MCP elicitation prompt (only if your client supports it; Claude Desktop and recent Claude Code do).
  4. Friendly error pointing at the setup recipe.

Mint the token (when Claude asks, or up-front)

  1. Open https://flashcard-jp-production.up.railway.app and log in with Google.
  2. Click 🔑 in the top navbar.
  3. Click Crea token, name it (e.g. claude-desktop), copy the fjp_… value (shown once).

Out-of-band setup (terminal, no Claude required)

uvx flashcard-jp-mcp-setup

The CLI prints the URL, reads the token from stdin, validates it against the API, and saves it to the config file. Useful for clients that don't support elicitation, or if you'd rather not expose the token through chat.

Override the API base

If you self-host flashcard-jp on a different URL, set FLASHCARD_API_BASE in the MCP env:

"env": {
  "FLASHCARD_API_BASE": "https://your-flashcard-jp.example.com"
}

Tools

Tool What it does
whoami Returns the authenticated user's email + last-studied deck id. Quick auth check.
list_decks Every deck visible to the user, with progress (cards_total, cards_done, cards_left, cards_available_today, completed).
get_deck(deck_id) A deck's full word list — useful so Claude can dedupe before adding.
create_deck(name) Create a private deck owned by the user.
add_card_to_deck(deck_id, romajii, kana, italiano, mnemonic?, emoji?) One word → Word + 2 Cards (forward + reverse).
add_cards_bulk(deck_id, cards) Several entries in one call, returns {added: [...], skipped: [...]}.

Romajii must be Hepburn, lowercase, ASCII (ohayoo, not ohayō). Kana should be the hiragana / katakana reading only — no kanji.

Environment variables

Var Default Required
FLASHCARD_API_BASE https://flashcard-jp-production.up.railway.app no
FLASHCARD_API_TOKEN yes

Limits

  • Starting decks (is_starting=True) are read-only. Trying to mutate one returns 403; the tool surfaces that as an error message Claude can show in the chat.
  • Token leaks: each token grants full deck-write access for the user it belongs to. Revoke from the web UI's 🔑 menu if exposed.

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flashcard_jp_mcp-0.2.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flashcard_jp_mcp-0.2.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file flashcard_jp_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: flashcard_jp_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for flashcard_jp_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c686abcb2053c2fc7104743f3d2e31bee38bacf2075e9511698b95a671c7f8a6
MD5 d6e9816e57b684dbe1409a20942d742f
BLAKE2b-256 cf2e16bc6d6364a59a94df7fc47fa21228950b7543a14a87dc495a6464341189

See more details on using hashes here.

File details

Details for the file flashcard_jp_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: flashcard_jp_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for flashcard_jp_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 154eaaa1101880ad9a031dbfd85f255eeb76c28a4cfeb98b0df0440f9e52a15e
MD5 a029a215cb1ad937223acaf8ed418f97
BLAKE2b-256 c456962bdf9c581e6ddbc1339fcb5d39b7f6f5eeb30f1fedebce87d0f6871430

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page