# MTG MCP Server

Connect an AI assistant to Magic: The Gathering card data, combo searches, draft analysis, and Commander tools. Use it to inspect decks or work through game rules.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 20
- Author: j4th
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/j4th/mtg-mcp-server
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/mtg-mcp-server

## What it does

The server provides tools for finding cards and combos, reviewing draft data, exploring the Commander metagame, and building decks. It can help check a Modern list, plan a sideboard, or reason through a rules interaction. The project also includes prompts and resources for working with Magic: The Gathering data.

Its data sources include Scryfall, Commander Spellbook, 17Lands, EDHREC, Moxfield, Spicerack, and MTGGoldfish. No API keys are needed. A local Claude Desktop setup requires Python 3.12+, so connecting to the hosted server avoids that local runtime requirement.

For Claude Code, run the server through `uvx`. Environment variables let you set the transport, HTTP port, logging level, and whether 17Lands and EDHREC are enabled. The server also works with Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, and Gemini CLI.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `MTG_MCP_TRANSPORT`, `MTG_MCP_HTTP_PORT`, `MTG_MCP_LOG_LEVEL`, `MTG_MCP_ENABLE_17LANDS`, `MTG_MCP_ENABLE_EDHREC`, `MTG_MCP_ENABLE_BULK_DATA`, `MTG_MCP_SCRYFALL_RATE_LIMIT_MS`, `MTG_MCP_BULK_DATA_REFRESH_HOURS`, `MTG_MCP_ENABLE_RULES`, `MTG_MCP_DISABLE_CACHE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env MTG_MCP_TRANSPORT=<MTG_MCP_TRANSPORT> --env MTG_MCP_HTTP_PORT=<MTG_MCP_HTTP_PORT> --env MTG_MCP_LOG_LEVEL=<MTG_MCP_LOG_LEVEL> --env MTG_MCP_ENABLE_17LANDS=<MTG_MCP_ENABLE_17LANDS> --env MTG_MCP_ENABLE_EDHREC=<MTG_MCP_ENABLE_EDHREC> --transport stdio mtg-mcp-server -- uvx mtg-mcp-server
```
Replace <…> with your own values. 8 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mtg-mcp-server <command>

### Codex

**Platform CLI**
```bash
codex mcp add mtg-mcp-server --env MTG_MCP_TRANSPORT=<MTG_MCP_TRANSPORT> --env MTG_MCP_HTTP_PORT=<MTG_MCP_HTTP_PORT> --env MTG_MCP_LOG_LEVEL=<MTG_MCP_LOG_LEVEL> --env MTG_MCP_ENABLE_17LANDS=<MTG_MCP_ENABLE_17LANDS> --env MTG_MCP_ENABLE_EDHREC=<MTG_MCP_ENABLE_EDHREC> -- uvx mtg-mcp-server
```
Replace <…> with your own values. 8 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mtg-mcp-server <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mtg-mcp-server": {
            "command": "uvx",
            "args": [
                "mtg-mcp-server"
            ],
            "env": {
                "MTG_MCP_TRANSPORT": "<MTG_MCP_TRANSPORT>",
                "MTG_MCP_HTTP_PORT": "<MTG_MCP_HTTP_PORT>",
                "MTG_MCP_LOG_LEVEL": "<MTG_MCP_LOG_LEVEL>",
                "MTG_MCP_ENABLE_17LANDS": "<MTG_MCP_ENABLE_17LANDS>",
                "MTG_MCP_ENABLE_EDHREC": "<MTG_MCP_ENABLE_EDHREC>"
            }
        }
    }
}
```
Replace <…> with your own values. 8 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mtg-mcp-server <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mtg-mcp-server": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "mtg-mcp-server"
            ],
            "env": {
                "MTG_MCP_TRANSPORT": "<MTG_MCP_TRANSPORT>",
                "MTG_MCP_HTTP_PORT": "<MTG_MCP_HTTP_PORT>",
                "MTG_MCP_LOG_LEVEL": "<MTG_MCP_LOG_LEVEL>",
                "MTG_MCP_ENABLE_17LANDS": "<MTG_MCP_ENABLE_17LANDS>",
                "MTG_MCP_ENABLE_EDHREC": "<MTG_MCP_ENABLE_EDHREC>"
            }
        }
    }
}
```
Replace <…> with your own values. 8 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mtg-mcp-server <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e MTG_MCP_TRANSPORT=<MTG_MCP_TRANSPORT> -e MTG_MCP_HTTP_PORT=<MTG_MCP_HTTP_PORT> -e MTG_MCP_LOG_LEVEL=<MTG_MCP_LOG_LEVEL> -e MTG_MCP_ENABLE_17LANDS=<MTG_MCP_ENABLE_17LANDS> -e MTG_MCP_ENABLE_EDHREC=<MTG_MCP_ENABLE_EDHREC> mtg-mcp-server uvx mtg-mcp-server
```
Replace <…> with your own values. 8 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mtg-mcp-server <command>

## When to use it
- search for cards matching deck criteria
- check a Modern decklist
- choose a sideboard for a deck
- compare Commander options
- resolve interactions between game rules

## Example prompts
- Compare Muldrotha, Meren, and Karador as graveyard-focused commanders.
- Check my Modern decklist and suggest a sideboard.
- Explain how deathtouch interacts with trample.

## Similar
- [Pascal 3D Editor](https://affpapa.org/en/nevibecode/mcp/pascal-3d-editor.md) — MCP server · ★ 25085
- [Unity-MCP](https://affpapa.org/en/nevibecode/mcp/unity-mcp.md) — MCP server · ★ 4523
- [mcp](https://affpapa.org/en/nevibecode/mcp/sceneview-mcp.md) — MCP server · ★ 1348
- [Gearboy MCP Server](https://affpapa.org/en/nevibecode/mcp/gearboy-mcp-server.md) — MCP server · ★ 1219
- [ChiR24-unreal_mcp_server](https://affpapa.org/en/nevibecode/mcp/chir24-unreal-mcp-server.md) — MCP server · ★ 975
- [Nova3D](https://affpapa.org/en/nevibecode/mcp/nova3d.md) — MCP server · ★ 733

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
