Skip to main content
Glama
mingun-kim

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

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    D
    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
    16
    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
  • F
    license
    Not graded
    quality
    B
    maintenance
    Provides access to Magic: The Gathering card data via Scryfall API, including search, rulings, sets, and local deck management with multi-owner support.
  • A
    license
    A
    quality
    B
    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

View all related MCP servers

Related MCP Connectors

  • Scryfall MCP — Magic: The Gathering card database.

  • Crypto intelligence MCP for market data, DeFi, wallets, security, DEX, NFTs, and Solana.

  • BGG MCP provides access to the BoardGameGeek API through the Model Context Protocol, enabling retr…

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mingun-kim/MTG-Metagame-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server