Skip to main content

CLI and MCP server for Scottfree Analytics sports predictions API

Project description

Scottfree Sports CLI & MCP Server

Command-line tool and MCP server for the Scottfree Analytics sports predictions API. Premium customers can use it to gather model picks, line movement, odds, model history, public consensus, weather, live scores, injuries, rosters, and prediction-market context from the terminal or an AI assistant.

Installation

# From PyPI (recommended)
pip install scottfree-sports-cli

# Or with uv
uv tool install scottfree-sports-cli

# From repo (development)
cd sflow-cli && uv sync --dev

Quick Start

# Configure your API key
sfs config set --api-key sk_alphapysports_... --env default

# For local development
sfs config set --api-key dev_local_alphapy_key --api-url http://localhost:8009 --env local

# Get today's predictions
sfs predictions get nba spread
sfs predictions get mlb over_under

# List available sports and models
sfs predictions list-sports

Commands

sfs
  brief         Daily model research briefing
  config        Manage API configuration and profiles
  predictions   Get game predictions
  results       Get historical prediction results
  summary       Get model performance summaries
  odds          Get current betting odds
  markets       Prediction market odds
  consensus     Public betting consensus
  weather       Game-day weather for outdoor venues
  scores        Live scores and injury reports
  account       Manage your account
  admin         Admin operations (Scottfree admin only)

Brief — the model research command

Combines model predictions with market lines for every game on the slate. The brief shows ML model picks, model probability, market-implied probability, signed Delta(Model-Implied), and model-position counts. It does not claim a guaranteed edge, Kelly sizing, or EV.

sfs brief get mlb                # Today's MLB games
sfs brief get nhl                # NHL playoff games
sfs brief get mlb -o json        # Structured JSON

Predictions

sfs predictions get nba spread          # Table output (default)
sfs predictions get nba spread -o json  # JSON output (pipeable)
sfs predictions get nfl ml -o csv       # CSV output
sfs predictions list-sports             # Available sports & models

Results & Summary

sfs results get nba spread --limit 20
sfs summary get nhl over_under

Line Movement

The CLI exposes the same opener/current fields used by the app's Predictions and Summary pages:

sfs predictions get mlb over_under -o json
sfs predictions get mlb spread -o json
sfs predictions get mlb ml -o json

Relevant fields include open_over_under, over_under, open_home_point_spread, home_point_spread, open_home_money_line, home_money_line, open_away_money_line, and away_money_line.

Odds

sfs odds get nba

sfs odds get renders a terminal table today. Use the REST API directly for full JSON:

curl -H "X-API-Key: $SFS_API_KEY" \
  https://sports-api.scottfreellc.com/api/v1/odds/mlb

Public Consensus, Weather, Scores, Injuries, and Markets

sfs consensus get mlb
sfs weather get mlb
sfs scores scores mlb
sfs scores injuries nba
sfs scores players nba --search "James"
sfs markets kalshi nfl
sfs markets polymarket nba
sfs markets compare mlb

AI Analysis

Scottfree Sports does not generate AI narratives. Connect the MCP server to Claude Desktop, Claude Code, Cursor, or another compatible MCP host and ask anything in natural language — your LLM synthesizes answers using the data tools above with your own API key. ChatGPT support depends on your ChatGPT plan/workspace supporting custom remote MCP apps/connectors.

Account Management

sfs account info                          # Account details
sfs account usage                         # API usage stats
sfs account keys                          # List API keys
sfs account create-key --name "CLI Key"   # Create new key
sfs account rename-key sk_... --name "X"  # Rename key
sfs account revoke-key sk_...             # Revoke key

Output Formats

Flag Format Use Case
-o table Rich table (default) Terminal viewing
-o json Raw JSON Piping to jq, scripts
-o csv CSV Spreadsheets, data analysis

Configuration

Config is stored in ~/.sfs/config.toml:

[default]
api_key = "sk_alphapysports_..."
api_url = "https://sports-api.scottfreellc.com"

[local]
api_key = "dev_local_alphapy_key"
api_url = "http://localhost:8009"

Resolution Order

  1. SFS_API_KEY / SFS_API_URL environment variables (highest)
  2. --env flag selects a profile
  3. [default] profile (lowest)

Model Type Shorthands

Shorthand Full Value
spread won_on_spread
moneyline, ml won_on_points
over_under, ou over_under

MCP Server

The sfs-mcp command exposes predictions as tools for AI assistants (Claude Code, Claude Desktop).

Claude Code Setup

Add to ~/.claude/mcp.json:

{
  "mcpServers": {
    "scottfree-sports": {
      "command": "uv",
      "args": ["run", "--project", "/path/to/sflow-cli", "sfs-mcp"],
      "env": {
        "SFS_API_KEY": "sk_alphapysports_...",
        "SFS_API_URL": "https://sports-api.scottfreellc.com"
      }
    }
  }
}

Available MCP Tools

Tool Description
get_daily_brief Daily model research brief with ML model picks
get_predictions ML predictions for today's games
get_results Historical prediction results
get_summary Model performance metrics
get_odds Current betting odds
get_sports List sports and model types
get_account_info Account details
get_usage API usage statistics
get_kalshi_markets Kalshi prediction market prices
get_polymarket_odds Polymarket prediction market odds
compare_market_odds Cross-reference markets vs ML model
get_betting_consensus Public betting percentages
get_game_weather Game-day weather for outdoor venues
get_live_scores Live game scores
get_injuries Current injury reports
get_players Player rosters
clear_cache Clear cache (admin)
invalidate_cache Invalidate specific cache entries (admin)

Supported Sports

MLB, NBA, NCAAB, NCAAF, NFL, NHL

Complete Documentation

Development

cd sflow-cli
uv sync --dev
uv run pytest tests/ -v        # Run tests
uv run ruff check src/ tests/  # Lint

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scottfree_sports_cli-0.2.1.tar.gz (129.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scottfree_sports_cli-0.2.1-py3-none-any.whl (46.4 kB view details)

Uploaded Python 3

File details

Details for the file scottfree_sports_cli-0.2.1.tar.gz.

File metadata

  • Download URL: scottfree_sports_cli-0.2.1.tar.gz
  • Upload date:
  • Size: 129.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for scottfree_sports_cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fcc6eb628a44fcf624bcbb9308752fc3f5861dded530daaf4c5887381a08d8fe
MD5 90d01062363b7ab62548d2ea4816db83
BLAKE2b-256 7e5b902535f3063e87280e21c885acbdd4b274fb47d4ec1aba04e3c331572099

See more details on using hashes here.

File details

Details for the file scottfree_sports_cli-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for scottfree_sports_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 882cac260ce5e6bc6408dde33d2262696b9c6624c9de708c71d822e47a43794b
MD5 ff8710f351d567571c746524cc6c16d4
BLAKE2b-256 b62ff4d4d511f02b52c92a4886ba65a2a5f2754c5b1f8890c2433f37241cd14a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page