Clash Royale MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "CLASH_ROYALE_API_TOKEN=${CLASH_ROYALE_API_TOKEN}" clash-royale -- uv run clash-royale-mcp
Required:CLASH_ROYALE_API_TOKEN+ 1 optional
README.md

Integrates with the official Clash Royale API for real-time game data.

Clash Royale MCP Server

A Model Context Protocol (MCP) server that wraps the official Clash Royale API. Exposes player, clan, card, tournament, and ranking data as MCP tools usable from Claude Desktop or Claude Code.

Prerequisites

  • Python 3.11+
  • `uv` (recommended) or pip
  • A Clash Royale developer API token

Getting an API Token

  1. Go to https://developer.clashroyale.com and sign in.
  2. Click My Account → Create New Key.
  3. Enter a name and your current public IP address — tokens are IP-locked.
  4. Copy the token.

IP locking gotcha: If your IP changes (home network, VPN, etc.) your token will return 403 errors. Either create a new key or use the RoyaleAPI community proxy (see below).

Using the RoyaleAPI Proxy (recommended for local dev)

The proxy at https://proxy.royaleapi.dev/v1 forwards requests to the official API without IP locking. Set it via the env var:

CLASH_ROYALE_BASE_URL=https://proxy.royaleapi.dev/v1

Installation

git clone <repo>
cd clash-royale-mcp

# Copy and fill in your token
cp .env.example .env
# Edit .env: set CLASH_ROYALE_API_TOKEN=your_token_here

# Install with uv
uv sync

# Or with pip
pip install -e .

Running Locally

# Test the server directly (exits immediately — use fastmcp dev for interactive testing)
python -m clash_royale_mcp.server

# Interactive MCP inspector (recommended for development)
fastmcp dev src/clash_royale_mcp/server.py

Claude Desktop Integration

Add to your claude_desktop_config.json (usually at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "clash-royale": {
      "command": "uv",
      "args": ["run", "clash-royale-mcp"],
      "env": {
        "CLASH_ROYALE_API_TOKEN": "your_token_here"
      }
    }
  }
}

Or if running without uv:

{
  "mcpServers": {
    "clash-royale": {
      "command": "python",
      "args": ["-m", "clash_royale_mcp.server"],
      "cwd": "/path/to/clash-royale-mcp",
      "env": {
        "CLASH_ROYALE_API_TOKEN": "your_token_here"
      }
    }
  }
}

Available Tools

Player

Tool Description
get_player Full player profile: trophies, level, wins/losses, clan, card collection
get_player_battlelog Recent battle history (up to 25 battles) with decks and outcomes
get_player_upcoming_chests Upcoming chest sequence in the player's cycle
get_player_recent_decks Deduplicated deck analysis with win rates and usage counts

Clan

Tool Description
get_clan Full clan profile and member roster
search_clans Search clans by name, location, or score thresholds
get_clan_members Paginated clan member list
get_clan_warlog Clan war history
get_clan_current_war Current active war state

Cards

Tool Description
get_cards Full card catalog (~100+ cards); cached after first call

Tournaments

Tool Description
search_tournaments Search open tournaments by name
get_tournament Tournament details by tag
get_global_tournaments All currently active global tournaments

Locations & Rankings

Tool Description
get_locations List locations/regions with their IDs
get_clan_rankings Top clan rankings for a location or globally
get_player_rankings Top player trophy rankings for a location or globally
get_clanwar_rankings Top clan war rankings for a location or globally

Environment Variables

Variable Default Description
CLASH_ROYALE_API_TOKEN (required) Your API token from developer.clashroyale.com
CLASH_ROYALE_BASE_URL https://api.clashroyale.com/v1 API base URL; override for proxy

Tools (17)

get_playerRetrieves full player profile including trophies, level, wins, losses, clan, and card collection.
get_player_battlelogFetches recent battle history up to 25 battles with decks and outcomes.
get_player_upcoming_chestsRetrieves the upcoming chest sequence in the player's cycle.
get_player_recent_decksAnalyzes recent decks for win rates and usage counts.
get_clanRetrieves full clan profile and member roster.
search_clansSearches for clans by name, location, or score thresholds.
get_clan_membersRetrieves a paginated list of clan members.
get_clan_warlogRetrieves clan war history.
get_clan_current_warRetrieves the current active war state.
get_cardsRetrieves the full card catalog.
search_tournamentsSearches for open tournaments by name.
get_tournamentRetrieves tournament details by tag.
get_global_tournamentsRetrieves all currently active global tournaments.
get_locationsLists locations and regions with their IDs.
get_clan_rankingsRetrieves top clan rankings for a location or globally.
get_player_rankingsRetrieves top player trophy rankings for a location or globally.
get_clanwar_rankingsRetrieves top clan war rankings for a location or globally.

Environment Variables

CLASH_ROYALE_API_TOKENrequiredYour API token from developer.clashroyale.com
CLASH_ROYALE_BASE_URLAPI base URL; override for proxy (default: https://api.clashroyale.com/v1)

Configuration

claude_desktop_config.json
{"mcpServers": {"clash-royale": {"command": "uv", "args": ["run", "clash-royale-mcp"], "env": {"CLASH_ROYALE_API_TOKEN": "your_token_here"}}}}

Try it

What are my upcoming chests in Clash Royale?
Show me the recent battle log for player tag #ABC12345.
Find the top 10 clans in the United States.
What is the current status of the active clan war for my clan?
List all currently active global tournaments.

Frequently Asked Questions

What are the key features of Clash Royale?

Real-time access to player profiles, battle logs, and chest cycles.. Comprehensive clan management tools including war logs and member rosters.. Global and regional ranking lookups for players and clans.. Full card catalog access with caching support.. Tournament search and details retrieval..

What can I use Clash Royale for?

Tracking personal chest cycles to optimize gameplay rewards.. Analyzing recent battle performance and deck win rates.. Monitoring clan war progress and member activity.. Researching top-tier player decks and global tournament standings..

How do I install Clash Royale?

Install Clash Royale by running: uv sync

What MCP clients work with Clash Royale?

Clash Royale works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Clash Royale docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare