This project consists of two parts:
- MCP Server (
mcp-server/): A Python server that connects to the Clash Royale API. Based on the work by Baighasan/Chat-Royale. - Visualization Dashboard (
viz-dashboard/): A Next.js web application to display the data.
- Python 3.10+
- Node.js 18+
- Clash Royale API Key (You have already set this up in
mcp-server/.env)
The MCP server exposes the Clash Royale data to AI assistants or MCP clients.
-
Open a terminal and navigate to the server directory:
cd mcp-server -
Create a virtual environment (recommended) and activate it:
python3 -m venv venv source venv/bin/activate -
Install the dependencies:
pip install -e . -
Test the Server: You can use the MCP Inspector to test the server interactively.
npx @modelcontextprotocol/inspector python src/main.py
This will open a web interface where you can try out tools like
get_player_info.
The dashboard is a web app where you can view the data.
-
Open a new terminal window and navigate to the dashboard directory:
cd viz-dashboard -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and go to: http://localhost:3000
The dashboard displays a static snapshot of Clash Royale meta data. This ensures fast load times and no API rate limits for users.
To fetch fresh data (e.g., daily), use the provided update script:
- Open your terminal in the project root.
- Run the update script:
./update_data.sh
What this does:
- Runs
viz-dashboard/scripts/fetch_meta.pyto fetch the latest top 1000 player battles and card stats. - Generates a new
meta_snapshot.json. - Automatically commits and pushes the new data to GitHub.
- Triggers a redeploy on Vercel (if connected).
Note: You need a valid CR_API_KEY in mcp-server/.env for this to work.