Skip to main content

machineplay

Upload a UCI chess engine as a Docker image and watch it play, live, on machineplay.org.

This package is the client side of that, in two roles:

  • the CLI (machineplay login / upload / whoami / logout) — builds the Dockerfile in the current directory, smoke-tests that it speaks UCI, pushes it to the machineplay registry and registers the new version.
  • the runner (machineplay runner) — a daemon that connects to the backend over a WebSocket, pulls engine images and plays games with fastchess, streaming every move back as it happens. Each game runs its two engines in sandboxed containers (no network, dropped capabilities, capped memory) pinned to one core.

Every external command either role runs is echoed first, so you can see exactly what touched your machine:

> docker build -t machineplay-local:latest .
> docker push registry.machineplay.org/alice/myengine:2026-08-08-12-30

Install

uv tool install machineplay     # or: pipx install machineplay

Needs Python 3.12+ and Docker. The runner additionally needs fastchess on PATH (or FASTCHESS_PATH pointing at it).

Upload an engine

Your engine is a Docker image whose entrypoint speaks UCI on stdin/stdout — start from python-chess-starter if you want a working example.

machineplay login          # opens machineplay.org/cli, paste the token
cd myengine                # the directory with your Dockerfile
machineplay upload

upload asks for an engine name and a version. The name groups versions — uploading under the same name again adds a version to the same engine, so keep it stable and don't bake a release number into it. Names are lowercase URL slugs: your engine ends up at machineplay.org/<you>/<engine>.

Run a runner

A runner offers your machine's cores to play games on. It needs an API token, either from machineplay login or in MP_TOKEN:

machineplay runner

It reports its hardware on connect, plays up to MAX_GAMES games concurrently (default: one per core), and reconnects on its own if the backend restarts. Its identity persists in ~/.config/machineplay/runner.json, so restarts show up as the same runner rather than a new one.

Files this writes

Path What
~/.config/machineplay/credentials.json API token from login (mode 0600)
~/.config/machineplay/runner.json this runner's stable id
~/.docker/config.json registry credentials, via docker login

machineplay logout removes all three (the last one via docker logout).

Configuration

Everything is overridable from the environment; the defaults point at production.

Variable Default What
MP_TOKEN — API token for the runner (overrides saved credentials)
RUNNER_ID persisted pin the runner's id explicitly
BACKEND_URL wss://api.machineplay.org/ws runner WebSocket endpoint
MAX_GAMES CPU count concurrent games (each pinned to its own core)
MACHINEPLAY_API_URL https://api.machineplay.org REST API for the CLI
MACHINEPLAY_WEB_URL https://machineplay.org website login opens
MACHINEPLAY_REGISTRY registry.machineplay.org image registry
FASTCHESS_PATH fastchess fastchess binary
ENGINE_MEMORY / ENGINE_CPUS 512m / 1 per-engine container limits
PULL_TIMEOUT 600 seconds before a stuck docker pull gives up
NO_COLOR — set to disable coloured output

License

This project is licensed under the GNU Affero General Public License, version 3 or (at your option) any later version (AGPL-3.0-or-later). See LICENSE for the full text.

Metadata

Release files for machineplay 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for machineplay 0.1.0
File Size Uploaded
machineplay-0.1.0.tar.gz 52.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for machineplay 0.1.0
File Interpreter ABI Platform
machineplay-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 91.9 kB

Release files / machineplay-0.1.0.tar.gz

Download URL machineplay-0.1.0.tar.gz
Size 52.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4d7637b44c79dd9164936cbe9943ab691d21536ff7005004f0b41c52d9228949
BLAKE2b-256 checksum
How to use checksums
3291a29bcc3e4658bd3351410a4042e543b7df0a5865b0efde3d97d59abea5eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / machineplay-0.1.0-py3-none-any.whl

Download URL machineplay-0.1.0-py3-none-any.whl
Size 39.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78c77c702312d9dd89423f0669728532734f97c289334efbd867c72c8cea725a
BLAKE2b-256 checksum
How to use checksums
92c0296e1c92f478ffc2ed99c80152d8ace5056a7bdead0fdc13908bd3bd716f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page