# 🎮 GRID.gg Esports MCP Server
> **A "Brain Extension" for AI Agents to directly access professional Esports data.**
This Model Context Protocol (MCP) server bridges the gap between Large Language Models (like Claude, Gemini, or JetBrains AI) and the **GRID.gg Esports API**. It allows AI assistants to autonomously search for teams, find match replay files, and understand the complex data schemas of professional *League of Legends* and *Valorant* matches.
Built for the **Cloud9 x JetBrains "Sky's the Limit" Hackathon**.
## ✨ Features
This server exposes 4 powerful tools to your AI Agent:
1. **`explore_graphql_schema`**: The "Librarian." It introspects the GRID Central Data API to learn available fields (Teams, Players, Tournaments) on the fly, ensuring zero hallucinations when writing queries.
2. **`execute_central_query`**: The "Scout." Executes live GraphQL queries to find Team IDs, Match IDs (Series), and Tournament details.
3. **`list_match_files`**: The "Analyst." Retrieval tool that finds specific JSONL replay files (`series-events`) for a given match.
4. **`get_event_definition`**: The "Dictionary." Provides the hard-coded schema for complex in-game events (like `ward-placed` or `player-moved`) that aren't available via GraphQL introspection.
## 🚀 Getting Started
### Prerequisites
* Node.js (v18 or higher)
* A **GRID.gg API Key** (from the Hackathon portal)
### Installation
1. **Clone the repository:**
```bash
git clone [https://github.com/resilientbeast/grid-esports-mcp.git](https://github.com/resilientbeast/grid-esports-mcp.git)
cd grid-esports-mcp
```
2. **Install dependencies:**
```bash
npm install
```
3. **Build the server:**
```bash
npm run build
```
## ⚙️ Configuration
To use this with an MCP Client (like **Claude Desktop** or **JetBrains AI**), add the following configuration to your config file (e.g., `claude_desktop_config.json`):
```json
{
"mcpServers": {
"grid-gg": {
"command": "node",
"args": [
"/absolute/path/to/grid-esports-mcp/dist/index.js"
],
"env": {
"GRID_API_KEY": "YOUR_ACTUAL_API_KEY_HERE"
}
}
}
}