Overview
The MTG-MCP is a server designed to act as a bridge between a MCP client and the Scryfall Magic: The Gathering card database. Its primary purpose is to expose Scryfall’s search capabilities as a set of tools that an MCP-compatible application can use for card data lookup and deck-building assistance.
The server provides several key tools:
- Basic Card Search: Tools to find cards by their exact name (
search_card_by_name), by their color (search_card_by_color), or by text in their rules (search_card_by_text). - Related Card Search: The
find_related_cardstool can find other printings (reprints), tokens generated by a card, cards from the same set, and cards that share similar mechanics. - Synergy Finding: The
find_card_synergiestool analyzes a card to find others that work well with it. It does this by identifying keywords, creature types (for tribal synergies), and strategic themes (like “sacrifice” or “tokens”).
The server can be run locally using STDIO or deployed as a remote service using SSE (HTTP/HTTPS) transport. It also includes a Dockerfile for containerized deployment and GitHub Actions workflows for continuous integration and automated release builds.
Technologies Used
- Go (Golang): The application is written entirely in Go.
- Model Context Protocol (MCP): Uses the
github.com/modelcontextprotocol/go-sdkto create and manage the MCP server and its tools. - Scryfall API: Uses the
github.com/BlueMonday/go-scryfallclient library to query the external Scryfall database for all Magic: The Gathering card data. - JSON Schema: The Go structs for tool outputs are converted into JSON schemas for proper MCP tool definition.
- Docker: A multi-stage
Dockerfileis provided for building a minimal, non-root runtime container. - GitHub Actions: Workflows are included for CI builds, building cross-platform binaries and Docker images for releases.