Content
# 🏏 Sports MCP Server
A Spring Boot based Model Context Protocol (MCP) Server that provides AI-accessible sports analytics tools. This project demonstrates how AI assistants such as Claude Desktop, Gemini, or other MCP-compatible clients can interact with sports data including players, teams, matches, tournaments, and statistics.
---
## 🚀 Features
- MCP Server implementation using Spring AI MCP
- Cricket Teams Management
- Player Information & Statistics
- Match Data Management
- Tournament Management
- AI Tool Integration
- MongoDB Data Storage
- Sample Cricket Dataset Initialization
- MCP Tool Exposure for AI Clients
---
## 🏗️ Tech Stack
- Java 21
- Spring Boot 3.x
- Spring AI MCP
- MongoDB
- Maven
- Lombok
---
## 📂 Project Structure
```text
src/main/java/com/sports/mcp/server
│
├── config
│ ├── DataInitializer.java
│ └── McpServerConfig.java
│
├── entity
│ ├── Player.java
│ ├── Team.java
│ ├── Match.java
│ ├── Tournament.java
│ └── PlayerStatistics.java
│
├── repository
│ ├── PlayerRepository.java
│ ├── TeamRepository.java
│ ├── MatchRepository.java
│ ├── TournamentRepository.java
│ └── PlayerStatisticsRepository.java
│
├── service
│ └── SportsService.java
│
├── tools
│ └── SportsTools.java
│
└── SportsMcpServerApplication.java
```
---
## ⚙️ MCP Tools
The server exposes sports-related tools that AI assistants can invoke.
### Example Tools
### Get Player Details
```java
getPlayerByName(String playerName)
```
### Get Team Information
```java
getTeamDetails(String teamName)
```
### Get Player Statistics
```java
getPlayerStatistics(String playerName)
```
### Get Tournament Details
```java
getTournamentDetails(String tournamentName)
```
---
## 🗄️ Sample Data
The application automatically initializes sample cricket data on startup:
### Teams
- India
- Australia
- England
- South Africa
### Players
- Rohit Sharma
- Virat Kohli
- Jasprit Bumrah
- Shubman Gill
### Tournaments
- ICC Cricket World Cup
- ICC Champions Trophy
- Asia Cup
### Matches
- India vs Australia
- India vs England
- Australia vs South Africa
---
## 🔧 Configuration
### application.properties
```properties
spring.application.name=sports-mcp-server
spring.ai.mcp.server.name=sports-analytics-server
spring.ai.mcp.server.version=1.0.0
spring.ai.mcp.server.type=SYNC
spring.ai.mcp.server.stdio=true
spring.main.web-application-type=none
```
---
## ▶️ Running the Application
### Clone Repository
```bash
git clone https://github.com/your-username/sports-mcp-server.git
```
### Navigate to Project
```bash
cd sports-mcp-server
```
### Build Project
```bash
mvn clean install
```
### Run Application
```bash
mvn spring-boot:run
```
---
## 🔌 MCP Client Integration
This MCP Server can be connected to:
- Claude Desktop
- Gemini MCP Clients
- Custom MCP Clients
- AI Agents
- MCP Inspector
The server communicates using the MCP protocol over STDIO.
---
## 📊 Example Queries
Once connected to an MCP client:
```text
Show details of Rohit Sharma
```
```text
Get India's team information
```
```text
Show Rohit Sharma statistics
```
```text
List all tournaments
```
---
## 🎯 Purpose
The purpose of this project is to demonstrate:
- MCP Server Development
- Spring AI MCP Integration
- AI Tool Exposure
- Sports Analytics Data Management
- AI-to-Database Communication
---
## 👨💻 Author
Udatha Venkata Sai
Java Backend Developer | Spring Boot | MongoDB | AI Integration | MCP Development
---
## 📜 License
This project is created for learning and demonstration purposes.