Skip to main content
Glama
jay-arora31

IPL MCP Server

by jay-arora31

IPL MCP Server

A Model Context Protocol (MCP) server that provides natural language access to IPL (Indian Premier League) cricket match data. Built using data from Cricsheet with an enhanced sample of 18 IPL matches including Virat Kohli games and CSK vs MI classics.

🏏 Features

  • Natural Language Queries: Ask questions about IPL data in plain English

  • Enhanced Dataset: 18 carefully selected IPL matches including:

    • Virat Kohli batting performances (99 runs in 4 matches)

    • CSK vs MI classic encounters (3 matches)

    • All major IPL teams represented

  • Rich Analytics: Player stats, team performance, match analysis

  • Claude Desktop Integration: Works seamlessly with Claude Desktop

  • Fast SQL Backend: Efficient SQLite database with optimized queries

  • Extensible: Can easily be extended to work with the full 1,169+ match dataset

Related MCP server: cricket-mcp

🚀 Quick Start

Prerequisites

  • Python 3.11+

  • uv package manager

  • Claude Desktop (for MCP integration)

Installation

  1. Clone and setup:

git clone <your-repo>
cd ipl-mcp-server
  1. Install dependencies:

uv install
  1. Setup database and load data:

uv run python main.py --setup --data-dir data_small

This will:

  • Create SQLite database tables

  • Process 18 sample JSON match files (includes V Kohli & CSK vs MI)

  • Calculate player and team statistics

  • Takes ~10-15 seconds to complete

  1. Test the queries (optional):

uv run python test_queries.py
  1. Start the MCP server:

uv run python main.py --server

🎯 Example Queries

Basic Match Information

  • "Show me all matches in the dataset"

  • "How many matches are in the database?"

  • "Which team won the most matches?"

  • "What was the highest total score?"

  • "Show matches played in Mumbai"

Player Performance

  • "Who scored the most runs across all matches?"

  • "Which bowler took the most wickets?"

  • "Show me Virat Kohli's batting stats"

  • "Who has the best bowling figures in a single match?"

  • "Show all centuries scored"

Advanced Analytics

  • "What's the average first innings score?"

  • "Which venue has the highest scoring matches?"

  • "What's the most successful chase target?"

  • "Which team has the best powerplay performance?"

  • "Show me partnership records over 100 runs"

Match-Specific Queries

  • "Show me the scorecard for match between CSK and MI"

  • "How many sixes were hit in the final?"

  • "What was the winning margin in the closest match?"

🔧 Claude Desktop Integration

  1. Add to Claude Desktop config:

Edit your Claude Desktop MCP configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "ipl-cricket-server": {
      "command": "uv",
      "args": ["run", "python", "main.py", "--server"],
      "cwd": "/path/to/your/ipl-mcp-server"
    }
  }
}
  1. Restart Claude Desktop

  2. Test the connection: Ask Claude: "Show me IPL team statistics"

📊 Database Schema

The server uses SQLite with the following key tables:

  • matches: Match metadata (teams, venue, date, outcome)

  • innings: Innings-level data (totals, wickets, overs)

  • deliveries: Ball-by-ball data (runs, wickets, extras)

  • player_stats: Aggregated batting/bowling statistics

  • team_stats: Team performance metrics

  • players: Player registry with Cricsheet IDs

  • teams: Team information

🛠️ Advanced Usage

Command Line Options

# Setup database (first time only)
uv run python main.py --setup

# Reset database and reload data
uv run python main.py --reset

# Start server (default)
uv run python main.py --server

# Custom data directory
uv run python main.py --setup --data-dir /path/to/data

API Integration

The server can be extended to work with other MCP clients beyond Claude Desktop. The query engine supports pattern matching for natural language understanding.

Adding Custom Queries

Extend the QueryEngine class in src/mcp_server/query_engine.py:

{
    'pattern': r'your.*query.*pattern',
    'handler': self.your_handler_method,
    'description': 'Your query description'
}

📈 Performance

  • Database Size: ~3MB for 18 sample matches

  • Setup Time: 10-15 seconds for data load

  • Query Response: <1 second for most queries

  • Memory Usage: ~50MB typical runtime

🚀 Scaling to Full Dataset

The system can easily handle the complete 1,169 match dataset:

  • Full Database Size: ~50MB

  • Full Setup Time: 2-3 minutes

  • Simply use --data-dir data instead of --data-dir data_small

🔍 Sample Query Results

Query: "Which team won the most matches?"

📊 **Team with most wins**

1. Mumbai Indians | 120 wins | 203 matches | 59.11% win rate
2. Chennai Super Kings | 118 wins | 195 matches | 60.51% win rate
3. Royal Challengers Bangalore | 88 wins | 203 matches | 43.35% win rate
...

Query: "Show me Virat Kohli batting stats"

🏏 **V Kohli** Batting Stats:
• Total Runs: 99
• Matches: 4  
• Highest Score: N/A
• Average: 24.75
• Strike Rate: 117.86
• Sixes: 4
• Fours: 8

