scryfall-mcp-server

scryfall-mcp-server

MCP server that searches and retrieves Magic: The Gathering card data from the Scryfall API.

Category
访问服务器

README

Scryfall MCP Server

A Model Context Protocol (MCP) server that surfaces the Scryfall API for Magic: The Gathering card data. Deployed on Cloudflare Workers.

Quick Start

Configure your AI client to connect to the deployed instance of the server or download this repo and run it locally.

Claude Desktop

To use this MCP server with Claude Desktop, you'll need the mcp-remote proxy.

  1. Open Claude Desktop settings: Settings > Developer > Edit Config

  2. Add this configuration:

    {
      "mcpServers": {
        "scryfall": {
          "command": "npx",
          "args": [
            "mcp-remote",
            "https://scryfall-mcp-server.colin-hauch.workers.dev/sse"
          ]
        }
      }
    }
    
  3. Restart Claude Desktop

Local Development

{
  "mcpServers": {
    "scryfall": {
      "command": "npx",
      "args": ["mcp-remote", "http://localhost:8787/sse"]
    }
  }
}

Cloudflare AI Playground

  1. Go to https://playground.ai.cloudflare.com/
  2. Pick a model (mistral-small-3.1-24b-instruct is selected by default here)
  3. Enter your MCP server URL: https://scryfall-mcp-server.colin-hauch.workers.dev
  4. Start using the Scryfall tools!

Other MCP Clients

Any MCP-compatible client can connect to the server via:

  • SSE endpoint: /sse (recommended for most clients)
  • MCP endpoint: /mcp (for clients that support direct MCP protocol)

Features

  • Search Cards: Find Magic cards using Scryfall's powerful search syntax
  • Get Card Details: Retrieve specific cards by name with fuzzy matching
  • Random Cards: Get random cards with optional filtering
  • Field Selection: Control exactly which card data is returned to optimize context usage

Available MCP Tools

search_cards

Search for Magic cards using Scryfall's search syntax. Returns all results from the current page (up to 175 cards).

Parameters:

  • query (string, required): Search query using Scryfall syntax
    • Examples: "lightning bolt", "type:creature color:red", "f:commander pow>=5"
  • unique (string, optional): Strategy for omitting similar cards
    • Options: "cards", "art", "prints"
  • order (string, optional): Sort order
    • Options: "name", "set", "released", "rarity", "color", "usd", "cmc", "power", "toughness", "edhrec"
  • dir (string, optional): Sort direction
    • Options: "auto", "asc", "desc"
  • page (number, optional): Page number for pagination (1-based). Use to access results beyond the first 175.
  • fields (array or string, optional): Control which card data is returned (defaults to "minimal")
    • Predefined groups: "minimal", "gameplay", "pricing", "imagery", "full"
    • Custom array: ["name", "mana_cost", "prices.usd"]
    • See "Field Selection" section below for details

Example:

{
  "query": "type:creature power>=5",
  "order": "power",
  "fields": "gameplay"
}

Pagination example:

{
  "query": "type:creature",
  "page": 2
}

get_card_details

Get detailed information for one or more cards by exact name. Uses Scryfall's collection endpoint for efficient bulk lookups (up to 75 cards per request with a single API call).

Parameters:

  • names (array of strings, required): Exact card names to search for (can be single or multiple, max 75)
  • set (string, optional): Filter by set code for all cards (e.g., "mkm", "one")
  • fields (array or string, optional): Control which card data is returned (defaults to "gameplay")
    • Predefined groups: "minimal", "gameplay", "pricing", "imagery", "full"
    • Custom array: ["name", "mana_cost", "prices.usd"]
    • See "Field Selection" section below for details

Note: This tool uses exact name matching. Card names must match exactly (case-insensitive).

Examples:

Single card:

{
  "names": ["Black Lotus"],
  "fields": ["name", "mana_cost", "prices", "legalities"]
}

Multiple cards:

{
  "names": ["Black Lotus", "Mox Ruby", "Ancestral Recall"],
  "fields": "gameplay"
}

get_random_card

Get a random Magic card.

Parameters:

  • query (string, optional): Filter random selection using Scryfall search syntax (e.g., "type:creature")
  • fields (array or string, optional): Control which card data is returned
    • Predefined groups: "minimal", "gameplay", "pricing", "imagery", "full"
    • Custom array: ["name", "mana_cost", "prices.usd"]
    • See "Field Selection" section below for details

Example:

{
  "query": "type:legendary",
  "fields": "minimal"
}

Field Selection

All card-related tools support optional field selection to control which data is returned, helping you optimize context usage in your AI workflows.

Predefined Field Groups

Use these convenient presets for common use cases:

  • "minimal" - Essential card info: name, mana_cost, type_line, oracle_text
  • "gameplay" - Gameplay-relevant data: minimal + colors, color_identity, cmc, power, toughness, loyalty, rarity
  • "pricing" - Price information: name, prices
  • "imagery" - Image data: name, artist, image_uris, illustration_id
  • "full" - All available fields (default when fields is not specified)

Custom Field Arrays

Specify exactly which fields you need:

{
  "name": "Lightning Bolt",
  "fields": ["name", "mana_cost", "oracle_text", "prices.usd"]
}

Nested Fields

Access nested object properties using dot notation:

{
  "query": "format:vintage",
  "fields": ["name", "prices.usd", "prices.eur", "image_uris.normal"]
}

Available Fields Reference

The MCP server provides a resource at scryfall://fields/reference with a complete list of all available fields. Access this through your MCP client to see all options.

Examples

Minimal context for quick lookups:

{
  "query": "lightning bolt",
  "fields": "minimal"
}

Price checking:

{
  "names": ["Mox Ruby"],
  "fields": ["name", "set", "prices.usd", "prices.usd_foil"]
}

Gameplay analysis:

{
  "query": "type:creature cmc<=2",
  "fields": "gameplay"
}

MCP Resources

The server exposes additional resources for enhanced functionality:

scryfall://search-syntax/full

Complete reference guide for Scryfall search syntax with all keywords, operators, and advanced filters.

scryfall://fields/reference

Complete list of available fields for custom field selection with examples and usage guidance.

Rate Limiting & Performance

The server implements comprehensive rate limiting to respect Scryfall API guidelines:

  • Proactive rate limiting: 100ms delay between requests
  • Automatic retries: Exponential backoff on HTTP 429 errors (1s → 2s → 4s)
  • Error handling: Structured error responses with detailed messages

License

This project is provided as-is for portfolio and educational purposes.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选