Skip to main content
Glama
CFB MCP Server

CFB MCP Server

README.md
# CFB MCP Server

A Model Context Protocol (MCP) server that provides access to the [College Football Data API](https://collegefootballdata.com/). This server enables LLMs like Claude to query college football data including games, teams, players, statistics, rankings, recruiting, betting lines, and advanced analytics.

## Features

- **Games**: Get schedules, scores, and results for any season/week
- **Teams**: Look up team information, rosters, and matchup histories
- **Players**: Search players and retrieve detailed statistics
- **Rankings**: Access AP, Coaches, and CFP poll data
- **Statistics**: Team and player stats (basic and advanced)
- **Betting**: Point spreads, over/unders, and moneylines
- **Recruiting**: Player rankings, ratings, and commitments
- **Transfer Portal**: Track player transfers between programs
- **Advanced Analytics**: PPA, EPA, success rates, havoc rates, and more
- **Live Data**: Scoreboard and in-game updates (Patreon required)

## Prerequisites

- Python 3.10 or higher
- A College Football Data API key (get one free at [collegefootballdata.com/key](https://collegefootballdata.com/key))

## Installation

### From Source

```bash
git clone https://github.com/yourusername/cfb-mcp-server.git
cd cfb-mcp-server
pip install -e .
```

### Using uv (recommended)

```bash
uv pip install cfb-mcp-server
```

## Configuration

### Set Your API Key

The server requires a College Football Data API key. Set it as an environment variable:

```bash
# Linux/macOS
export CFBD_API_KEY="your-api-key-here"

# Windows (PowerShell)
$env:CFBD_API_KEY="your-api-key-here"

# Windows (Command Prompt)
set CFBD_API_KEY=your-api-key-here
```

For persistent configuration, add it to your shell profile (`.bashrc`, `.zshrc`, etc.) or use a `.env` file.

## Usage

### Running the Server

#### Stdio Transport (for local use with Claude Desktop)

```bash
python cfb_mcp_server.py
```

#### HTTP Transport (for remote access)

```bash
python -c "from cfb_mcp_server import mcp; mcp.run(transport='streamable_http', port=8000)"
```

### Claude Desktop Configuration

Add this to your Claude Desktop config file:

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

```json
{
  "mcpServers": {
    "cfb": {
      "command": "python",
      "args": ["/path/to/cfb_mcp_server.py"],
      "env": {
        "CFBD_API_KEY": "your-api-key-here"
      }
    }
  }
}
```

Or using uvx:

```json
{
  "mcpServers": {
    "cfb": {
      "command": "uvx",
      "args": ["cfb-mcp-server"],
      "env": {
        "CFBD_API_KEY": "your-api-key-here"
      }
    }
  }
}
```

## Available Tools

| Tool | Description |
|------|-------------|
| `cfb_get_games` | Get game schedules and results |
| `cfb_get_teams` | Get team information |
| `cfb_get_team_matchup` | Get head-to-head history between two teams |
| `cfb_search_players` | Search for players by name |
| `cfb_get_team_roster` | Get a team's roster |
| `cfb_get_rankings` | Get poll rankings (AP, Coaches, CFP) |
| `cfb_get_team_season_stats` | Get team statistics |
| `cfb_get_player_season_stats` | Get player statistics |
| `cfb_get_betting_lines` | Get betting lines and spreads |
| `cfb_get_recruiting` | Get recruiting data and rankings |
| `cfb_get_advanced_stats` | Get advanced analytics (PPA, success rate) |
| `cfb_get_drives` | Get drive-level data |
| `cfb_get_plays` | Get play-by-play data |
| `cfb_get_conferences` | Get conference information |
| `cfb_get_coaches` | Get coach information and records |
| `cfb_get_sp_ratings` | Get SP+ ratings |
| `cfb_get_transfer_portal` | Get transfer portal data |
| `cfb_get_game_weather` | Get weather data for games |
| `cfb_get_team_records` | Get team win-loss records |
| `cfb_get_live_scoreboard` | Get live game scores (Patreon) |

## Example Queries

Once connected to Claude, you can ask questions like:

- "Show me Alabama's 2025 schedule and results"
- "Who are the top 25 teams in the AP poll for week 10 of 2023?"
- "What's the all-time record between Ohio State and Michigan?"
- "Find the top rushing leaders in the SEC for 2023"
- "Show me the 5-star recruits committed to Georgia for 2024"
- "What are the betting lines for this week's Big Ten games?"
- "Get me the SP+ ratings for the top 10 teams"
- "Who transferred from Alabama in 2024?"

## Response Formats

All tools support two response formats:

- **markdown** (default): Human-readable formatted output
- **json**: Raw JSON data for programmatic processing

Specify the format using the `response_format` parameter.

## Rate Limits

The College Football Data API has rate limits based on your subscription tier:

- **Free**: 1,000 calls/month
- **Patreon tiers**: Higher limits and access to premium endpoints

The server includes error handling for rate limit responses.

## Development

### Setup Development Environment

```bash
git clone https://github.com/campbelltaylor32/cfb-mcp-server.git
cd cfb-mcp-server
pip install -e ".[dev]"
```

## API Documentation

For detailed information about available endpoints and parameters, see:

- [College Football Data API Docs](https://api.collegefootballdata.com/)
- [cfbfastR Package Reference](https://cfbfastr.sportsdataverse.org/reference/index.html)

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Acknowledgments

- [College Football Data](https://collegefootballdata.com/) for providing the API
- [cfbfastR](https://cfbfastr.sportsdataverse.org/) for inspiration on API structure
- [Model Context Protocol](https://modelcontextprotocol.io/) for the MCP specification

## Disclaimer

This project is not affiliated with, endorsed by, or sponsored by College Football Data, the NCAA, or any college football team. All data is provided by the College Football Data API.