MTG-MCP
A comprehensive Model Context Protocol server that provides AI assistants with rich Magic: The Gathering information, including card data, comprehensive rules, EDHREC recommendations, combo interactions, and intelligent Commander deck generation.
README
MTG-MCP
<!-- mcp-name: io.github.wtfregia/mtg-mcp -->
Magic: The Gathering Model Context Protocol Server
A comprehensive Model Context Protocol (MCP) server that provides AI assistants with rich Magic: The Gathering information, including card data, comprehensive rules, EDHREC recommendations, combo interactions, and intelligent Commander deck generation.
Quick Links
- Quick Start Guide - Get up and running in 5 minutes
- Setup Guide - Detailed installation and configuration
- Tools Documentation - Complete API reference
- PyPI Package - Install from Python Package Index
Overview
MTG-MCP integrates multiple Magic: The Gathering data sources to provide AI assistants with authoritative information for answering questions, making recommendations, and generating legal Commander decklists. The server leverages official comprehensive rules, Scryfall card database, EDHREC statistics, and Commander Spellbook combo data.
Features
Core Information Tools
- Comprehensive Rules Access: Query the official Magic: The Gathering comprehensive rules by section or keyword
- Card Information: Retrieve detailed card data including type, mana cost, oracle text, and legality
- Card Rulings: Access official card rulings and clarifications from Scryfall
- Card Type Information: Get detailed information about card types, subtypes, and supertypes
Commander-Specific Tools
- Commander Format Context: Comprehensive information about Commander/EDH format rules, deck construction, and gameplay
- EDHREC Integration: Pull top recommended cards for any commander based on EDHREC data
- Combo Search: Find card combinations and interactions from Commander Spellbook
- Bracket System: Access Commander power level brackets (1-5) with detailed criteria and guidelines
- Dynamic Game Changers List: Automatically updated list of high-impact cards that affect deck power level
- Dynamic Banned List: Real-time Commander banned cards list from Scryfall
Deck Generation & Import
- Commander Deck Validation: Validates commander legality including partner rules (Partner, Partner with, Choose a Background, Friends Forever, Doctor's Companion)
- [HIGHLY EXPERIMENTAL] Deck Generation: Generates complete 100-card Commander decklists based on:
- EDHREC recommendations
- Target power level bracket (1-5)
- Commander color identity restrictions
- Deck composition best practices
- Combo synergies
- Deck Import: Fetch and analyze decks from popular deck-building platforms:
- Moxfield: Import decks with automatic commander detection
- Archidekt: Import decks with category organization
- Export Format: Generates decklists in standard format compatible with Moxfield, Archidekt, and other deck building tools
Installation
For detailed installation instructions and troubleshooting, see the Setup Guide.
Quick Start (Recommended)
Install directly from PyPI:
pip install mtg-mcp
Or using uv:
uv pip install mtg-mcp
Development Installation
For development or to use the latest unreleased features, see the Development Installation section in the Setup Guide.
Usage
For complete usage instructions and configuration examples, see the Configuration Guide.
Running as a Standalone Server
After installation, you can run the server directly:
mtg-mcp
For debug logging:
mtg-mcp --debug
MCP Client Integration
Configuration examples for popular MCP clients:
- Claude Desktop - Desktop AI assistant
- VS Code with Cline - Code editor integration
See the Configuration Guide for detailed setup instructions and troubleshooting.
Available Tools
For complete API documentation with parameters, return types, and examples, see the Tools Documentation.
The server exposes the following MCP tools:
mtg-context-get: Get basic MTG game informationmtg-context-commander: Get comprehensive Commander/EDH format rulesmtg-cardtypes-get: Get detailed card type informationmtg-rules-get: Get overview of comprehensive rulesmtg-rules-search: Search rules by section or keywordmtg-ruling-search: Search official card rulingsmtg-combos-search: Search for card combos in Commandermtg-commander-recommend: Get EDHREC recommendations for a commandermtg-commander-brackets: Get Commander bracket informationmtg-export-format: Get deck export format guidelinesmtg-commander-deck: Validate commanders and generate deck datamtg-archidekt-fetch: Fetch deck data from Archidektmtg-moxfield-fetch: Fetch deck data from Moxfield (with automatic commander detection)
Examples
For more examples and detailed usage patterns, see the Quick Start Guide and Tools Documentation.
Generate a Competitive EDH Deck
Use #mtg-commander-deck to generate a Bracket 5 (cEDH) commander deck with Tymna the Weaver and Kraum, Ludevic's Opus.
Generate a Casual Commander Deck
Use #mtg-commander-deck to create a Bracket 2 casual deck with Atraxa, Praetors' Voice.
Search for Card Rulings
Use #mtg-ruling-search to find rulings for Doubling Season.
Find Commander Recommendations
Use #mtg-commander-recommend to get the top cards for Kinnan, Bonder Prodigy.
Search for Combos
Use #mtg-combos-search to find combos with Thassa's Oracle.
Data Sources
- Scryfall API: Card data, rulings, and legality information
- EDHREC: Commander recommendations and deck statistics
- Commander Spellbook: Combo interactions and synergies
- MTG SDK: Card types and subtypes
- Wizards of the Coast: Official comprehensive rules and banned list
- Archidekt: Deck import
- Moxfield: Deck import
Development
Running Tests
pytest
Code Quality
The project uses Ruff for linting and formatting:
ruff check .
ruff format .
Bracket System
MTG-MCP includes support for the Commander bracket system (1-5). For detailed bracket criteria and guidelines, see the Tools Documentation - Commander Brackets.
- Bracket 1: Casual/Exhibition - Budget-friendly, thematic gameplay
- Bracket 2: Core - Focused strategies with some powerful cards
- Bracket 3: Upgraded - Optimized decks with powerful cards and combos
- Bracket 4: Optimized - Highly tuned with extensive tutors and fast mana
- Bracket 5: Competitive EDH (cEDH) - Maximum optimization
The deck generator respects bracket specifications when selecting cards and building strategies.
Export Format
For complete export format specifications and examples, see the Tools Documentation - Export Format.
Generated decklists follow the standard format compatible with popular deck building tools like Moxfield and Archidekt.
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
License
MIT License - See LICENSE file for details.
Acknowledgments
- Scryfall for comprehensive card data API
- EDHREC for commander recommendations and statistics
- Commander Spellbook for combo database
- Wizards of the Coast for Magic: The Gathering
Disclaimer
MTG-MCP is unofficial Fan Content permitted under the Fan Content Policy. Not approved/endorsed by Wizards of the Coast. Portions of the materials used are property of Wizards of the Coast. ©Wizards of the Coast LLC.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。