Skip to main content
Glama
MTGDecks Metagame MCP Server

MTGDecks Metagame MCP Server

by mingun-kim

MTGDecks Metagame MCP

A Python/MCP PoC that reads public pages of MTGDecks.net and normalizes metagame and deck information into a consistent JSON format.

Since no documented public API was found, it uses the site's public HTML and URL-based filters. No browser login or cookies are required.

Features Provided

get_metagame(
    format: str,
    source: str = "all",
)

get_recent_decks(
    format: str,
    platform: str | None = None,
    game_type: str | None = None,
    max_pages: int = 3,
)

get_archetype_decks(
    format: str,
    archetype: str,
    limit: int = 20,
)

get_top_performing_decks(
    format: str,
    platform: str | None = None,
    min_players: int | None = None,
    limit: int = 20,
)

Each feature is provided both as a Python function and as an MCP tool.

Related MCP server: Mystic Forge

Requirements

  • Python 3.10 or higher

  • uv recommended

Installation

git clone <repository-url>
cd Metagame-MCP
uv sync

To install including development and test dependencies, use the following command.

uv sync --extra dev

Running the MCP Server

The server runs with stdio transport by default.

uv run mtgdecks-mcp

An example MCP host configuration is as follows. cwd must be changed to the actual absolute path of this repository.

{
  "mcpServers": {
    "mtgdecks": {
      "command": "uv",
      "args": ["run", "mtgdecks-mcp"],
      "cwd": "C:\\path\\to\\Metagame-MCP"
    }
  }
}

The following four MCP tools are registered.

  • get_metagame

  • get_recent_decks

  • get_archetype_decks

  • get_top_performing_decks

Using from Python

from mtgdecks_mcp import (
    get_archetype_decks,
    get_metagame,
    get_recent_decks,
    get_top_performing_decks,
)

metagame = get_metagame("Modern", source="mtgo")

recent = get_recent_decks(
    "Modern",
    platform="mtgo",
    game_type="BO3",
    max_pages=1,
)

archetype = get_archetype_decks(
    "Modern",
    "Boros Energy",
    limit=5,
)

top = get_top_performing_decks(
    "Modern",
    platform="mtgo",
    min_players=64,
    limit=10,
)

When querying multiple times, it is more efficient to use the client directly so that HTTP connections can be reused.

from mtgdecks_mcp import MTGDecksClient

with MTGDecksClient() as client:
    modern = client.get_metagame("Modern")
    pioneer = client.get_metagame("Pioneer")

Arguments

format

The format name used on MTGDecks.net. Examples: Standard, Pioneer, Modern, Legacy, Pauper, Commander, Duel-Commander.

source

Value

Meaning

all

Full metagame

mtgo

MTGO event metagame

major

Recent major event metagame

mtgo-events, major-events, and recent-major-events can also be used as aliases.

platform

  • mtgo

  • arena

  • tabletop

Case is not distinguished.

game_type

  • BO1

  • BO3

Case is not distinguished.

Query Range Limits

  • max_pages: 1~10

  • limit: 1~100

  • min_players: positive integer

Response Structure

Metagame

{
  "format": "Modern",
  "source": "all",
  "url": "https://mtgdecks.net/Modern",
  "selected_deck_count": 10994,
  "updated_at": "2026-08-21 06:47:39",
  "archetypes": [
    {
      "name": "Boros Energy",
      "url": "https://mtgdecks.net/Modern/boros-energy",
      "meta_share_percent": 7.98,
      "trend_percent": -2.85,
      "tier": "A",
      "win_rate_percent": 49.0,
      "top_25_conversion": 0.95,
      "deck_count": 877,
      "price_usd": 1109.0
    }
  ]
}

Deck Lists

Deck query functions commonly return pages and decks. pages contains the original page URLs that were actually queried.

