Skip to main content
Glama
Scryfall MCP Server
by latte-chan

Scryfall MCP Server

MCP server that exposes Scryfall (Magic: The Gathering) through simple, typed tools for MCP-compatible clients (Claude Desktop, Cursor, Continue, Zed, etc.). Now includes Commander Spellbook (combo database) integration.

Highlights

  • High-level server API via McpServer with typed inputs/outputs

  • Tools for common queries: full-text search, by colors/CMC/format, and Tagger-based searches

  • SSE or stdio transports

  • Polite rate limiting and 429 backoff (Scryfall and Commander Spellbook)

  • Optional local cache of Tagger tag lists

  • Optional local index mapping Scryfall oracle_id → Commander Spellbook card id

Related MCP server: Scryfall MCP Server

Requirements

  • Node.js >= 18.17

Install & Build

  • Install: npm install

  • Build: npm run build

Run (stdio)

  • node dist/index.js

Run (SSE HTTP)

  • npm run start:sse

  • Env: PORT=3000 (default), CORS_ORIGIN=* (optional)

Docker

  • Build: docker build -t scryfall-mcp:latest .

  • Run (SSE): docker run --rm -p 3000:3000 -v mcp_data:/data scryfall-mcp:latest

  • Override env:

    • SCRYFALL_INTERVAL_MS=100 (rate limiter)

    • TAGGER_CACHE_PATH=/data/tagger-tags.json

    • SCRYFALL_BASE_URL=https://api.scryfall.com

    • CSB_INTERVAL_MS=100 (rate limiter for Commander Spellbook)

    • CSB_BASE_URL=https://backend.commanderspellbook.com

    • CSB_CARD_INDEX_PATH=/data/csb-card-index.json

    • CSB_CARD_INDEX_TTL_MS=86400000

  • Stdio transport: docker run --rm -it scryfall-mcp:latest node dist/index.js

MCP Client Example (Claude Desktop)

{
  "mcpServers": {
    "scryfall": {
      "command": "node",
      "args": ["/absolute/path/to/dist/index.js"],
      "env": {
        "SCRYFALL_INTERVAL_MS": "100",
        "TAGGER_CACHE_PATH": "C:/path/to/cache/tagger-tags.json"
      }
    }
  }
}

