# mlbserver

> [![Docker release](https://img.shields.io/docker/v/tonywagner/mlbserver)](https://hub.docker.com/r/tonywagner/mlbserver) [![NPM release](https://img.shields.io/npm/v/mlbserver)](https://www.npmjs.com/package/mlbserver) ![License](https://img.shields.io/

Latest version **2026.7.27** (published 2026-07-28) · 0 weekly downloads

## Install

```sh
npm install mlbserver
pnpm add mlbserver
yarn add mlbserver
bun add mlbserver
```

Provides the command `mlbserver`.

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2026.7.27 |
| Published | 2026-07-28 |
| First published | 2021-07-14 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 826.3 KB |
| Known vulnerabilities | 0 (+3 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 113 |
| Maintainers | tonywagner |

## Links

- npm: https://www.npmjs.com/package/mlbserver
- Repository: https://github.com/tonywagner/mlbserver
- Homepage: https://github.com/tonywagner/mlbserver#readme
- Issues: https://github.com/tonywagner/mlbserver/issues
- npm.io page: https://npm.io/package/mlbserver

## Dependencies (12)

- [http](https://npm.io/package/http.md) 0.0.1-security
- [root](https://npm.io/package/root.md) ^3.2.0
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.23
- [request](https://npm.io/package/request.md) ^2.88.2
- [minimist](https://npm.io/package/minimist.md) ^1.2.8
- [hls-server](https://npm.io/package/hls-server.md) ^1.5.0
- [http-attach](https://npm.io/package/http-attach.md) ^1.0.0
- [ffmpeg-static](https://npm.io/package/ffmpeg-static.md) ^4.4.0
- [fluent-ffmpeg](https://npm.io/package/fluent-ffmpeg.md) ^2.1.2
- [readline-sync](https://npm.io/package/readline-sync.md) ^1.4.10
- [request-promise](https://npm.io/package/request-promise.md) ^4.2.6
- [tough-cookie-filestore](https://npm.io/package/tough-cookie-filestore.md) ^0.0.1

## Recent versions

- 2026.7.27 (latest) — 2026-07-28
- 2026.7.22-2 — 2026-07-22
- 2026.7.22 — 2026-07-22
- 2026.7.20 — 2026-07-21
- 2026.5.27 — 2026-05-28
- 2026.5.26 — 2026-05-27
- 2026.4.23 — 2026-04-23
- 2026.4.16 — 2026-04-16
- 2026.4.1-2 — 2026-04-01
- 2026.3.27-2 — 2026-03-28
- 2026.3.15 — 2026-03-15
- 2026.2.23 — 2026-02-24
- 2026.2.22 — 2026-02-23
- 2026.2.20 — 2026-02-20
- 2025.11.29 — 2025-11-29
- … 127 more at https://npm.io/package/mlbserver/versions

## README

[![Docker release](https://img.shields.io/docker/v/tonywagner/mlbserver)](https://hub.docker.com/r/tonywagner/mlbserver)
[![NPM release](https://img.shields.io/npm/v/mlbserver)](https://www.npmjs.com/package/mlbserver)
![License](https://img.shields.io/badge/license-MIT-blue)
[![Contributors](https://img.shields.io/github/contributors/tonywagner/mlbserver.svg)](https://github.com/tonywagner/mlbserver/graphs/contributors)

# mlbserver

## Installation

### node-cli
```
npm install -g mlbserver
```

### docker
```
docker pull tonywagner/mlbserver:latest
```


## Launch

### node-cli (follow the prompts on first run, or see below for possible command line options)
```
mlbserver
```
or in application directory:
```
node index.js
```

### docker-compose
Update the required environment variables in the sample [docker-compose.yml](https://github.com/tonywagner/mlbserver/blob/master/docker-compose.yml) file, then launch it with ```docker-compose up --detach```

### docker-cli
Update the environment variables in the sample [docker-cli](https://github.com/tonywagner/mlbserver/blob/master/docker-cli) command, then run the command. Subsequent runs can be launched with ```docker start mlbserver```


## Usage

After launching the server or Docker container, you can access it at http://localhost:9999 on the same machine, or substitute your computer's IP address for localhost to access it from a different device. Load that address in a web browser to start using the server and to see more documentation.

Basic command line or Docker environment options:

```
--port or -p (primary port to run on; defaults to 9999 in Docker or if not specified)
--debug or -d (false if not specified)
--version or -v (returns package version number)
--logout or -l (logs out and clears session)
--session or -s (clears session)
--cache or -c (clears cache)
--env or -e (use environment variables instead of command line arguments; automatically applied in the Docker image)
--login_page or -lp (false if not specified, login is done via a login page and uses cookies)
```

Advanced command line or Docker environment options:

```
--account_username (required, email address, default will use stored credentials or prompt user to enter them if not using Docker)
--account_password (required, default will use stored credentials or prompt user to enter them if not using Docker)
--fav_teams (optional, comma-separated list of favorite team abbreviations from https://github.com/tonywagner/mlbserver/blob/master/session.js#L23 -- will prompt if not set or stored and not using Docker)
--http_root (specify the alternative http webroot or initial path prefix, default is none)
--free (optional, highlights free games)
--multiview_port (local port for multiview streaming; defaults to 1 more than primary port, or 10000; does not need to be mapped or used externally)
--multiview_path (where to create the folder for multiview encoded files; defaults to app directory)
--ffmpeg_path (path to ffmpeg binary to use for multiview encoding; default downloads a binary using ffmpeg-static)
--ffmpeg_encoder (ffmpeg video encoder to use for multiview; default is the software encoder libx264)
--ffmpeg_logging (if present, logs all ffmpeg output -- useful for checking encoding speed or troubleshooting)
--page_username (username to protect pages; default is no protection)
--page_password (password to protect pages; default is no protection)
--content_protect (specify the content protection key to include as a URL parameter, if page protection is enabled)
--login_page (optional, enable login page authentication; default is false, uses browswer popup when unset)
--gamechanger_delay (specify extra delay for the gamechanger switches in 10 second increments, default is 0)
--data_directory (defaults to installed application directory; in the Docker image, this defaults to /mlbserver/data_directory for mapping persistent storage)
```

Supports [SWAG](https://docs.linuxserver.io/general/swag/#preset-proxy-confs) using the custom [mlbserver.subfolder.conf](https://github.com/tonywagner/mlbserver/blob/master/mlbserver.subfolder.conf) file.

For multiview, the default software video encoder is limited by your CPU. You may want to experiment with different ffmpeg hardware video encoders. "h264_videotoolbox" is confirmed to work on supported Macs, and "h264_v4l2m2m" is confirmed to work on a Raspberry Pi 4 (and likely other Linux systems) when ffmpeg is compiled with this patch: https://www.raspberrypi.org/forums/viewtopic.php?p=1780625#p1780625

More potential hardware encoders are described at https://stackoverflow.com/a/50703794

```
h264_amf to access AMD gpu, (windows only)
h264_nvenc use nvidia gpu cards (work with windows and linux)
h264_omx raspberry pi encoder
h264_qsv use Intel Quick Sync Video (hardware embedded in modern Intel CPU)
h264_v4l2m2m use V4L2 Linux kernel api to access hardware codecs
h264_vaapi use VAAPI which is another abstraction API to access video acceleration hardware (Linux only)
h264_videotoolbox use videotoolbox an API to access hardware on OS X
```

## Credits

https://github.com/tonycpsu/streamglob
https://github.com/mafintosh/hls-decryptor
https://github.com/eracknaphobia/plugin.video.mlbtv


## License

MIT

---
_Source: https://npm.io/package/mlbserver · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
