heffrey78/mtg-mcp
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.
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
Component | Status | Tasks |
---|---|---|
MCP Server Foundation | โ Complete | TASK-0001-00-00 |
Card Database Tools | ๐ฏ Next | TASK-0002-00-00 |
Deck Management | ๐ Planned | TASK-0003-00-00 |
Rules Engine | ๐ Planned | TASK-0004-00-00 |
Game State Management | ๐ Planned | TASK-0005-00-00 |
Testing Framework | โ Complete | TASK-0006-00-00 |
Tutorial System | ๐ Planned | TASK-0007-00-00 |
AI Opponent | ๐ Planned | TASK-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