Environment Variables

  • SCRYFALL_BASE_URL: API base URL (default https://api.scryfall.com)

  • SCRYFALL_INTERVAL_MS: Minimum ms between requests (default 100)

  • SCRYFALL_MAX_RETRIES: Max retries on 429 (default 3)

  • SCRYFALL_RETRY_BASE_MS: Base backoff ms (default 250)

  • TAGGER_CACHE_PATH: Local JSON path for Tagger tag lists (default ./cache/tagger-tags.json, Docker default /data/tagger-tags.json)

Commander Spellbook (CSB):

  • CSB_BASE_URL: API base URL (default https://backend.commanderspellbook.com)

  • CSB_INTERVAL_MS: Minimum ms between requests (default 100)

  • CSB_MAX_RETRIES: Max retries on 429 (default 3)

  • CSB_RETRY_BASE_MS: Base backoff ms (default 250)

  • CSB_CARD_INDEX_PATH: Cache file path for oracleId→CSB id index (default ./cache/csb-card-index.json)

  • CSB_CARD_INDEX_TTL_MS: TTL for index reuse in ms (default 86400000 = 24h)

Tools (Scryfall)

  • search_cards — Full-text search using Scryfall q syntax.

  • get_card — Fetch a card by id or name (fuzzy optional).

  • random_card — Random card, optional q filter.

  • autocomplete — Autocomplete card names.

  • list_sets — All sets.

  • get_rulings — Rulings by card id.

Guided search tools (structured results):

  • search_by_colors — Params: colors, mode (exact|contains|at_most), identity, include_colorless, page.

  • search_by_cmc — Params: min, max, colors, type, page.

  • search_by_format — Params: format, status (legal|banned|restricted), colors, page.

Tagger-powered tools:

  • list_tagger_tags — Returns { function: string[], art: string[] } from docs page (cached).

  • search_by_function_tag — Params: tags[], match (any|all), colors?, format?, page? (uses otag:).

  • search_by_art_tag — Params: tags[], match (any|all), colors?, type?, page? (uses arttag:).

  • read_tagger_cache — Read cached tags without network.

  • refresh_tagger_tags — Force refresh tags and write cache.

Notes:

  • Many tools return structuredContent with compact card summaries: name, mana_cost, type_line, oracle_text, set, collector_number, scryfall_uri, image, prices.

  • Some basic tools return content text (JSON stringified) for compatibility.

Commander Spellbook Tools

  • csb_parse_deck_text — Parse plain-text decklist to cards via CSB.

    • Input: { text: string }

  • csb_find_combos_by_card_ids — Find combos included/almost-included by CSB numeric card IDs.

    • Input: { ids: number[], limit?: number, offset?: number }

  • csb_variants_search — Search variants (combos) by filters like uses (card id) or produces (feature id).

    • Input: { uses?: number, produces?: number, of?: number, limit?: number, offset?: number }

  • csb_card — Fetch CSB card by numeric id.

    • Input: { id: number }

  • csb_build_card_index — Build and cache oracleId→CSB id index (paginates /cards).

  • csb_read_card_index — Read the cached index without network.

  • csb_lookup_by_oracle_ids — Map Scryfall oracle_id UUIDs to CSB numeric ids using the cached index.

    • Input: { oracleIds: string[] }

  • csb_find_combos_by_names — Resolve names via Scryfall → oracle_id, map via cached index, then call find-my-combos.

    • Input: { names: string[], fuzzy?: boolean, limit?: number, offset?: number }

Notes:

  • CSB’s card-list-from-text expects Content-Type: text/plain (handled by the tool).

  • The csb_find_combos_by_names tool benefits from building the index first: run csb_build_card_index once per day or set a custom TTL.

API Etiquette

  • All requests send a descriptive User-Agent.

  • Default limiter targets ~10 req/s (100ms between starts) and backs off on HTTP 429, honoring Retry-After (applies to both Scryfall and CSB).

Development

  • Build: npm run build

  • StdIO dev: npm run start:stdio

  • SSE dev: npm run start:sse

  • random_card:

    • Input: { q?: string }

  • autocomplete:

    • Input: { q: string }

  • list_sets:

    • Input: none

  • get_rulings:

    • Input: { id: uuid }

Notes

  • Scryfall rate limits: be respectful (they suggest up to ~10 requests/sec). This server does not add extra rate limiting; your client should avoid flooding requests.

  • Responses are returned as JSON content for maximum fidelity; clients can post-process or render summaries.

SSE Transport Endpoints

  • Events stream (server -> client via EventSource): GET /sse

  • Messages endpoint (client -> server): POST /messages

Point your MCP client’s SSE transport at these endpoints on your configured host/port.

Development

  • Build: npm run build

  • Start (built): npm start

  • Edit source in src/ and rebuild.

License

No license specified. Add one if you plan to distribute.

Available Tools

22 tools
autocompleteC

Autocomplete card names based on a partial query.

Inputs: q (required).

csb_build_card_indexCSB: Build card indexB

Rebuild oracleId→CSB id index and write cache.

Inputs: no named parameters. Returns: path, size, total, builtAtMs

csb_cardCSB: Get cardB

Fetch Commander Spellbook card by numeric ID.

Inputs: id (required).

csb_find_combos_by_card_idsCSB: Find combos by card IDsC

Find combos that the provided cards enable (exact and almost-included).

Inputs: ids (required), limit, offset.

csb_find_combos_by_namesCSB: Find combos by card namesB

Resolve names via Scryfall → oracle_id, map to CSB IDs via cached index, then call find-my-combos.

Inputs: names (required), fuzzy, limit, offset.

csb_lookup_by_oracle_idsCSB: Lookup by oracle IDsA

Map Scryfall oracle_id UUIDs to Commander Spellbook numeric IDs using the local index (builds if stale).

Inputs: oracleIds (required). Returns: found, missing

csb_parse_deck_textCSB: Parse deck textB

Parse a plain-text decklist into cards using Commander Spellbook.

Inputs: text (required). Returns: main, commanders

csb_read_card_indexCSB: Read card indexB

Read oracleId→CSB id index from local cache.

Inputs: no named parameters. Returns: path, size, total, cachedAtMs

get_cardB

Get a single card by Scryfall UUID or by name (exact/fuzzy).

Inputs: id, name, fuzzy.

get_rulingsC

Get official rulings for a card by Scryfall UUID.

Inputs: id (required).

list_setsB

List all sets available on Scryfall.

Inputs: no named parameters.

list_tagger_tagsList Tagger tagsB

Fetches Scryfall Tagger tag names from the public docs page.

Inputs: no named parameters. Returns: art, function

random_cardB

Fetch a random card, optionally filtered by a 'q' search query.

Inputs: q.

read_tagger_cacheRead Tagger cacheA

Read tags from local cache file without network.

Inputs: no named parameters. Returns: art, function, cachePath, cachedAtMs

refresh_tagger_tagsRefresh Tagger tagsB

Force refresh Tagger tags from docs and write local cache.

Inputs: no named parameters. Returns: path, counts

search_by_art_tagSearch by art tagB

Find cards using Tagger artwork tags, e.g. squirrel, dragon, wizard.

Inputs: tags (required), match, colors, type, +1 more. Returns: total, results

search_by_cmcSearch by mana valueB

Find cards within a mana value range, optionally filtered by color and type.

Inputs: min, max, colors, type, +1 more. Returns: total, results

search_by_colorsSearch by colorsB

Find cards by colors or color identity.

Inputs: colors, mode, include_colorless, identity, +1 more. Returns: total, results

search_by_formatSearch by format legalityB

Find cards by legality in a given format.

Inputs: format (required), status, colors, page. Returns: total, results

search_by_function_tagSearch by function tagB

Find cards using Tagger function (oracle) tags, e.g. removal, ramp.

Inputs: tags (required), match, colors, format, +1 more. Returns: total, results

search_cardsC

Search cards using Scryfall's powerful full-text syntax.

Inputs: q (required), unique, order, dir, +4 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 22 tools

    Disambiguation4/5

    Most tools have distinct purposes, such as get_card for single cards, search_cards for full-text queries, and csb_find_combos_by_card_ids for combo analysis. However, some overlap exists between search_by_art_tag/search_by_function_tag and search_cards, which could cause minor confusion in tool selection.

    Naming Consistency3/5

    Naming conventions are mixed, with some tools using verb_noun patterns like get_card or list_sets, while others use descriptive phrases like csb_find_combos_by_card_ids or search_by_art_tag. This inconsistency reduces predictability but remains readable overall.

    Tool Count3/5

    With 22 tools, the count is borderline high for a Scryfall server, as it includes both core Scryfall operations and Commander Spellbook integration. While comprehensive, it may feel heavy and could benefit from consolidation or clearer scoping.

    Completeness5/5

    The tool set provides complete coverage for the Scryfall domain, including card retrieval, searching by various criteria, set listing, rulings, and integration with Commander Spellbook for combos. No obvious gaps are present, supporting full agent workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables fuzzy lookup of Magic: The Gathering cards by name using the Scryfall API, returning card details including type, oracle text, mana value, and images.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables Claude to search and retrieve Magic: The Gathering card details, prices, set information, and random cards from Scryfall's database through natural language.
      4
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides AI assistants with access to Magic: The Gathering card data via Scryfall API, enabling card search, image downloads, and database management.
      16 npm
      2
      Apache 2.0
    • A
      license
      A
      quality
      D
      maintenance
      Provides AI assistants with comprehensive Magic: The Gathering data including card info, combos, draft analytics, Commander metagame, constructed formats, sideboard strategy, deck building, and rules.
      74
      MIT