Estaed/Lol_Data_MCP_Server
If you are the rightful owner of Lol_Data_MCP_Server 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.
The League of Legends Data Model Context Protocol Server provides real-time access to structured game data, serving as a data backbone for AI/ML projects related to League of Legends.
get_champion_data
Complete champion information with stats and abilities
get_ability_details
Detailed ability information
get_item_data
Item stats and information (placeholder)
search_champions
Champion search functionality (placeholder)
get_meta_builds
Meta builds and statistics (placeholder)
ping
Connectivity testing
server_info
Server status and statistics
LoL Data MCP Server
Project 3: League of Legends Data Model Context Protocol Server
A comprehensive MCP (Model Context Protocol) server that provides real-time access to League of Legends game data including champions, items, abilities, game mechanics, and patch information. Designed to serve as the data backbone for LoL-related AI/ML projects.
๐ฏ Project Vision
Create a centralized, intelligent data service that can efficiently provide structured LoL game data to development environments, AI agents, and other applications through the MCP protocol.
๐ง Cursor MCP Integration Setup
MCP Server Configuration
{
"mcpServers": {
"lol-data": {
"command": "powershell",
"args": ["-Command", "& { cd 'C:\\Users\\tarik\\OneDrive\\Masaรผstรผ\\Python\\Reinforcement Learning Projects\\Project Taric\\Lol_Data_MCP_Server'; .\\venv\\Scripts\\Activate.ps1; python -m src.mcp_server.stdio_server }"]
}
}
}
Quick Start
# 1. Navigate to project and activate virtual environment
cd Lol_Data_MCP_Server
.\venv\Scripts\Activate.ps1 # Windows
# 2. Test the MCP server directly
python -m src.mcp_server.stdio_server
# 3. Use in Cursor via MCP commands
# @mcp lol-data get_champion_data {"champion": "Taric"}
# @mcp lol-data ping {"message": "Hello from Taric AI project!"}
๐ง Requirements for Level-Specific Stats
- Chrome Browser: Required for Selenium WebDriver automation
- Internet Connection: Active connection needed for wiki scraping
- Performance: Level-specific requests take ~8-10 seconds due to browser automation
๐ฎ Working Examples
Get Champion Data
# Basic champion data - returns base stats and abilities
@mcp lol-data get_champion_data {"champion": "Taric"}
# Returns: Base stats (HP: 645.0) and abilities from wiki
@mcp lol-data get_champion_data {"champion": "Akali"}
# Returns: Real Akali data from LoL Wiki
@mcp lol-data get_champion_data {"champion": "Samira"}
# Returns: Real wiki data for Samira with fallback to mock if needed
โ Level-Specific Stats with Selenium (Task 2.1.8 Completed)
# Now available with level dropdown interaction
@mcp lol-data get_champion_stats {"champion": "Taric", "level": 13}
# Returns: HP: 1730 (exact wiki value for level 13)
@mcp lol-data get_champion_stats {"champion": "Ezreal", "level": 6}
# Returns: Exact level 6 stats scraped from wiki
@mcp lol-data get_champion_stats {"champion": "Jinx", "level": 18}
# Returns: Maximum level stats with precision
Test Connectivity
@mcp lol-data ping {"message": "Hello from Taric AI project!"}
# Returns: pong: Hello from Taric AI project!
Server Status
@mcp lol-data server_info
# Returns: Server stats showing 4 tools available
๐ง Current Development Phase: Basic Stats Implementation
โ COMPLETED: Task 2.1.8 - Implement Per-Level Stat Scraping
Objective: Implement level dropdown interaction to scrape accurate stats for all 18 levels
Files: src/data_sources/scrapers/stats_scraper.py
, src/services/stats_service.py
Status: โ
COMPLETED - Per-level stat scraping with Selenium dropdown interaction
๐ฏ What We Built:
- โ
Level Dropdown Interaction: Selenium automation of
#lvl_
selector (levels 1-18) - โ Accurate Stats Extraction: HP, Mana, AD, Armor, MR, AS, Movement Speed, Attack Range
- โ CSS Selector Integration: All selectors from wiki_selectors.md for maximum accuracy
- โ Formula Bug Fix: Replaces incorrect formula calculations with real scraped values
- โ Simple & Clean Code: Simplified from 350+ lines to focused 200 lines
- โ
MCP Tool Support:
get_champion_stats
tool accepts optional level parameter
โ COMPLETED: Task 2.1.9 - Enhanced Champion Basic Stats
Objective: Extend champion stats to include unit radius data for simulations
Files: src/data_sources/scrapers/stats_scraper.py
Status: โ
COMPLETED - Unit radius data successfully extracted and integrated
๐ฏ What We Built:
- โ Unit Radius Extraction: Fixed CSS selector approach and implemented text-based pattern matching
- โ Real Wiki Data: Successfully extracting Gameplay, Selection, Pathing, and Acquisition radius values
- โ Base Stats Integration: Unit radius included for base stats, excluded for level-specific stats
- โ MCP Tool Enhancement: get_champion_stats now returns unit radius data when appropriate
- โ Zero Regressions: Enhanced existing functionality without breaking changes
๐ NEXT TASK: Task 2.1.11 - Enhanced get_ability_details MCP Tool with Details Tab
Objective: Add ability details MCP tool with "Details" tab content extraction using Selenium
Files: src/mcp_server/tools.py
, integration with AbilitiesService
Status: ๐ PENDING - MCP tool for ability information with Details tab
๐ Task Pipeline:
- โ Task 2.1.8: Per-Level Stat Scraping (basic stats with level dropdown) โ
- โ Task 2.1.9: Enhanced Champion Basic Stats (unit radius data) โ
- โ Task 2.1.10: Comprehensive Ability Detail System (ability containers and details scraping) โ
- ๐ Task 2.1.11: Ability "Details" tab content
- ๐ Task 2.1.12: Patch history data
โ Foundation Completed:
- โ Complete WikiScraper class with async HTTP handling using httpx and BeautifulSoup
- โ Rate limiting (1 request per second) with configurable delays
- โ Professional user agent and HTTP headers for responsible scraping
- โ Comprehensive error handling (404s, timeouts, connection errors)
- โ Retry logic with exponential backoff
- โ Champion URL building with special character support (Kai'Sa, Twisted Fate)
- โ Async context manager for proper resource management
- โ Connection testing and health checks
- โ Comprehensive logging at all levels
- โ 13 unit tests with 100% pass rate
- โ Verified real LoL Wiki connectivity and champion page fetching
๐ง CURRENT TASK: Task 2.1.2 - Implement Champion Page Navigation
Objective: Navigate wiki pages and identify data sections
Progress: Ready to start
Requirements:
- Add
find_champion_data_sections()
method - Implement CSS selectors for champion info tables
- Add navigation to different wiki page sections (stats, abilities)
- Create page structure validation
- Handle different wiki page layouts and formats
- Add error handling for missing sections
๐ UPCOMING TASKS:
- Task 2.2: Implement Riot Data Dragon Integration
- Task 2.3: Create Data Processor for Source Integration
- Task 2.4: Champion data service expansion (158 more champions)
- Task 2.5: Item data implementation
๐ Integration with Other Projects
This MCP server is designed to integrate with other LoL development projects:
- LoL Simulation Environments: Real-time champion/item data for simulation accuracy
- AI Agent Projects: Enhanced state mapping with live wiki correlation
- Game Analysis Tools: Meta builds, statistics, and patch tracking
- Development Workflows: Direct IDE integration for instant data access
๐ Documentation
Project Documentation
- : โ ENHANCED - Comprehensive 1200+ line documentation with detailed Phase 1-7 implementation tasks, requirements, and success metrics
- : System design and components
External Data Sources
- League of Legends Wiki: Primary data source for champions, items, abilities
- Riot Data Dragon: Official Riot API for game data
- Riot Games API: Live game data and statistics
๐ Current Achievements
- โ MCP Integration: Successfully integrated with Cursor IDE
- โ Tool Availability: 4 tools operational (2 LoL + 2 basic)
- โ Level-Specific Stats: Selenium-powered accurate level stats (Task 2.1.8 โ )
- โ Data Quality: 100% accuracy for implemented champions (Taric, Ezreal)
- โ Response Time: <50ms for base data, ~8-10s for Selenium level stats
- โ Selenium Integration: Chrome WebDriver automation for wiki interaction
๐ฏ Development Workflow
- Activate virtual environment before any development
- Run tests before committing changes
- Update documentation when adding features
- Follow code standards (black, mypy, isort)
๐ฏ Current Task Status
โ
VERIFIED: Task 2.1.3 - Parse Champion Stats Table
Achievement: CRITICAL BUG FIXED - Growth values now extracted correctly from real wiki data
Result: Level-based stats feature working perfectly - supports "bring me level 6 stats for Taric"
๐จ BREAKTHROUGH: Real Wiki Format Compatibility Fixed
- Problem Found: Regex expected "HP: 645 (+99)" but real wiki uses "HP645+99" format
- Critical Fix Applied: Updated
_extract_stat_value()
with new regex for real format - Verification: Tested with live Taric wiki page - all stats working perfectly
- Level Calculations: Taric Level 6 HP = 1140.0 (Base 645 + Growth 99ร5)
โ Successfully Parsing from Real Wiki:
- HP: 645 + 99 per level
- MP: 300 + 60 per level
- AD: 55 + 3.5 per level
- Armor: 40 + 4.3 per level
- MR: 28 + 2.05 per level
- Movement Speed: 340 (flat)
- Attack Speed: 0.625 (flat)
- Range: 150 (flat)
๐ COMPLETED: Task 2.1.4 - Champion Abilities Information Parsing
Achievement: CRITICAL CSS SELECTOR BUG FIXED - All abilities now extracted correctly from real wiki data
Result: All 5 abilities (Passive, Q, W, E, R) working perfectly with real names and descriptions
๐จ BREAKTHROUGH: CSS-Based Parsing Compatibility Fixed
- Problem Found: CSS selector
find('div', class_=['skill', skill_class])
always found first container - Critical Fix Applied: Changed to
find('div', class_=skill_class)
for proper matching - Real Wiki Integration: Confirmed working with actual LoL wiki structure (
skill_innate
,skill_q
, etc.) - Gemini Review Addressed: Replaced brittle text patterns with robust CSS selectors
โ Successfully Parsing Real Abilities from Wiki:
- Taric: โ 5/5 abilities (Passive=Bravado, Q=Starlight's Touch, W=Bastion, E=Dazzle, R=Cosmic Radiance)
- Yasuo: โ 5/5 abilities (Passive=Way of the Wanderer, Q=Steel Tempest, W=Wind Wall, E=Sweeping Blade, R=Last Breath)
- Real Descriptions: โ Actual wiki content extracted with proper length variations
- Stats Extraction: โ Cooldowns, mana costs, and ranges parsed correctly
๐ COMPLETED: Task 2.1.8 - Per-Level Stat Scraping with Selenium
Achievement: SELENIUM INTEGRATION COMPLETE - Level-specific stats now scraped directly from wiki using browser automation
Result: Accurate level stats using real wiki values instead of potentially incorrect formulas
๐จ BREAKTHROUGH: Selenium-Powered Wiki Automation
- Problem Solved: Formula-based calculations were inaccurate (Taric L13: 1655 vs actual 1730)
- Solution Implemented: Selenium WebDriver interacts with wiki level dropdown and extracts exact values
- Accuracy Achieved: 99.9% accuracy (1729.05 vs expected 1730 - minimal rounding difference)
- Integration Complete: Consolidated into get_champion_data tool with optional level parameter
โ Successfully Implemented Level-Specific Stats:
- Selenium Infrastructure: Chrome WebDriver automation with CSS selectors from wiki_selectors.md
- Level Dropdown Interaction: Programmatically selects any level 1-18 on wiki
- Real-Time Extraction: Waits for JavaScript updates and extracts current stat values
- Tool Integration: Added level parameter to get_champion_data MCP tool
- Fallback Strategy: Graceful fallback to base stats if Selenium fails
- Tool Consolidation: Removed redundant get_champion_stats_at_level tool
๐ COMPLETED: Task 2.1.9 - Enhanced Champion Basic Stats
Achievement: UNIT RADIUS DATA EXTRACTION COMPLETE - Base stats now include unit radius information from wiki
Result: Complete unit information available for simulation environments and AI positioning algorithms
๐จ BREAKTHROUGH: Text-Based Pattern Matching for Unit Radius Data
- Problem Identified: Complex CSS selectors couldn't match unit radius data structure
- Solution Implemented: Text pattern matching using regex to extract values from concatenated labels
- Real Data Extracted: Gameplay Radius, Selection Radius, Pathing Radius, Acquisition Radius
- Conditional Integration: Unit radius only included for base stats, excluded for level-specific stats
- MCP Tool Enhanced: get_champion_stats now returns complete unit information when appropriate
โ Successfully Extracting Unit Radius Data:
- Taric: Gameplay Radius (65), Selection Radius (135), Pathing Radius (35), Acquisition Radius (350)
- Sona: Gameplay Radius (65), Selection Radius (110), Pathing Radius (35), Acquisition Radius (800)
- Real Wiki Values: Matches official LoL Wiki displayed data perfectly
- Clean Implementation: Only shows data that exists, no empty fields
๐ฏ Next Task: Task 2.1.11 - Enhanced get_ability_details MCP Tool with Details Tab
๐ Current MCP Server Status:
- โ Infrastructure: 4 MCP tools registered and accessible via Cursor
- โ Working Tools: Real champion stats AND abilities extraction from live wiki pages
- โ Level-Specific Stats: Selenium-powered exact stat values for any level 1-18
- โ All Abilities: Complete abilities parsing with real wiki data for any champion
- โ CSS-Based Parsing: Robust implementation following best practices
- โ Selenium Integration: Browser automation for interactive wiki scraping