A Python package and MCP server to control video players for MultiViewer, the best way to watch motorsports like Formula 1.
Project description
A Python package, command line interface and MCP server to control video players for MultiViewer, the best way to watch Formula 1.
Table of Contents
Features
Command line interface for controlling MultiViewer. Useful for integrations with control interfaces like StreamDeck
Pythonic interface for controlling MultiViewer. No GraphQL needed!
MCP server for controlling MultiViewer - perfect for controlling the broadcast for with AI agents.
black Praise the Dark Lord
Installation
The latest version can be installed via pip.
$ pip install mvf1
Quickstart
Command Line
$ mvf1-cli --help
Model Context Protocol (MCP) Server
$ mvf1-cli mcp
To use in an AI agent, use your framework’s affordance for a stdio MCP server.
Here is an example with PydanticAI.
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerStdio
server = MCPServerStdio(
'mvf1-cli',
args=[
'mcp'
]
)
agent = Agent('openai:gpt-4o', mcp_servers=[server])
Library
Displaying all players
>>> from mvf1 import MultiViewerForF1
>>> remote = MultiViewerForF1()
>>> remote.players
[6: INTERNATIONAL, 7: PER]
Pause all players
>>> from mvf1 import MultiViewerForF1
>>> remote = MultiViewerForF1()
>>> for player in remote.players:
>>> player.mute()
{'data': {'playerSetMuted': True}}
{'data': {'playerSetMuted': True}}
Retrieve specific player
>>> from mvf1 import MultiViewerForF1
>>> remote = MultiViewerForF1()
>>> player = remote.player(6)
>>> player.state
{'ts': 1677168293.21, 'paused': False, 'muted': True, 'volume': 100, 'live': False, 'currentTime': 10.002025, 'interpolatedCurrentTime': 363.656025}
Switch stream of player to data channel
>>> from mvf1 import MultiViewerForF1
>>> remote = MultiViewerForF1()
>>> player = remote.player(6)
>>> player.switch_stream('DATA')
{'data': {'playerCreate': '12'}}
Synchronize all players to specific player
>>> from mvf1 import MultiViewerForF1
>>> remote = MultiViewerForF1()
>>> player = remote.player(6)
>>> player.sync()
{'data': {'playerSync': True}}
Synchornize all players to player streaming broadcast commentary
>>> from mvf1 import MultiViewerForF1
>>> remote = MultiViewerForF1()
>>> remote.player_sync_to_commentary()
{'data': {'playerSync': True}}
Development
Hacking
To hack on the project, clone the GitHub repo:
$ git clone https://github.com/RobSpectre/mvf1
Then install in a virtualenv.
$ pip install -e ./
Test
The project uses tox for tests. Simply run from project root
$ tox
Meta
Written by Rob Spectre.
Released under MIT License.
Software is as is - no warranty expressed or implied, diggity.
This package is not developed or maintained by MultiViewer or Formula 1 TV.
Shout out to the excellent MultiViewer team! This app absolutely changed how I enjoy Formula 1.
🏎️ Go Weeyums! 🏎️
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mvf1-2.0.1.tar.gz.
File metadata
- Download URL: mvf1-2.0.1.tar.gz
- Upload date:
- Size: 23.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f63bb6e70dc7ddf0f2a254e59c6538b4ab0aa7a7f93b35845851889a01a35928
|
|
| MD5 |
605b8feca038c3afe53c705146d7aca6
|
|
| BLAKE2b-256 |
7471cbf45fff035198680794bee923d161770d7455ed9b9e62ef6f07e7175a71
|
File details
Details for the file mvf1-2.0.1-py3-none-any.whl.
File metadata
- Download URL: mvf1-2.0.1-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fecf40a2643a859e96102c815bc79c43098d11d59464db79dc9d01b9742b72e
|
|
| MD5 |
2a7431aba6af5d769b8b8a8f1b3192b5
|
|
| BLAKE2b-256 |
b3f607e1af05f55b1ae129aad3e29efbd4b678a17906951118eb2a5044ef8239
|