Skip to main content

Warm-start MCP launcher that hot-swaps its tool list to survive Windows cold-start timeouts

Project description

warmcp

A transparent warm-start gateway for slow-to-boot MCP servers.

On Windows, Claude Desktop hard-kills an MCP server that doesn't come up within ~60 s. A server launched as uvx some-pkg@latest routinely blows that budget on a cold start (downloading/building dependencies) and is killed before it serves a single tool.

warmcp wraps such a server:

  1. It starts instantly and exposes a warmcp_status tool.
  2. It boots the real child (uvx <your args>) in the background.
  3. The moment the child is ready, it mirrors the child's entire surface (tools + resources + prompts) verbatim and notifies the client via notifications/*_list_changed — so the client picks them up with no reconnect.
  4. If the child fails to start, hangs, or crashes, the gateway degrades to a warmcp_crash_report tool instead of vanishing.

The tool list refresh is standard MCP (tools.listChanged) and is validated against real clients (Claude Code / Claude Desktop).

Usage

Wrap any uvx-launched server by inserting warmcp@latest before it. The rest of the arg line becomes the child command under uvx:

{
  "mcpServers": {
    "just-prs": {
      "command": "uvx",
      "args": ["warmcp@latest", "just-prs-mcp@latest", "stdio"],
      "env": { "PRS_MCP_MODE": "essentials", "MCP_TIMEOUT": "300000", "PYTHONUNBUFFERED": "1" }
    }
  }
}

warmcp inherits and passes the full environment through to the child, so the child's own vars (PRS_MCP_MODE, …) work unchanged.

Local (pre-publish) form, running from a checkout:

{
  "mcpServers": {
    "just-prs": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/warmcp", "warmcp", "just-prs-mcp@latest", "stdio"]
    }
  }
}

States

State Surface (prod) + with WARMCP_DEBUG
starting warmcp_status warmcp_stdout, warmcp_stderr
ready the child's tools/resources/prompts + warmcp_stdout, warmcp_stderr, warmcp_metrics
restarting warmcp_status + warmcp_stdout, warmcp_stderr, postmortem warmcp_crash_report
dead warmcp_crash_report + warmcp_stdout, warmcp_stderr

"Ready" means the child initialized and its tools/resources/prompts could be listed — not merely that it answered the MCP handshake.

Environment

Var Default Meaning
WARMCP_TIMEOUT 600000 ms; max time for one start attempt to become ready. Halting-problem guard, not a fixed timer.
WARMCP_DEBUG off Expose warmcp_stdout/warmcp_stderr (and warmcp_metrics once ready) alongside the child; surface crash diagnostics even when a restart recovers.
WARMCP_RESTART_ON_FAILURE 0 Applies to post-ready crashes only. 0 = unlimited restart, N>0 = up to N attempts then crash_report, <0 = report-only. A failed start is always terminal regardless.
WARMCP_CHILD_COMMAND uvx Command used to spawn the child (override for local testing).

Develop / test

uv sync
uv run pytest -s        # end-to-end tests over real stdio with a dummy child
uv run ruff check .

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

warmcp-0.2.0.tar.gz (96.6 kB view details)

Uploaded Source

Built Distribution

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

warmcp-0.2.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file warmcp-0.2.0.tar.gz.

File metadata

  • Download URL: warmcp-0.2.0.tar.gz
  • Upload date:
  • Size: 96.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for warmcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e20d139c2ebd2c92952d168f1aa35de48ab9bf0c9e4b7cb345c984e3f23e2d48
MD5 d6fdb05efbaa5812f74b38ec4a1d0369
BLAKE2b-256 768e651b7888c57fdf9280d68c343f0a39c8bcfb0093d63df1cb9c3c91a9e915

See more details on using hashes here.

File details

Details for the file warmcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: warmcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for warmcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48283be19b2400949dcda991d3a7d95b1fd8bdbd783ee82f3bbe184aff06e8ac
MD5 b796532ddfad1d3fdd5d661c8a1ce980
BLAKE2b-256 9d209edfb010cd42ff151ea1ca331ef12e5e009867c8e8c001676398663ce84b

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