A Commander deck generation engine that builds full EDH decks using real Scryfall and EDHREC data, with a focus on producing playable, synergistic, and structurally coherent Commander lists.
Live version (official): https://manafoundry.gg
Manafoundry is an evolving deck generation system for Magic: The Gathering Commander (EDH).
It combines:
- Scryfall card database and images
- EDHREC archetype and theme statistics
- internal heuristics for curve, synergy, and role distribution
to construct full 100-card Commander decks centered around a selected commander.
Unlike simple random or template-based generators, Manafoundry is actively developed with a focus on improving deck quality, coherence, and gameplay usability over time.
This project is the original implementation and reference system for the underlying deck generation engine.
- Commander Search - Search any legendary creature via Scryfall
- EDHREC Integration - Uses real archetype and theme data per commander
- Theme Selection - Choose from EDHREC archetypes (e.g. +1/+1 Counters, Voltron, Aristocrats)
- Role-Aware Deck Building - Balanced assignment of ramp, draw, removal, threats, and synergy pieces
- Mana Curve Modeling - Targets archetype-appropriate curve distributions
- Type Distribution Logic - Creature / instant / sorcery / artifact / enchantment balancing
- Dynamic UI Theming - Commander artwork and color identity influence UI styling
- Deck Export - Copy-ready format for Moxfield, Archidekt, and MTGO
Manafoundry builds Commander decks using a structured multi-step system:
- Parses color identity
- Identifies archetype tendencies from EDHREC data
- Establishes baseline deck constraints
- Pulls EDHREC themes associated with the commander
- Weights cards based on archetype popularity and synergy signals
Cards are assigned functional roles such as:
- Ramp
- Card draw
- Interaction (removal / counterspells)
- Win conditions
- Synergy engines
- Mana curve targeting based on archetype averages
- Color pip distribution balancing
- Type breakdown enforcement (creatures, spells, lands)
- Final 100-card list assembled with synergy and curve constraints
- Lands added based on color requirements and curve needs
- Node.js 18+
- npm or yarn
git clone https://github.com/20q2/mtg-commander-deck-generator.git
cd mtg-commander-deck-generator
npm install
npm run devThe app will be available at: http://localhost:5173
npm run build
npm run previewnpm run buildThen deploy the generated dist/ folder to your GitHub Pages branch.
- Search any legendary creature via Scryfall integration
- Or select from popular EDHREC commanders
- Choose up to 2 EDHREC archetypes
- Themes are weighted by popularity and synergy strength
- Land count (typically 35–38)
- Deck format (Commander default or alternative sizes)
Manafoundry will:
- Fetch EDHREC recommendations
- Build a role-balanced 100-card list
- Apply curve and synergy constraints
- Assemble a complete playable deck
- Copy deck list
- Import to Moxfield / Archidekt / MTGO
- React 18 + TypeScript
- Vite
- Tailwind CSS
- shadcn/ui
- Zustand (state management)
- Scryfall API
- EDHREC data integration
- mana-font (symbols and icons)
- Card search and metadata
- Image retrieval
- Rate-limited (handled automatically)
- Commander archetypes
- Theme breakdowns
- Card inclusion rates and popularity signals
src/
├── components/
│ ├── ui/
│ ├── commander/
│ ├── archetype/
│ ├── customization/
│ └── deck/
├── services/
│ ├── scryfall/
│ ├── edhrec/
│ └── deckBuilder/
├── lib/
│ ├── constants/
│ └── commanderTheme.ts
├── store/
├── pages/
└── types/
- Scryfall for card data and images
- EDHREC for archetype and theme data
- mana-font for mana symbols
- React, Vite, and open-source ecosystem contributors
Contributions, issues, and feedback are welcome.
This project is licensed under the MIT License.
See the LICENSE file for details.