Aakansha09/IPL-MCP-Server
If you are the rightful owner of IPL-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 IPL MCP Server is a Model Context Protocol server designed to provide detailed IPL cricket statistics from ball-by-ball match data.
IPL MCP Server š
A Model Context Protocol (MCP) server that provides detailed IPL cricket statistics from ball-by-ball match data. This server allows AI assistants to query comprehensive cricket data including teams, players, matches, ball-by-ball details, and performance statistics.
Features
- Team Information: Get team details with win/loss records
- Player Information: Access player stats with batting/bowling performance
- Match Details: Query complete match information with scores and innings
- Ball-by-Ball Data: Get detailed delivery-wise match commentary
- Player Performance: Analyze batting, bowling, and fielding statistics
- Match Officials: Access umpire and referee information
- Venue Information: Get stadium details with match statistics
- SQLite Database: Fast, reliable local data storage
- MCP Protocol: Standard Model Context Protocol implementation
Project Structure
ipl-mcp-server/
āāā data/ # Match data files (Cricsheet format)
ā āāā match_1.json # Ball-by-ball match data
ā āāā match_2.json
ā āāā match_3.json
ā āāā match_4.json
ā āāā match_5.json
āāā scripts/
ā āāā load_data.py # Data loading script (JSON ā SQLite)
āāā server/
ā āāā app.py # MCP Server implementation
āāā ipl.db # SQLite database (auto-generated)
āāā claude-desktop-config_ipl.json # Claude Desktop configuration
āāā setup_claude.sh # Claude Desktop setup script
āāā CLAUDE_DESKTOP_SETUP.md # Detailed setup guide
āāā README.md
Setup Instructions
Prerequisites
- Python 3.9+
- Virtual environment (recommended)
Installation
-
Navigate to the project directory:
cd ipl-mcp-server
-
Create and activate virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\\Scripts\\activate
-
Initialize Database:
python scripts/load_data.py
This creates the SQLite database and loads the match data.
-
Run the MCP Server:
python server/app.py
The server will listen for MCP requests on stdin/stdout.
Claude Desktop Setup
To use this MCP server with Claude Desktop:
1. Copy Configuration
Copy the Claude Desktop configuration:
# Create the directory if it doesn't exist
mkdir -p ~/Library/Application\ Support/Claude/
# Copy the configuration file
cp claude-desktop-config_ipl.json ~/Library/Application\ Support/Claude/mcp_settings.json
2. Restart Claude Desktop
- Quit Claude Desktop completely
- Reopen Claude Desktop
- The IPL MCP server should now be available
3. Test the Connection
In Claude Desktop, you can now ask cricket questions like:
- "What are the match details for match ID 1473508?"
- "Show me ball-by-ball commentary for the first 5 overs"
- "What was the bowling performance in that match?"
- "Which teams played in these matches?"
Troubleshooting
If Claude Desktop doesn't see the server:
- Check that the file is at:
~/Library/Application Support/Claude/mcp_settings.json
- Ensure the Python virtual environment path is correct in the config
- Verify the IPL database exists:
ls -la ipl.db
- Test the server manually:
python server/app.py
Available Tools
The MCP server provides these tools for cricket data analysis:
1. get_team_info
Get team information with match statistics.
- Parameters:
team_name
(optional) - Filter by team name or short name - Returns: Team details with win/loss records
2. get_player_info
Get player information with performance statistics.
- Parameters:
player_name
(optional) - Filter by player nameteam_name
(optional) - Filter by team
- Returns: Player profiles with batting/bowling stats
3. get_match_details
Get complete match information with scores and innings details.
- Parameters:
match_id
(optional) - Specific match IDseason
(optional) - Filter by seasonteam_name
(optional) - Filter by teamvenue
(optional) - Filter by venue
- Returns: Match details with innings scores and results
4. get_ball_by_ball
Get ball-by-ball commentary and delivery details.
- Parameters:
match_id
(required) - Match IDinnings
(optional) - Innings number (1 or 2)over_start
(optional) - Starting over numberover_end
(optional) - Ending over number
- Returns: Detailed delivery data with runs, wickets, extras
5. get_player_performance
Get comprehensive player performance statistics.
- Parameters:
player_name
(required) - Player namematch_id
(optional) - Specific matchstat_type
(optional) - 'batting', 'bowling', 'fielding', or 'all'
- Returns: Detailed performance metrics
6. get_match_officials
Get match officials information.
- Parameters:
match_id
(optional) - Match IDofficial_name
(optional) - Official name
- Returns: Umpires and match officials data
7. get_venue_info
Get venue information with match statistics.
- Parameters:
venue_name
(optional) - Filter by venue namecity
(optional) - Filter by city
- Returns: Venue details with match counts and results
Usage Examples
Basic MCP Request Format
Get team information:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_team_info",
"arguments": {
"team_name": "Royal Challengers"
}
}
}
Get ball-by-ball data:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "get_ball_by_ball",
"arguments": {
"match_id": "1473508",
"innings": 1
}
}
}
Get player performance:
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "get_player_performance",
"arguments": {
"player_name": "Virat Kohli",
"stat_type": "batting"
}
}
}
Database Schema
The SQLite database includes these tables:
teams
- Team information and detailsplayers
- Player profiles and statisticsmatches
- Match metadata and resultsinnings
- Innings-level statisticsdeliveries
- Ball-by-ball delivery dataofficials
- Match officials (umpires, referees)venues
- Stadium information
Contributing
- Fork the repository
- Create a feature branch
- Add your changes
- Submit a pull request
Happy Cricket Analytics! šš