lorcana-mcp is an MCP (Model Context Protocol) server for the Disney Lorcana trading card game, enabling users to query cards, analyze decks, and build decks in natural language through Claude or other MCP clients.
Purpose This server is used within MCP clients to retrieve Disney Lorcana card information, perform rules-validated deck legality checks, view deck statistics, and round-trip import/export with Dreamborn/Pixelborn deck lists.
Main capabilities
- Card search: supports natural language queries by name (e.g., "Show me all cards named Moana"), color, rarity, cost, strength, willpower, lore value, and other criteria, as well as keyword and ability searches (e.g., Evasive, Bodyguard, Shift, Ward, Reckless, Singer, Resist, etc.). For ordinary keyword queries, it is recommended to use the keyword parameter to match the structured ability list; for queries with specific numeric values (e.g., Singer 5, Resist +2), it is recommended to use the body_text parameter, because keyword numeric values are stored in the card's full text.
- Statistics and aggregation: can count the number of cards per set, color distribution, most common traits, ink curve (number of cards at each cost), number of playable legendary cards, etc.
- Cross-criteria combined queries: for example, "How many amber characters have 3 or more lore?", "Find cheap (cost 2-3) characters with high strength (4+) in steel", "How many cards in set 1 have Evasive and cost less than 4?".
- Deck building: the build_deck(colors, playstyle="balanced") tool guides the model to assemble a legal deck according to the specified colors and playstyle (aggressive / control / lore-race / balanced), following rules such as at least 60 cards, at most two inks, and at most 4 copies of a card with the same name.
- Data scale: 2,506 unique cards, 3,192 printingsversions (including alternate art and promo cards), refreshed daily. Each card has a printings array storing different sets, numbers, and rarities; the same card is kept in only one row, so searching for "Elsa" will not show duplicates due to promo reprints.
- Output formats: search_cards supports the response_format parameter, which can be "json" (default, a list of card objects) or "toon" (a TOON string encoded by the toons Rust library, with a single row of column headers and one row per card). Because card structures vary (for example, spells and items have no strength/willpower/lore value), the outer cards use YAML-style per-card blocks, and the inner printings are a complete table.
- No third-party runtime dependencies: at startup, from https://danielenricocahall.github.io/lorcana-mcp/allCards.json it pulls the card JSON; this snapshot is fetched daily by data_pipeline/fetch_cards.py from the Lorcast API, normalized, and published to the gh-pages branch; at runtime it never calls Lorcast directly, so it is not affected by its availability or rate limits.
How to use It is recommended to run via uvx, with no need to clone the code or use Docker. It can also be configured in Claude Desktop's claude_desktop_config.json. The server is also published to GHCR and the MCP Registry. In container mode, a volume can be mounted to preserve the card cache across restarts. No ports are exposed; MCP communication is via stdio.
Available environment variables
- LORCANA_API (default:https://danielenricocahall.github.io/lorcana-mcp/allCards.json)
- LORCANA_CACHE_PATH (default: cards.json) — local cache file
- LORCANA_HTTP_TIMEOUT_SECONDS (default: 60)
- LORCANA_REFRESH_ON_STARTUP (default: false) — when true, always re-fetch and populate the store
- LORCANA_SKIP_IF_DB_EXISTS (default: true) — when false, re-fetch even if the cache already exists
Performance notes Tested with benchmarks/bench_toon.py on a live dataset of 2,506 cards (using tiktoken cl100k_base as a proxy for Claude's tokenizer), the TOON format reduces tokens compared to JSON. Due to the nested printings array, TOON's relative savings are smaller than before printings were merged (before merging, the same query was reduced by about 50%), but the absolute token count drops significantly because each unique card appears only once. Reproduction command: PYTHONPATH=. uv run python benchmarks/bench_toon.py (requires a populated cards.json cache).
Use cases Suitable for card retrieval, deck building and validation, card data statistical analysis in MCP clients such as Claude, and for players and developers who need to exchange deck lists with Dreamborn/Pixelborn.
Limitations and disclaimers This project is a personal, unofficial fan and engineering project, and is not affiliated with, endorsed, sponsored, or reviewed by Disney, Ravensburger, or the Disney Lorcana TCG team. The project is built and distributed in accordance with Ravensburger's Disney Lorcana TCG community guidelines and uses only public and community data sources. All Disney Lorcana TCG names, card text, trademarks, and related intellectual property belong to Disney and Ravensburger. The project is non-commercial and represents only the author's personal views, not those of their employer.
MCP Registry ownership verification: the registry reads the mcp-name line in the published package description to confirm ownership, identified as mcp-name: io.github.danielenricocahall/lorcana-mcp。