mtg-mcp

heffrey78/mtg-mcp

3.2

If you are the rightful owner of mtg-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A comprehensive Magic: The Gathering MCP server providing card database access, deck building tools, AI-powered gameplay, and interactive tutorials over STDIO.

Tools
5
Resources
0
Prompts
0

Magic: The Gathering MCP Server

A comprehensive Magic: The Gathering (MTG) MCP server providing card database access, deck building tools, AI-powered gameplay, and interactive tutorials over STDIO.

๐ŸŽฏ Project Status

โœ… Foundation Complete - MCP server foundation implemented and tested
๐ŸŽฏ Next: Card Database Search Tools (TASK-0002-00-00)

Recent Milestone: TASK-0001-00-00 โœ…

  • MCP Server Foundation with TypeScript and STDIO communication
  • Complete Testing Suite (23 tests passing)
  • Build & Development Tools (TypeScript, ESLint, Jest)
  • Error Handling & Logging framework
  • Project Structure and documentation

๐Ÿš€ Quick Start

# Install dependencies
npm install

# Run tests
npm test

# Build the server
npm run build

# Start development server
npm run dev

# Type checking
npm run typecheck

# Lint code
npm run lint

๐Ÿ“‹ Features (Planned)

๐Ÿƒ Card Database & Research

  • Search MTG cards by name, type, mana cost, abilities
  • Get comprehensive card information including rulings and legality
  • Browse Magic sets and expansions
  • Access official rulings and clarifications

๐Ÿงฉ Deck Building & Management

  • Create and manage MTG decks with format validation
  • Add/remove cards with quantity validation and sideboard support
  • Analyze deck composition (mana curve, type distribution, synergies)
  • AI-powered card recommendations based on strategy and budget
  • Import/export decks in various formats

๐ŸŽฎ Game State Management

  • Full MTG game simulation with turn-based play
  • Combat system with attacker/blocker declarations
  • Stack management with proper priority handling
  • Complete game state tracking (phases, players, battlefield, etc.)

๐ŸŽ“ Learning & Tutorial System

  • Interactive tutorials for MTG basics and advanced concepts
  • Mechanic explanations with examples and rulings
  • Play analysis and strategic feedback
  • Contextual hints during gameplay

๐Ÿค– AI Opponent

  • Intelligent AI opponent with configurable difficulty
  • Multiple deck archetypes (aggro, control, combo, midrange)
  • Strategic decision-making with reasoning explanations
  • Mulligan decisions based on deck strategy

๐Ÿ—๏ธ Architecture

Built on the Model Context Protocol (MCP) specification:

  • Tools: Card search, deck management, game actions, tutorials, AI opponent
  • Resources: Game sessions, deck collections, card database, tutorial progress
  • Prompts: Deck building assistant, rules tutor, play analyzer, AI opponent

Tech Stack

  • Language: TypeScript with strict configuration
  • Runtime: Node.js 18+
  • Protocol: MCP over STDIO
  • Testing: Jest with comprehensive test suite
  • External APIs: Scryfall, EDHREC, MTGTop8

๐Ÿ“Š Implementation Progress

ComponentStatusTasks
MCP Server Foundationโœ… CompleteTASK-0001-00-00
Card Database Tools๐ŸŽฏ NextTASK-0002-00-00
Deck Management๐Ÿ“‹ PlannedTASK-0003-00-00
Rules Engine๐Ÿ“‹ PlannedTASK-0004-00-00
Game State Management๐Ÿ“‹ PlannedTASK-0005-00-00
Testing Frameworkโœ… CompleteTASK-0006-00-00
Tutorial System๐Ÿ“‹ PlannedTASK-0007-00-00
AI Opponent๐Ÿ“‹ PlannedTASK-0008-00-00

๐Ÿงช Testing

Comprehensive test suite with:

  • Unit Tests: Core functionality and utilities
  • Integration Tests: MCP protocol and external APIs
  • Rules Validation: MTG game rules and interactions
  • Coverage: Configured thresholds and reporting
npm test              # Run all tests
npm run test:watch    # Run tests in watch mode

๐Ÿ“– Documentation

  • : Development guidance for Claude Code
  • : Complete architecture specification
  • Requirements & ADRs: Managed via lifecycle-mcp

๐Ÿค Contributing

This project uses structured requirements and task management:

  • Requirements: Managed via lifecycle-mcp
  • Architecture Decisions: Recorded as ADRs
  • Tasks: Tracked with clear acceptance criteria
  • Testing: Required for all new functionality

๐Ÿ“„ License

MIT License - see file for details.

๐Ÿ”— Repository

GitHub: heffrey78/mtg-mcp


๐Ÿค– Generated with Claude Code