{
  "format": "Modern",
  "pages": ["https://mtgdecks.net/Modern/decklists/page:1"],
  "decks": [
    {
      "name": "deck",
      "url": "https://mtgdecks.net/Modern/example-decklist-123",
      "author": "Player",
      "archetype": "Boros Energy",
      "game_type": "BO3",
      "platform": "mtgo",
      "event": "MTGO Modern Challenge",
      "event_level": 3,
      "players": 94,
      "spiciness_percent": 30.0,
      "date": "2026-08-20",
      "price_usd": 1112.0,
      "placement": "1st",
      "wins": 5,
      "losses": 0,
      "draws": 0,
      "win_rate_percent": 100.0
    }
  ]
}

Fields that MTGDecks pages do not provide values for may be null. Prices are USD values based on the page's Paper/TCGPlayer.

get_top_performing_decks does not calculate its own performance score but uses MTGDecks' rank ascending sort. Therefore, decks with better event results such as champion, runner-up, and Top 8 are returned first.

Testing

uv run pytest

Tests use stored HTML examples and httpx.MockTransport without connecting to external sites.

Project Structure

src/mtgdecks_mcp/
├── __init__.py   # 공개 Python API
├── parsers.py    # MTGDecks HTML 정규화
├── server.py     # MCP 도구 등록과 stdio 서버
└── service.py    # URL 구성, HTTP 클라이언트, 네 가지 기능

tests/
├── test_parsers.py
└── test_service.py

Limitations and Terms of Use

  • This project depends on the public HTML structure, so if MTGDecks.net's markup or paths change, parser updates may be needed.

  • Mass crawling, parallel collection, and cache/database persistence are not included in the PoC scope.

  • The accuracy and availability of the original data depend on MTGDecks.net.

  • All normalized results include traceable original URLs.

  • MTGDecks' terms of use restrict content to personal, non-commercial use. Before expanding to commercial services or continuous mass collection, confirm permission or an API partnership with MTGDecks.

Related documentation: MTGDecks Terms of Use

Available Tools

4 tools
get_archetype_decksB

Return recent decks belonging to one archetype.

Inputs: format (required), archetype (required), limit. Returns: object

get_metagameA

Return normalized archetype shares for a format (source: all, mtgo, or major).

Inputs: format (required), source. Returns: object

get_recent_decksC

Return recent deck rows, optionally filtered by platform and BO1/BO3 game type.

Inputs: format (required), platform, game_type, max_pages. Returns: object

get_top_performing_decksB

Return decks ordered by best finish, optionally filtered by platform and attendance.

Inputs: format (required), limit, platform, min_players. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 4 tools

    Disambiguation4/5

    The tools are mostly distinct: get_metagame provides aggregate archetype shares, get_recent_decks provides unfiltered recent deck lists, get_archetype_decks filters recent decks by a specific archetype, and get_top_performing_decks sorts by finish. However, get_recent_decks and get_archetype_decks both return recent decks and could be confused when a user wants all decks versus a single archetype.

    Naming Consistency5/5

    All four tool names follow a consistent get_ prefix with snake_case, and three use the get_<adjective>_decks pattern. get_metagame is the only outlier, but it still shares the verb-first style and is clear and predictable.

    Tool Count5/5

    Four tools is a well-scoped count for a metagame analysis server. Each tool addresses a distinct query need without unnecessary bloat or minimalism, fitting comfortably within the ideal 3-15 range.

    Completeness4/5

    The tool surface covers the core metagame queries: aggregate shares, all recent decks, archetype-filtered decks, and top performers. Minor gaps like deck detail lookup or archetype listing exist, but agents can answer most metagame questions using these four tools.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Provides AI assistants with 69 tools, 19 prompts, and 21 resources for deep access to Magic: The Gathering, including card data, combos, draft analytics, Commander metagame, competitive constructed, sideboard strategy, deck building, and rules engine, working with any MCP client.
      56
      68 PyPI
      23
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Unified MCP server for Magic: The Gathering, combining Scryfall card search and pricing, EDHRec commander recommendations, Archidekt deck reading, and decklist validation into a single service.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Provides AI assistants with comprehensive Magic: The Gathering data including card info, combos, draft analytics, Commander metagame, constructed formats, sideboard strategy, deck building, and rules.
      74
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      Provides Magic: The Gathering card, deck, provider, and statistical evidence tools for LLMs to make informed deckbuilding decisions.
      -