MTGDecks Metagame MCP Server
MTGDecks 环境元游戏 MCP
这是一个 Python/MCP 概念验证项目,用于读取 MTGDecks.net 的公开页面,并将元游戏和套牌信息规范化为统一的 JSON 格式。
由于未确认存在公开的 API 文档,本项目使用网站的公开 HTML 页面和基于 URL 的筛选参数。无需浏览器登录或 Cookie。
提供的功能
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,
)每个功能均以 Python 函数和 MCP 工具两种形式提供。
Related MCP server: Mystic Forge
环境要求
Python 3.10 或更高版本
推荐使用
uv
安装
git clone <repository-url>
cd Metagame-MCP
uv sync如需安装开发及测试依赖,请使用以下命令。
uv sync --extra dev运行 MCP 服务器
服务器默认通过 stdio 传输方式运行。
uv run mtgdecks-mcpMCP 主机配置示例如下。请将 cwd 修改为该仓库的实际绝对路径。
{
"mcpServers": {
"mtgdecks": {
"command": "uv",
"args": ["run", "mtgdecks-mcp"],
"cwd": "C:\\path\\to\\Metagame-MCP"
}
}
}注册的 MCP 工具共有以下四个。
get_metagameget_recent_decksget_archetype_decksget_top_performing_decks
在 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,
)当需要多次查询时,建议直接使用客户端以便复用 HTTP 连接,这样效率更高。
from mtgdecks_mcp import MTGDecksClient
with MTGDecksClient() as client:
modern = client.get_metagame("Modern")
pioneer = client.get_metagame("Pioneer")参数
format
MTGDecks.net 使用的赛制名称。例如:Standard、Pioneer、Modern、Legacy、Pauper、Commander、Duel-Commander。
source
值 | 含义 |
| 全部元游戏 |
| MTGO 赛事元游戏 |
| 近期大型赛事元游戏 |
mtgo-events、major-events、recent-major-events 也可作为别名使用。
platform
mtgoarenatabletop
不区分大小写。
game_type
BO1BO3
不区分大小写。
查询范围限制
max_pages:1~10limit:1~100min_players:正整数
响应结构
元游戏
{
"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
}
]
}套牌列表
套牌查询功能统一返回 pages 和 decks 两个字段。pages 中包含实际查询过的原始页面 URL。
{
"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
}
]
}如果 MTGDecks 页面未提供某字段的值,则该字段可能为 null。价格以页面上的 Paper/TCGPlayer 基准美元金额为准。
get_top_performing_decks 不自行计算表现分数,而是按照 MTGDecks 的 rank 升序排列,因此会优先返回冠军、亚军、八强等赛事成绩较好的套牌。
测试
uv run pytest测试不访问外部网站,而是使用保存的 HTML 示例和 httpx.MockTransport 进行。
项目结构
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限制与使用条款
本项目依赖公开的 HTML 结构,因此如果 MTGDecks.net 的标记或路径发生变化,则可能需要修改解析器。
本概念验证不包含大规模爬取、并行采集、缓存或数据库持久化功能。
原始数据的准确性和可用性取决于 MTGDecks.net。
所有规范化结果均包含可追溯的原始页面 URL。
MTGDecks 的使用条款将内容限制为个人和非商业用途。如需扩展到商业服务或持续大规模采集,请事先获得 MTGDecks 的许可或建立 API 合作伙伴关系。
相关文档:MTGDecks 使用条款
This server cannot be installed
Maintenance
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
- AlicenseAqualityDmaintenanceProvides 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.5616MIT
- AlicenseNot gradedqualityBmaintenanceUnified 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
- FlicenseNot gradedqualityBmaintenanceProvides access to Magic: The Gathering card data via Scryfall API, including search, rulings, sets, and local deck management with multi-owner support.
- AlicenseAqualityBmaintenanceProvides AI assistants with comprehensive Magic: The Gathering data including card info, combos, draft analytics, Commander metagame, constructed formats, sideboard strategy, deck building, and rules.74MIT
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…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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