Cricket Analytics MCP

Cricket Analytics MCP

Enables cricket analytics via natural language, including player stats, team performance, match results, comparisons, and news, powered by OpenAI and MCP.

Category
Visit Server

README

๐Ÿ Cricket Analytics MCP

An AI-powered Cricket Analytics Agent built with Model Context Protocol (MCP), OpenAI, Python, and Streamlit.

The project allows users to explore cricket statistics and ask natural-language questions about players, teams, matches, and player comparisons through an AI-powered interface.

โœจ Features

  • ๐Ÿ Cricket player statistics
  • ๐Ÿ“Š Player performance analysis
  • โš”๏ธ Compare two cricket players
  • ๐Ÿ† Team statistics and analysis
  • ๐Ÿ“… Match results and recent matches
  • ๐Ÿ“ฐ Cricket news search
  • ๐Ÿค– OpenAI-powered cricket analyst
  • ๐Ÿ”Œ MCP server for exposing cricket tools
  • ๐ŸŽจ Interactive Streamlit web interface
  • ๐Ÿ” Environment-based API key configuration

๐Ÿ—๏ธ Architecture

                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚    Streamlit UI     โ”‚
                    โ”‚  streamlit_app.py   โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                               โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚    OpenAI Agent      โ”‚
                    โ”‚   agent_openai.py    โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                               โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚     MCP Server      โ”‚
                    โ”‚      server.py       โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                               โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚    Data Provider    โ”‚
                    โ”‚  data_provider.py   โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ Project Structure

cricket-analytics-mcp/
โ”‚
โ”œโ”€โ”€ agent_openai.py       # OpenAI-powered cricket agent
โ”œโ”€โ”€ data_provider.py      # Cricket data and statistics provider
โ”œโ”€โ”€ server.py             # MCP server and cricket tools
โ”œโ”€โ”€ streamlit_app.py      # Streamlit frontend
โ”‚
โ”œโ”€โ”€ screenshots/          # Application screenshots
โ”‚   โ”œโ”€โ”€ player-stats.png
โ”‚   โ”œโ”€โ”€ player-comparison.png
โ”‚   โ””โ”€โ”€ dashboard.png
โ”‚
โ”œโ”€โ”€ .env                  # API keys and configuration (not committed)
โ”œโ”€โ”€ .gitignore            # Git ignored files
โ”œโ”€โ”€ requirements.txt      # Python dependencies
โ””โ”€โ”€ README.md             # Project documentation

๐Ÿ› ๏ธ Tech Stack

  • Python
  • OpenAI API
  • Model Context Protocol (MCP)
  • Streamlit
  • python-dotenv
  • Cricket statistics/data sources

๐Ÿ”ง MCP Tools

The MCP server can expose cricket-focused tools such as:

get_player_stats()
get_team_stats()
get_match_results()
get_player_comparison()
get_recent_matches()
search_cricket_news()

These tools allow the AI agent to retrieve structured cricket information and use it to answer user questions.

๐Ÿ’ฌ Example Queries

Show me Virat Kohli's ODI statistics.

Compare Virat Kohli and Rohit Sharma in ODI cricket.

Show me the recent matches of India.

Give me the Test statistics of Virat Kohli.

Compare the performance of two cricket players.

Show recent cricket news.

โš™๏ธ Installation

1. Clone the repository

git clone https://github.com/manasranjanmeher99/Cricket-Analytics-MCP.git
cd Cricket-Analytics-MCP

2. Create a virtual environment

Windows:

python -m venv .venv
.venv\Scripts\activate

3. Install dependencies

pip install -r requirements.txt

4. Configure environment variables

Create a .env file in the project root:

OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-5.6
CRICAPI_KEY= xxxxxxx

Never commit your .env file to GitHub.

โ–ถ๏ธ Running the Application

Start the Streamlit application

streamlit run streamlit_app.py

Then open the local Streamlit URL shown in your terminal.

Start the MCP server

If your project is configured to run the MCP server separately:

python server.py

Follow the MCP configuration used by your client/agent setup.

๐Ÿงช Project Workflow

User Question
      โ†“
Streamlit Interface
      โ†“
OpenAI Agent
      โ†“
MCP Tool Selection
      โ†“
MCP Server
      โ†“
Cricket Data Provider
      โ†“
Structured Cricket Data
      โ†“
OpenAI Analysis
      โ†“
Streamlit Response

๐Ÿ” Environment Variables

Variable Description


OPENAI_API_KEY OpenAI API key OPENAI_MODEL OpenAI model used by the agent CRICAPI_KEY Cric API key

Example:

OPENAI_API_KEY=sk-xxxxxxxx
OPENAI_MODEL=gpt-5.6
CRICAPI_KEY= xxxxxxx

๐Ÿ“ธ Screenshots

Add screenshots of the application to the screenshots/ directory.

Recommended screenshots:

  • Player statistics
  • Player comparison
  • Cricket analytics dashboard

Then reference them in this README:

![Player Statistics](screenshots/player-stats.png)

![Player Comparison](screenshots/player-comparison.png)

๐Ÿš€ Future Improvements

  • [ ] Live cricket scores
  • [ ] Live match commentary
  • [ ] Player rankings
  • [ ] Advanced player comparison charts
  • [ ] Team performance analytics
  • [ ] Historical match analysis
  • [ ] Cricket news aggregation
  • [ ] More MCP tools
  • [ ] Improved dashboard visualizations
  • [ ] Deployment to Streamlit Community Cloud

๐ŸŽฏ Use Cases

This project can be used for:

  • Cricket statistics exploration
  • Player performance analysis
  • AI-powered cricket research
  • Cricket data visualization
  • MCP learning and experimentation
  • Agentic AI portfolio development

๐Ÿ‘จโ€๐Ÿ’ป Author

Manas Ranjan Meher

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured