mlb-discord-rpc shows live Major League Baseball game updates as your Discord status. It uses Discord Rich Presence to display real-time scores, game status, and player info for your favorite team while you use Discord. When no live game is detected, it displays the upcoming matchup with your opponent's logo and shows the score from the previous game. The large and small image tooltips include each team's win–loss record. Pre-game statuses now also show the scheduled start time. Live game updates display the current ball and strike count for the batter only during active half-innings, and show which players are up next between innings.
Screenshosts of different states of matches
Pre Game Example:
Live Game Example (with player on 1nd base):
Final Game Example:
This project requires the following dependencies:
- Programming Language: Python (3.9+)
- Package Manager: Pip
Build mlb-discord-rpc from the source and install dependencies:
- Clone the repository:
git clone https://github.com/RoMinjun/mlb-discord-rpc
- Navigate to the project directory:
cd mlb-discord-rpc - Install the dependencies:
Using pip:
pip install -r requirements.txt
Run the project with: Example:
python mlb-discord-rpc.py --team TORYou can configure mlb-discord-rpc via command-line options, a config.toml file, and environment variables (.env file).
--team <TEAM_ABBR>(required) Sets your favorite MLB team by its abbreviation (e.g.,LAD,TOR,CHC, etc.).--tz <TIMEZONE>Override the detected local timezone. Use IANA timezone names (e.g.,America/Toronto).--live-onlyOnly show your Discord status when your team has a live game.
Example:
python script.py --team TOR --tz America/Toronto --live-onlyYou may also set options persistently by editing (or creating) a config.toml file in the project directory.
Example:
team = "TOR"
timezone = "America/Toronto"
live_only = true
[display]
base_icon_filled = "🟦"
base_icon_empty = "⚪"
[refresh]
live_interval = 15
idle_interval = 90team- Team abbreviation (required)timezone- IANA timezone string (optional)live_only- Only display presence when game is live (optional)[display]- Customize base icons[refresh]- Customize update intervals in seconds
CLIENT_IDYour Discord application's client ID. Required to connect to Discord RPC.
Example .env:
CLIENT_ID=your_discord_client_id_here
- Set your
CLIENT_IDin.env. - Optionally configure your team and preferences in
config.toml. - Or run directly with command-line options.
Enjoy seamless MLB presence on Discord!


