Skip to main content
Glama



About

Turns a host agent's analysis of a football video into reviewed, reproducible output. The agent proposes timed events and drawings, an operator approves the exact digest, and a worker renders it. Everything runs locally over MCP stdio or a CLI, with no editor or desktop automation.

  • Tag events (defending, transitions, attacking, set pieces, goals) and export a Once-compatible CSV.

  • Ingest local or permitted YouTube video, with persistent jobs, cancel/retry and hash-verified artifacts.

  • Render reels with drawings, tracking, formations, time stop and slow motion; export statistics.

  • Optionally export through a locally installed Once Sport executable.


Related MCP server: mcp-video-studio

Status

Pre-release (0.1.0a1). Interfaces may change. Tested on Linux with Python 3.13 and FFmpeg only.

  • Native Once export rejects holds, speed segments, text, flags and the newer drawing kinds; use the custom renderer for them.

  • Tracking is seeded by the host, one target per job. There is no re-identification, occlusion recovery or automatic player detection.

  • Not implemented: magnifier, player vision, chroma key, image import, field mapping.

  • Untested: opening native output in the Once GUI, Windows and macOS.

  • Rendering 1080p costs roughly 0.1-0.25 s per output frame; keep clips short.

  • The reviewer name is an operator assertion, not authentication.


Install

Requires Python 3.11+, uv, and ffmpeg/ffprobe on PATH (plus yt-dlp for YouTube sources).

From the repository root:

uv sync                     # core
uv sync --extra tracking    # adds OpenCV for tracking
uv run once-sport-mcp       # starts the MCP stdio server

Configuration

Read at server start. With none set, only four timeline tools are registered.

Variable

Meaning

ONCE_SPORT_OUTPUT_DIR

Where CSV files are written (default .data/output).

ONCE_SPORT_WORKSPACE

Absolute dedicated directory. Setting it enables the workflow tools.

ONCE_SPORT_ALLOWED_SOURCE_DIRS

JSON array of permitted source directories (default <workspace>/inputs).

ONCE_SPORT_TRACKING_ENABLED

1 enables tracking tools (needs the tracking extra).

ONCE_SPORT_NATIVE_EXECUTABLE

Absolute path to the Once executable; enables native export.

MCP client entry (replace the placeholders):

{
  "mcpServers": {
    "once-sport": {
      "command": "/absolute/path/to/once-sport-mcp/.venv/bin/once-sport-mcp",
      "env": {
        "ONCE_SPORT_WORKSPACE": "/absolute/path/to/workspace",
        "ONCE_SPORT_ALLOWED_SOURCE_DIRS": "[\"/absolute/path/to/videos\"]",
        "ONCE_SPORT_TRACKING_ENABLED": "1"
      }
    }
  }
}

Usage

Timeline tools (always available): validate_timeline, generate_once_import_csv, search_events, summarize_phases. An event has event_id, period (1-4), start_seconds, end_seconds, team, phase, action, and optional players, notes, flag (good/bad/favourite) and playlists. Phases: defending, transition_to_attack, attacking, transition_to_defend, set_piece_attack, set_piece_defend, goal, goal_conceded. See examples/timeline.synthetic.json.

Workflow (needs a workspace). Jobs run in a separate worker process:

uv run python -m once_sport_mcp.worker --root /absolute/path/to/workspace \
  --allow-source-dir /absolute/path/to/videos --enable-tracking

Flow: create_analysis_project → request_analysis_evidence (frames) → submit_analysis_proposal → operator review_analysis_proposal with the exact digest → request_analysis_export (reel) or request_analysis_statistics, then list_analysis_artifacts / get_analysis_artifact. Exports before approval, or with a stale digest, are refused.

The same flow is available from the CLI: uv run once-sport-workflow --help.


Features

Drawing kinds (custom renderer): ellipse, arrow, line, polygon, label, polyline, curve, area, spotlight, stopwatch, and speed (slow motion 0.25/0.5x or fast forward 2/4x, audio silent inside). Drawings accept keyframes for movement, and hold_seconds pauses the clip on a drawing (time stop).

  • Tracking: request_analysis_tracking follows one seeded target with OpenCV CSRT and flags loss for review.

  • Formations: build_formation_drawings composes 2-11 tracked targets into lines, rings or spotlights, and an area. It stops before targets might overlap and never submits anything itself.

  • Statistics: XLSX, HTML and JSON counts by phase, team, action, period, goals, players, flags and playlists. No video needed.

  • Playlists: request_analysis_export(playlist="NAME") renders only the events in that playlist.

  • Native export: request_native_analysis_export uses the installed Once executable for the supported subset and fails closed otherwise.


Development

uv run --frozen --extra tracking pytest -q
uv run --frozen --extra tracking ruff check .
uv run --frozen --extra tracking ruff format --check .

The workflow state lives only in your workspace directory; Once Sport's own project database is never read or modified. Timeline inputs are not deliberately logged, but your MCP client may retain them. Avoid sensitive data.

Released under the MIT License.

Available Tools

4 tools
generate_once_import_csvB

Create a new CSV in the configured output directory; app import is unverified.

Inputs: events (required), filename (required). Returns: object

search_eventsC
Read-onlyIdempotent

Filter validated source events; team/player match exactly, action is a substring.

Inputs: events (required), team, phase, action, +2 more. Returns: object

summarize_phasesB
Read-onlyIdempotent

Count source events by phase, returning the underlying timestamped evidence.

Inputs: events (required). Returns: object

validate_timelineB
Read-onlyIdempotent

Validate a human-reviewed timeline. Times are video offsets in seconds.

Inputs: events (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 4 tools

    Disambiguation4/5

    Each tool occupies a distinct stage of the workflow: CSV generation, timeline validation, event search, and phase summarization. search_events and summarize_phases both operate over source events and could be momentarily confused, but the descriptions (filter vs. count-by-phase) make the boundary clear.

    Naming Consistency4/5

    All four tools follow a verb_noun snake_case pattern (validate_timeline, search_events, summarize_phases). The one deviation is generate_once_import_csv, where the product name is embedded in the middle, making it slightly awkward but still readable and predictable.

    Tool Count4/5

    Four tools is on the lean side but maps cleanly to the import/validate/search/summarize pipeline, with each tool earning its place. It is close to feeling thin since there is no tool for reading or editing the timeline itself.

    Completeness3/5

    The surface covers generation, validation, search, and aggregation, but validate_timeline presumes a human-reviewed timeline that no tool can fetch or inspect, and there is no way to list unfiltered events or retrieve a single event. These are workable but notable gaps for an agent-driven workflow.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Gives AI agents video perception by turning screen recordings, films and URLs into timestamped structured evidence: ordered UI states and transitions, per-screen OCR, shots, camera motion, palettes, on-screen text and speech, all cached locally with no API keys. Includes drill-down tools to zoom into intervals, crop full-resolution frames, diff two moments, and search on-screen text and speech across everything watched.
      15
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to perform deterministic FFmpeg video edits—silence removal, vertical reframing, 3D LUT grading, and metadata/audio extraction—and generate native CapCut Desktop drafts, with a local web studio for previewing and batch processing.
      5
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables coding agents to inspect footage through contact sheets and facts, render edit files or numbered frames to MP4 using local ffmpeg, and save, list, restore, or diff video versions.
      312 npm
      MIT