Skip to main content

Docker builds via Windows Task Scheduler — MCP server for Cline

Project description

docker-wts-build

Docker builds via Windows Task Scheduler — an MCP server for Cline.

Problem

VS Code terminal has a ~10 minute timeout. Docker builds (especially with torch, cudnn, etc.) can take 30+ minutes. If Cline interrupts the task, the build is lost.

Solution

This MCP server schedules Docker builds as Windows Task Scheduler tasks. The build runs outside VS Code, survives interruptions, and logs progress to files for later inspection.

Installation

pip install docker-wts-build

Configuration

Set these environment variables (in cline_mcp_settings.json):

Variable Required Default Description
DWTB_PROJECT_DIR Yes Path to project with docker-compose.yml
DWTB_COMPOSE_FILE No docker-compose.yml Compose file name
DWTB_CUSTOM_SERVICES No Semicolon-separated service list
DWTB_LOGS_DIR No {project_dir}/builds/logs Logs directory
DWTB_TASK_PREFIX No DockerBuild Task name prefix
DWTB_TASK_TIMEOUT_MS No 28800000 (8h) Task timeout
DWTB_MAX_TASK_AGE_DAYS No 30 Default cleanup age

Usage

As MCP server (for Cline)

Add to cline_mcp_settings.json:

{
  "mcpServers": {
    "docker-wts-build": {
      "autoApprove": ["schedule_build", "check_build", "cleanup_builds"],
      "disabled": false,
      "timeout": 120,
      "command": "python",
      "args": ["-m", "docker_wts_build"],
      "env": {
        "DWTB_PROJECT_DIR": "C:\\path\\to\\my-project",
        "DWTB_CUSTOM_SERVICES": "service-1;service-2;service-3"
      },
      "type": "stdio"
    }
  }
}

CLI mode (for testing)

# Schedule a build of all services
python -m docker_wts_build --schedule build_all

# Schedule a single service build
python -m docker_wts_build --schedule build --service my-service

# Rebuild a single service (rm + build + up)
python -m docker_wts_build --schedule rebuild --service my-service

# Check all builds
python -m docker_wts_build --check

# Check a specific build
python -m docker_wts_build --check DockerBuild_20260427_195000

# Clean up old builds (default: 30 days)
python -m docker_wts_build --cleanup

# Clean up builds older than 14 days
python -m docker_wts_build --cleanup 14

# Show version
python -m docker_wts_build --version

How it works

  1. schedule_build creates a .cmd wrapper file with environment variables, registers it as a Windows Task Scheduler task, and runs it immediately.
  2. The task runs builder.py outside VS Code, executing docker compose commands and logging output to files.
  3. check_build queries Task Scheduler status and reads log files.
  4. cleanup_builds removes old tasks and log files.

Requirements

  • Windows (uses schtasks.exe)
  • Docker Desktop
  • Python 3.10+
  • mcp package (installed automatically)

License

MIT

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

docker_wts_build-0.1.1.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

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

docker_wts_build-0.1.1-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file docker_wts_build-0.1.1.tar.gz.

File metadata

  • Download URL: docker_wts_build-0.1.1.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for docker_wts_build-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0314da295d4b77c3e707520941b61e71f907d37c3bfe6f65ee0426693494fae3
MD5 17f8a50c6c0045d0638aa2d7e9328ffd
BLAKE2b-256 ef656c960cb2faf39cb44eb661c6afba73bcc4a1b6fdcf1548be8505d2ced415

See more details on using hashes here.

File details

Details for the file docker_wts_build-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for docker_wts_build-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 25862d53c19b568c24edbe7799f89f61f975600916fc1a2bae8486eef197cceb
MD5 5ba344a94919566988f2458a7c022ee8
BLAKE2b-256 a3ee50cd17231a5ae1e4b2682ce02c36f48bae65a7951b3a1bb21030246f4d24

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