This is an MCP server that interfaces with the Scryfall API to fetch and display detailed Magic: The Gathering card data. It supports searching cards by name, color, type, and text content.
- Search MTG cards via Scryfall by:
- Card name
- Color(s)
- Type line
- Oracle text
- Detailed card data output:
- Oracle text, mana cost, colors
- Type, power/toughness, rarity
- Set name
- Prices in USD/EUR (regular and foil)
This project uses uv for Python environment and dependency management. All dependencies are declared in pyproject.toml.
- Python 3.12+
- uv (install with
cargo install uv)
uv venv
source .venv/bin/activate # or `.venv/Scripts/activate` on Windows
uv pip install -r pyproject.tomlRunning the project with uv run scryfall.py "Atraxa" should display the scryfall results for the Atraxa card in the console, however this is intended to be ran by an MCP host, like Claude Desktop.
Claude Desktop can run the MCP server to interact with the Scryfall API and use the results. You need to install or update to the latest Claude version and create the claude_desktop_config.json file if it doesn't exist yet:
~/Library/Application\ Support/Claude/claude_desktop_config.json in MacOS
$env:AppData\Claude\claude_desktop_config.json in Windows
{
"mcpServers": {
"scryfall": {
"command": "/ABSOLUTE/PATH/TO/BIN/uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/mcp-server",
"run",
"scryfall.py"
]
}
}
}This project uses pytest for unit testing. Tests are located in the tests/ directory.
To run the full test suite:
pytestTo run a specific test:
pytest tests/test_scryfall.py::test_get_cards_no_query