Cause: Virtual environment not activated or dependencies not installed
Solution:
# Activate virtual environment
cd /home/shaun/repos/mcp-riot
source .venv/bin/activate # Linux/Mac
# or
.venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# or (if using uv)
uv syncVerify:
python -c "import mcp; print(mcp.__version__)"Cause: .env file missing or API key not configured
Solution:
# Check if .env exists
ls -la /home/shaun/repos/mcp-riot/.env
# If not, create it
cp /home/shaun/repos/mcp-riot/.env.example /home/shaun/repos/mcp-riot/.env
# Edit .env and add your API key
nano /home/shaun/repos/mcp-riot/.env
# Should look like:
# RIOT_API_KEY=RGAPI-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxGet API Key:
- Visit https://developer.riotgames.com/
- Sign in / Create account
- Create new API key
- Copy the key
- Paste into .env file
Cause: Port already in use or firewall blocking
Solution:
# Check if port is in use
lsof -i :8000 # or whatever port is configured
# Kill existing process
kill -9 <PID>
# Try again
python src/server.pyCause: Player name/tag not found or typo in game name
Solution:
# Check exact spelling in League client
# Format: "Game Name#Tag" (case-sensitive for tag)
# Correct format examples:
await lol_get_player_summary("Tyler1", "NA1")
await lol_get_player_summary("Doublelift", "NA1")
await lol_get_player_summary("Doinb", "CN2") # Different regions use different tags
# Common mistakes:
❌ await lol_get_player_summary("tyler1", "na1") # Should be "NA1" (uppercase)
❌ await lol_get_player_summary("Tyler1", "Tyler1") # Tag ≠ name
✅ await lol_get_player_summary("Tyler1", "NA1")Find Correct Format:
# Check player profile on op.gg or league.gg
# The tag is shown after # in their nameCause: Champion name misspelled or incorrect format
Solution:
# Use EXACT champion name (case-insensitive matching)
# Check valid names:
Valid:
✅ "Amumu", "Lee Sin", "Ahri", "Yone", "K'Sante"
Invalid:
❌ "amumu" → ✅ Works (case-insensitive)
❌ "Amu" → ❌ Incomplete name
❌ "Lee" → ❌ Incomplete (use "Lee Sin")
❌ "Kassadin" → ❌ Check exact spelling
# Check champion list at:
# https://ddragon.leagueoflegends.com/en/latest/champion.jsonCause: API is returning data but in unexpected format, or player has no data
Solution:
# Check if player exists first
result = await lol_get_player_summary("Name", "Tag")
if "error" in result:
print(f"Player not found: {result['error']}")
return
# Check if specific data is available
if result.get("soloRank") is None:
print("Player hasn't played ranked solo yet")
# Try different platform
result = await lol_get_player_summary("Name", "Tag", platform="euw")Cause: API key invalid, expired, or rate limited
Solution:
# Check API key validity
echo $RIOT_API_KEY # Should show your key
# Get new API key from developer portal
# https://developer.riotgames.com/
# Check rate limits
# Riot's rate limiting: 20 requests per 1 second, 100 requests per 2 minutes
# If you hit limits, add delay:
import asyncio
await asyncio.sleep(1) # Wait 1 second between requests
# Verify the key is correct
# Copy from developer portal
# Paste into .env
# Restart the serverCause: API is slow or network is slow
Solution:
# API was slow, retry automatically happens
# If persistent, try different endpoint
# Some endpoints are slower than others
# For batch requests, use concurrent async:
import asyncio
async def get_multiple(players):
# Concurrent (fast)
return await asyncio.gather(*[
lol_get_player_summary(name, tag)
for name, tag in players
])
# vs
async def get_multiple_slow(players):
# Sequential (slow)
results = []
for name, tag in players:
results.append(await lol_get_player_summary(name, tag))
return resultsCause: Player is new or plays rarely
Solution:
# Check if player has played any matches
result = await lol_get_recent_matches("Name", "Tag", count=100)
if len(result['recentMatches']) == 0:
print("No matches found - player might be new")
# Try requesting more matches
result = await lol_get_recent_matches("Name", "Tag", count=50)
# Check if they play in different region
result = await lol_get_recent_matches("Name", "Tag", platform="euw", count=50)Cause: Player hasn't played ranked this season
Solution:
result = await lol_get_player_summary("Name", "Tag")
if result.get("soloRank") is None:
print("Player hasn't played Solo Queue ranked")
if result.get("flexRank") is None:
print("Player hasn't played Flex ranked")
# They might have played Clash or Tournaments instead
# Check challenges instead
challenges = await lol_get_challenges("Name", "Tag")Cause: Player might have AFK'd or left game early
Solution:
details = await lol_get_match_details(match_id, puuid)
# Check game duration - if very short, they probably left
duration = details['gameDuration']['minutes']
if duration < 5:
print("Game ended very early - likely early FF")
# Check damage - 0 damage means they didn't play
damage = details['damage']['totalDamageDealtToChampions']
if damage == 0:
print("Player was likely AFK")Cause: Player hasn't played TFT or new account
Solution:
result = await tft_get_player_summary("Name", "Tag")
if "error" in result:
print("TFT data not available")
# Try different region
result = await tft_get_player_summary("Name", "Tag", platform="euw")
if result.get("tftRank") is None:
print("Player hasn't played TFT ranked yet")Cause: Using wrong platform code or player on different region
Solution:
# Supported platforms
platforms = ["na", "euw", "kr", "br", "las", "lan", "ru", "tr", "jp", "oc", "pbe"]
# Try each until one works
for platform in platforms:
result = await lol_get_player_summary("Name", "Tag", platform=platform)
if "error" not in result:
print(f"Found player on {platform}")
break
# Or check player's actual region first
# Look on op.gg or leagueofgraphs.comCause: Same account name on multiple regions (not linked)
Solution:
# Each region is separate
# "Faker" on KR is different from "Faker" on NA
result_kr = await lol_get_player_summary("Faker", "NA", platform="kr")
result_na = await lol_get_player_summary("Faker", "NA", platform="na")
# Different PUUIDs = different accounts
if result_kr['puuid'] != result_na['puuid']:
print("These are different accounts")Cause: Response format different than expected
Solution:
import json
result = await lol_get_player_summary("Name", "Tag")
# Check what you actually got
print(type(result)) # Should be dict
print(json.dumps(result, indent=2)) # Pretty print
# Check for errors first
if isinstance(result, dict) and "error" in result:
print(f"Error: {result['error']}")
return
# Now safe to access
if isinstance(result, dict):
level = result.get('level')Cause: Data might be None or missing
Solution:
result = await lol_get_player_summary("Name", "Tag")
# Safe access using .get()
❌ tier = result['soloRank']['tier'] # KeyError if soloRank is None
✅ tier = result.get('soloRank', {}).get('tier') # Returns None safely
# Or check first
if result.get('soloRank'):
tier = result['soloRank']['tier']
else:
print("No rank data")Cause: Using wrong field name from docs
Solution:
# Check TOOLS_REFERENCE.md for exact field names
# camelCase is used consistently
result = await lol_get_player_summary("Name", "Tag")
# Correct names:
✅ result['gameName'] # Not 'name' or 'game_name'
✅ result['tagLine'] # Not 'tag' or 'tag_line'
✅ result['soloRank'] # Not 'rank' or 'solo_rank'
✅ result['topChampions'] # Not 'champions' or 'top_champs'
# Print available keys to verify
print(result.keys())Cause: Server not running or MCP not registered
Solution:
# Make sure server is running
ps aux | grep "python.*server.py"
# If not running, start it
cd /home/shaun/repos/mcp-riot
python src/server.py
# Restart Claude Desktop
# Cmd+Q on Mac, or close on Windows
# Reopen Claude Desktop
# Check settings → MCP Server
# Should show "riot" as connectedCause: Server crashed after starting or code has errors
Solution:
# Check for syntax errors
python -m py_compile src/server.py
# If it compiles OK, check for runtime errors
python src/server.py
# Watch console output for errors
# Try calling a tool and check console
# If error, fix in src/server.py
# Save file
# Restart Claude DesktopCause: Cache not refreshed or server not reloaded
Solution:
# Restart Claude Desktop completely
# This refreshes the MCP connection
# Or manually restart the MCP server:
# 1. Stop the running server (Ctrl+C)
# 2. Wait 5 seconds
# 3. Start it again: python src/server.py
# 4. Restart ClaudeCause: Network latency or API overload
Solution:
import time
start = time.time()
result = await lol_get_player_summary("Name", "Tag")
end = time.time()
print(f"Request took {end - start:.2f} seconds")
# Normal times:
# Player summary: 0.5-1.0s
# Recent matches: 1-2s
# Match details: 0.2-0.5s
# If slower, check:
# 1. Internet connection
# 2. API status: https://developer.riotgames.com/apis#lol-status
# 3. Retry after a few secondsCause: Too many requests too fast
Solution:
import asyncio
# Add delays between requests
async def get_players_slowly(players):
results = []
for name, tag in players:
result = await lol_get_player_summary(name, tag)
results.append(result)
await asyncio.sleep(0.5) # Wait 500ms between requests
return results
# Or use concurrent with fewer workers
async def get_players_batched(players, batch_size=3):
results = []
for i in range(0, len(players), batch_size):
batch = players[i:i+batch_size]
batch_results = await asyncio.gather(*[
lol_get_player_summary(name, tag)
for name, tag in batch
])
results.extend(batch_results)
await asyncio.sleep(1) # Wait 1s between batches
return resultsUse this to troubleshoot any issue:
- API key is valid (check at developer.riotgames.com)
- .env file exists and is readable
- Virtual environment is activated
- All dependencies are installed (pip list)
- Server is running (no errors in console)
- Player name/tag is spelled correctly
- Region code is correct (na, euw, kr, etc.)
- Network connection is working
- Firewall allows outgoing HTTPS
- API status is OK (https://developer.riotgames.com/apis#lol-status)
- TOOLS_REFERENCE.md - Tool parameters
- EXAMPLES.md - Working examples
- ARCHITECTURE.md - How it works
- MIGRATION.md - Upgrading guide
import logging
logging.basicConfig(level=logging.DEBUG)
# Now you'll see detailed request logs- Report API issues: https://developer.riotgames.com/apis#lol-status
- Check status page for incidents
# Verify everything
python -c "
import os
from dotenv import load_dotenv
load_dotenv()
api_key = os.getenv('RIOT_API_KEY')
print(f'API Key set: {bool(api_key)}')
print(f'Key format: {api_key[:20] if api_key else None}...')
"| Error | Likely Cause | Solution |
|---|---|---|
| ModuleNotFoundError | Virtual env not active | source .venv/bin/activate |
| "API_KEY not set" | .env missing | Create .env with API key |
| "Failed to find player" | Wrong name/tag | Check spelling, use correct format |
| "Champion not found" | Wrong champ name | Check exact champion name |
| 403 Forbidden | Invalid API key | Get new key from developer portal |
| Timeout | API slow | Retry, check network |
| No data | Player new | Try different region |
| Tool not showing | Server not running | Start server, restart Claude |
| Slow requests | Rate limited | Add delays between requests |
Last Updated: 2025-01-02
Version: 2.0.0
Last Reviewed: 2025-01-02