Skip to content

Get Magic: the Gathering deckbuilding advice from AI

Notifications You must be signed in to change notification settings

Ari-Zerner/mtg-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MTG Deck Advisor

An AI-powered Magic: The Gathering deck analysis tool that provides detailed advice for improving your decks.

Features

  • Analyze decklists and get AI-powered suggestions
  • Support for all major Magic formats
  • Real-time progress updates during analysis
  • Downloadable markdown reports
  • Card suggestions based on deck strategy

Prerequisites

  • Python 3.8 or higher
  • MongoDB database
  • OpenAI (or compatible) API access

Installation

  1. Clone the repository:
git clone https://github.com/Ari-Zerner/mtg-ai.git
cd mtg-ai
  1. Create and activate a virtual environment (recommended):
python -m venv venv
source venv/bin/activate  # On Windows, use: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file in the project root with the following variables:
API_KEY # API key for your LLM provider
API_BASE_URL # API base URL for your LLM provider
CHEAP_MODEL # Model for basic tasks
GOOD_MODEL # Model for complex analysis

# Optional configuration
MONGO_URI # MongoDB connection string, for caching Scryfall results
LOG_LEVEL # Logging level (default: INFO)
MAX_CARDS_PER_QUERY # Maximum number of cards to fetch per Scryfall query (default: 525)
MAX_CARDS_TO_CONSIDER # Maximum number of most-relevant potential additions to consider (default: 150)
MIN_RELEVANCE_SCORE # Minimum relevance score for suggestions (default: 50)

Running the Application

  1. Start the Flask development server:
python app.py
  1. Open your web browser and navigate to:
http://localhost:5000

Usage

  1. Enter your decklist in the main text area
  2. Select the format from the dropdown (optional)
  3. Add any additional context or requirements (optional)
  4. Click "Get Advice" to start the analysis
  5. Wait for the analysis to complete
  6. View and optionally download the generated report

Development

The key components of the application are:

  • app.py: Flask web application and job management
  • mtgai.py: Core deck analysis and AI interaction logic
  • templates/: HTML templates for the web interface

About

Get Magic: the Gathering deckbuilding advice from AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published