🗄️ Data Source

All data comes from Cricsheet, which provides:

  • Ball-by-ball data for IPL matches from 2008-2017 seasons (enhanced sample of 18 matches)

  • Player registry with unique identifiers

  • Match metadata including officials, venues, outcomes

  • JSON format with comprehensive match details

  • Full dataset available: 1,169+ matches (2008-2024) can be loaded by using --data-dir data

🤝 Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Add your improvements

  4. Test with sample queries

  5. Submit a pull request

📝 License

This project is licensed under the MIT License. Data provided by Cricsheet under their terms of use.

🚀 Working with Full Dataset

To use the complete 1,169 match dataset instead of the sample:

  1. Reset and load full data:

uv run python main.py --reset --data-dir data

⚠️ This will take 2-3 minutes to complete

  1. Benefits of full dataset:

  • Complete IPL history (2008-2024)

  • More accurate player statistics

  • Comprehensive team performance data

  • Better trend analysis capabilities

✅ Verify Installation

Test your setup with these commands:

# Quick database check
uv run python -c "from src.database.database import get_db_session; from src.database.models import *; session = get_db_session(); print(f'✅ Database ready: {session.query(Match).count()} matches loaded')"

# Test natural language query
uv run python -c "from src.mcp_server.query_engine import QueryEngine; print(QueryEngine().process_query('how many matches'))"

# Run interactive demo
uv run python test_queries.py

Built with ❤️ for cricket analytics and AI-powered data exploration

Available Tools

1 tool
query_ipl_dataC

Query IPL cricket data using natural language. Examples: - 'Show me all matches in the dataset' - 'Which team won the most matches?' - 'Who scored the most runs across all matches?' - 'What was the highest total score?' - 'Show matches played in Mumbai' - 'Who has the best bowling figures?' - 'Show me Virat Kohli batting stats' - 'What's the average first innings score?' - 'Show me all centuries scored' - 'Which venue has the highest scoring matches?'

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language query about IPL cricket data

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool accepts natural language queries but does not describe response format, error handling, data scope (e.g., which seasons), limitations, or performance traits. The examples hint at capabilities but lack explicit behavioral details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with a clear purpose statement, but the extensive list of 10 examples adds bulk without proportional value. Some examples are redundant (e.g., multiple 'Show me' queries), and the structure could be more streamlined by grouping or summarizing query types.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It does not explain what the tool returns (e.g., data format, structure), potential errors, or data limitations. For a query tool with unspecified output, this leaves significant gaps for an AI agent to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the parameter 'query' documented as 'Natural language query about IPL cricket data.' The description adds minimal value beyond this, as it restates the natural language aspect in the first sentence and provides examples. Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Query IPL cricket data using natural language.' This specifies the verb ('query'), resource ('IPL cricket data'), and input method ('natural language'). However, with no sibling tools provided, it cannot demonstrate differentiation from alternatives, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no explicit guidance on when to use this tool versus alternatives. It lists examples of queries but does not mention prerequisites, constraints, or scenarios where this tool is appropriate. Without sibling tools, it cannot reference alternatives, but it still lacks basic usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool updatev0.1.0
    • First observedquery_ipl_data

TDQS

B3/5.0
Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'query_ipl_data' has a clearly defined purpose that cannot be confused with any other tool in this server.

Naming Consistency5/5

The single tool name 'query_ipl_data' follows a clear verb_noun pattern. With only one tool, naming consistency is inherently perfect as there are no other tools to compare against or create inconsistencies with.

Tool Count2/5

A single tool for an IPL cricket data server feels too thin for the apparent scope. The examples suggest complex queries about matches, players, venues, and statistics, which would typically require multiple specialized tools for a complete interface. One tool attempting to handle all these diverse queries through natural language is insufficient for proper domain coverage.

Completeness2/5

The server appears to cover IPL cricket data, but with only one natural language query tool, the surface is severely incomplete. There are no dedicated tools for specific operations like retrieving match details, player statistics, team information, or venue data. The single tool approach creates significant gaps that will likely cause agent failures when trying to perform structured operations.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables querying log data stored in SQLite databases through the Model Context Protocol, allowing natural language interactions with log analysis.
    -
  • F
    license
    Not graded
    quality
    B
    maintenance
    An MCP server that enables natural language querying of over 10 million ball-by-ball cricket deliveries stored in a local DuckDB database. It provides 26 tools for analyzing player matchups, situational stats, and historical records across all major cricket formats and tournaments.
    2
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to interact with SQLite databases by executing read and write queries, listing tables, and inspecting schemas. It provides a secure, local interface for database management and data retrieval through the Model Context Protocol.
    2
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Provides comprehensive NBA statistics via Model Context Protocol, enabling queries for player stats, game scores, team info, and advanced analytics through natural language.
    21
    10
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jay-arora31/ipl-match-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server