Scryfall MCP Server
The Scryfall MCP Server integrates with the Scryfall API to provide comprehensive Magic: The Gathering card data and functionality to AI assistants like Claude.
Core Search & Lookup
Search cards using Scryfall's powerful search syntax with pagination, sorting, and filtering
Get detailed card information by name, set code, or Scryfall ID with image support
Retrieve current card prices in various currencies with format context
Find random cards with optional filters for discovery
Search Magic sets with filtering by type, release date, and name
Access complete bulk card database with daily updates and set metadata
Natural Language & Query Building
Convert natural language requests into optimized Scryfall queries with explanations and alternatives
Build budget-friendly searches with price constraints and optimization strategies
Generate format-specific queries for competitive play
Lightweight query syntax validation with helpful error messages
Deck Building & Analysis
Analyze deck composition including mana curve, card types, and balance recommendations
Suggest optimal mana bases based on color requirements, budget, and strategy
Find synergistic cards for specific themes, archetypes, or commanders
Validate Brawl/Commander legality for format compliance
Generate comprehensive card analyses including competitive viability and meta positioning
Create deck building guides centered around specific cards
Competitive & Budget Tools
Find format staples and meta cards by role, tier, and price range
Discover budget alternatives and upgrades for expensive cards
Search comprehensive rules for specific interactions and clarifications
Batch analyze multiple cards for legality, prices, and synergies
Performance & Reliability
Intelligent caching reducing API calls by >70% with configurable TTL
Rate limiting compliance with automatic retries and exponential backoff
Graceful error handling and circuit breaker functionality
Performance monitoring, cache statistics, and health checks
Structured logging for debugging and monitoring
Claude Desktop integration for seamless AI assistant usage
Utilizes environment configuration through .env files for server customization.
Hosts the server repository for cloning and contributing through GitHub's platform.
Provides specific configuration instructions for Claude Desktop integration on macOS systems.
Integrates with the Scryfall API to provide comprehensive Magic: The Gathering card information, search capabilities, price data, set information, and deck building assistance.
Runs as a Node.js application, with specific version requirements (Node.js 18+) for server operation.
Uses npm for package management, dependency installation, and running server commands.
Implements development guidelines following TypeScript best practices.
Supports Yarn as an alternative package manager for dependency installation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Scryfall MCP Servershow me budget red creatures for commander under $5"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Scryfall MCP Server
Scryfall-backed MCP server for Magic: The Gathering search, rules lookup, pricing, set discovery, and deckbuilding workflows.
The project currently supports:
stdioas the primary transport for local MCP clientslocal-first Streamable HTTP via
src/http.ts14 MCP tools, 2 resources, and 2 prompts
What It Exposes
Tools
search_cards: Run Scryfall card searches with paging, sorting, and optional price filtering.get_card: Fetch one card by name, set/collector number, or Scryfall ID.get_card_prices: Return price data with optional format context and alternatives.random_card: Get a random card with optional filters.search_sets: Search and filter Magic sets.query_rules: Search the local comprehensive rules file with context.build_scryfall_query: Convert natural language into an explainable Scryfall query.search_format_staples: Find staples and role players for a format.search_alternatives: Find cheaper, upgraded, or similar cards.find_synergistic_cards: Find synergy pieces for a card, theme, or archetype.batch_card_analysis: Analyze multiple cards for legality, prices, synergy, or composition.validate_brawl_commander: Check Brawl and Standard Brawl commander legality.analyze_deck_composition: Evaluate deck lists for curve, colors, and structural issues.suggest_mana_base: Recommend land counts and fixing packages from color requirements.
Resources
card-database://bulk: Cached Oracle bulk snapshot.set-database://all: Cached set list snapshot.
Prompts
analyze_cardbuild_deck
Related MCP server: API Tester MCP Server
Transports
STDIO
Recommended for Claude Desktop, Codex, MCP Inspector, and most local MCP clients.
npm run devnpm startStreamable HTTP
Available as a separate entrypoint for local or explicitly controlled environments.
npm run dev:httpnpm run start:httpFor local MCP testing:
npm run dev:http:local
npm run smoke:httpThe smoke test checks /health, performs MCP initialize, sends notifications/initialized, and verifies tools/list.
It also makes representative validate_brawl_commander and search_cards tool calls so the local HTTP endpoint is checked beyond discovery.
Current HTTP behavior:
binds to
127.0.0.1by defaultserves
POST|GET|DELETEon/mcpserves
GET /healthrejects non-loopback
Originheaders by default unlessHTTP_ALLOWED_ORIGINSis set
The HTTP entrypoint is useful today, but it is still documented conservatively. It is not presented here as a public-hosting story.
Setup
Prerequisites
Node.js 18+
npm
Install
git clone https://github.com/bmurdock/scryfall-mcp.git
cd scryfall-mcp
npm install
cp .env.example .envValidate
npm run lint
npm run type-check
npm testBuild
npm run buildCommon Commands
npm run dev
npm run dev:http
npm start
npm run start:http
npm test
npm run test:watch
npm run test:ui
npm run lint
npm run type-check
npm run inspectorConfiguration
See .env.example for the canonical values. The main variables in active use are:
SCRYFALL_USER_AGENTRATE_LIMIT_MSRATE_LIMIT_QUEUE_MAXSCRYFALL_TIMEOUT_MSCACHE_MAX_SIZECACHE_MAX_MEMORY_MBLOG_LEVELNODE_ENVHEALTHCHECK_DEEPHTTP_HOSTHTTP_PORTHTTP_MCP_PATHHTTP_HEALTH_PATHHTTP_SESSION_IDLE_MSHTTP_SESSION_CLEANUP_INTERVAL_MSHTTP_ALLOWED_ORIGINS
Operational notes:
Scryfall API calls are globally serialized by the shared rate limiter. Batch tools may schedule multiple local lookups, but upstream Scryfall request completion remains one-at-a-time by design.
The default pacing is 100 ms for general API endpoints and at least 500 ms for Scryfall's 2/sec card endpoints:
/cards/search,/cards/named,/cards/random, and/cards/collection.HTTP 429 responses are not retried automatically. The server records Scryfall's throttle window and delays the next request start so callers can decide whether to retry.
CACHE_MAX_MEMORY_MBcontrols whether large in-memory snapshots, includingcard-database://bulk, can be retained. Bulk resource rebuilds stream to a temp file first; oversized snapshots remain on disk for warm reads instead of being retained in memory.Card detail output includes Scryfall source links and artist attribution when available. Consumers that render Scryfall image URLs should preserve copyright, artist, and source context and should not crop, distort, recolor, watermark, or imply ownership of card images.
Deck-list analysis resolves card names exactly first, then falls back to fuzzy lookup for exact misses and reports any fuzzy resolutions in the response.
Deck-scale tools may return partial analysis or an explicit retry-after message when Scryfall throttles the underlying card lookups.
Streamable HTTP sessions expire after
HTTP_SESSION_IDLE_MSand are checked byHTTP_SESSION_CLEANUP_INTERVAL_MS.
Example local HTTP startup:
HTTP_HOST=127.0.0.1 HTTP_PORT=3000 npm run start:httpExample Tool Calls
build_scryfall_query
{
"natural_query": "blue counterspells under $20 for modern",
"optimize_for": "precision"
}search_cards
{
"query": "c:r t:instant mv=1",
"limit": 10,
"order": "name"
}search_sets
{
"type": "expansion",
"released_after": "2020-01-01"
}find_synergistic_cards
{
"focus_card": "Obeka, Splitter of Seconds",
"synergy_type": "theme",
"format": "commander",
"color_identity": "UBR",
"limit": 12
}For commander-like workflows, pass color_identity when the focus is a theme rather than a resolvable card. When the focus resolves to a card, the tool infers that card's color identity and filters final results by requested legality, Arena availability, and color identity.
analyze_deck_composition
{
"deck_list": "4 Lightning Bolt\n4 Monastery Swiftspear\n20 Mountain",
"format": "modern",
"strategy": "aggro"
}Claude Desktop Integration
Add the built stdio entrypoint to your Claude Desktop configuration.
macOS path: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows path: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"scryfall": {
"command": "node",
"args": ["/absolute/path/to/scryfall-mcp/dist/index.js"]
}
}
}Operational Notes
Rate limiting is enforced in-process with a 100 ms default minimum interval between general Scryfall API requests and a 500 ms minimum for Scryfall's 2/sec card endpoints.
Search responses, card details, prices, sets, and bulk snapshots are cached with bounded in-memory limits.
The bulk card resource streams rebuilds through disk and stores a pre-serialized snapshot to keep repeated reads cheap.
Set filtering is derived from one canonical cached
/setsdataset to avoid incorrect filtered cache reuse.Health checks are available through
ScryfallMCPServer.healthCheck()and the HTTP/healthendpoint.If an MCP connector reports a JSON-RPC/SSE deserialization error, compare it against the raw HTTP smoke path:
npm run dev:http:local
npm run smoke:httpIf the smoke command succeeds, capture the connector error text and the smoke output together; that separates local endpoint framing from connector-specific parsing.
Documentation Map
Current source-of-truth docs:
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bmurdock/scryfall-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server