convez.ai
MCP ServerDados & AnalyticsAvançado
butterflyskies

Fantrax MCP — Análise e Otimização de Baseball Fantasy

butterflyskies/fantrax-mcp

Análise inteligente de rosters e otimização de lineups para fantasy baseball

Ver no GitHub
InicialPluginScore · de 0 a 100

Servidor MCP em Rust que integra análise de rosters, otimização de escalações e projeções FanGraphs para ligas de fantasy baseball no Fantrax. Oferece recomendações multi-agente com histórico rastreável via ledger, suporte a múltiplos formatos de scoring (H2H, roto, híbrido) e cache SQLite para minimizar chamadas externas.

Instalação

$npx convez-ai butterflyskies/fantrax-mcp

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
50%
Último commit
há 2 meses
Versão
—
Issues abertas
25
Contribuidores
2

Casos de uso

  • Otimizar escalações diárias considerando platoons e arremessadores prováveis
  • Analisar sugestões de waiver wire e pickups com histórico de recomendações
  • Gerar briefings matinais com análise de resultados e plano de ação

Veredito

Ferramenta especializada e bem-arquitetada para entusiastas de fantasy baseball. A implementação em Rust com cache SQLite e suporte a múltiplas ligas é robusta, mas o caso de uso é nicho e requer conhecimento específico do domínio.

README

A tradução para o português deste README ainda está na fila.

fantrax-mcp

Fantasy baseball MCP server for Fantrax. Exposes roster analysis, lineup optimization, MLB game context, FanGraphs projections, and a multi-agent recommendation ledger via the Model Context Protocol (streamable HTTP).

Features

  • Multi-league support with mixed scoring formats (H2H, roto, hybrid, custom)
  • Platoon-aware lineup optimization (batter handedness vs. probable starter)
  • Morning briefings: yesterday's results, today's action items, recommendation history
  • FanGraphs rest-of-season projections (Steamer, ZiPS, ATC, etc.)
  • Recommendation ledger for multi-agent debate and outcome tracking
  • SQLite-backed caching to minimize external API calls
  • Read-only: no roster mutations

MCP Tools

ToolDescription
list_leaguesList all fantasy leagues for the configured user
get_standingsCurrent standings for a league
get_rostersTeam rosters for a league and scoring period
get_league_infoLeague metadata: teams, matchup schedules, roster constraints, scoring config
get_player_idsAll player IDs for a sport (defaults to MLB)
get_probable_startersToday's MLB probable starting pitchers with handedness
get_player_snippetA player's stat line from a specific date's box score
optimize_lineupPlatoon-based start/sit recommendations for your roster
get_briefingMorning briefing: what happened, what to do, hot takes
get_projectionsFanGraphs rest-of-season projections for batters or pitchers
log_recommendationLog a recommendation (pickup/drop/start/sit/waiver) to the ledger
query_ledgerQuery the recommendation ledger, optionally filtered by agent
record_outcomeRecord the outcome (win/loss/neutral) of a recommendation
pingHealth check with server version and league count

Configuration

Copy the example config and fill in your values:

cp config.toml.example config.toml

The config requires:

  • fantrax.user_secret_id -- your Fantrax API secret (find under account settings or extract from authenticated requests)
  • [[leagues]] -- one or more league entries with id, name, league_type, lineup, and optional keeper flag
  • projections.source -- FanGraphs projection system (steamer, zips, atc, thebat, thebatx)
  • server.bind_addr -- bind address (127.0.0.1 for local, 0.0.0.0 for containers)
  • server.port and server.db_path -- port and SQLite database path

See config.toml.example for all fields with comments.

Running

Build and run locally

cargo build --release
./target/release/fantrax-mcp --config config.toml

CLI options:

  -c, --config <PATH>           Path to TOML config file [default: config.toml]
  -p, --port <PORT>             Override server port from config
      --bind-addr <ADDR>        Override bind address (e.g. 0.0.0.0 for containers)
      --db-path <PATH>          Override database path from config
      --max-sessions <N>        Maximum concurrent MCP sessions [default: 10]
      --idle-timeout-secs <N>   Idle session timeout in seconds, 0 to disable [default: 14400]
  -V, --version                 Print version
  -h, --help                    Print help

The server starts on http://<bind_addr>:<port> with:

  • GET /healthz -- liveness probe
  • GET /readyz -- readiness probe (verifies DB access)
  • /mcp -- MCP streamable HTTP endpoint

With a container

docker build -t fantrax-mcp .
docker run -p 3001:3001 -v ./config.toml:/config.toml:ro fantrax-mcp

Or with a custom db path mounted:

docker run -p 3001:3001 \
  -v ./config.toml:/config.toml:ro \
  -v fantrax-data:/data \
  fantrax-mcp --config /config.toml

Environment

Set RUST_LOG to control log verbosity:

RUST_LOG=info ./target/release/fantrax-mcp
RUST_LOG=fantrax_mcp=debug,tower_http=info ./target/release/fantrax-mcp

MCP client configuration

Connect any MCP client to http://127.0.0.1:3001/mcp using the streamable HTTP transport. Example Claude Code configuration:

{
  "mcpServers": {
    "fantrax": {
      "type": "streamable-http",
      "url": "http://127.0.0.1:3001/mcp"
    }
  }
}

Architecture

See docs/design/ for full design documents:

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Ver o original no GitHub

Bom para

Relacionados