Skip to main content

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

Project description

warmcp (POC)

Proof-of-concept for surviving the ~60s hard MCP startup timeout Claude Desktop applies on Windows. A server launched as uvx some-pkg@latest can exceed that budget just downloading/building deps on a cold start, and the client kills it before it serves a single tool.

The intended fix is a thin proxy that:

  1. launches instantly and exposes a stub mcp_status tool,
  2. boots the real (slow) server in the background, and
  3. once ready, swaps in the real tools and emits notifications/tools/list_changed so the client re-reads tools/list.

This is all standard MCP — the server advertises tools.listChanged and sends the list-changed notification. This repo validates only that mechanism. It does not proxy anything yet.

What it does

  • Starts immediately with one tool: mcp_status (reports "loading" + seconds left).
  • After WARMCP_SWAP_DELAY seconds (default 60), removes the stub, registers tool_a + tool_b, and notifies the client.

If the client picks up tool_a/tool_b without a reconnect, the standard works and the proxy approach is viable. If not, scrap it.

How the swap is wired (FastMCP specifics)

  • FastMCP advertises tools.listChanged automatically, but add_tool / remove_tool do not emit the notification — we send it explicitly via ctx.session.send_tool_list_changed().
  • The notification needs a live session, and the swap fires outside any request. SwapTimerMiddleware.on_list_tools grabs the session on the client's first tools/list (sent right after initialize) and starts a one-shot timer.

Run the automated test

uv sync
uv run pytest -s          # spawns the server over real stdio, asserts the swap

The test sets WARMCP_SWAP_DELAY=3 so it finishes in a few seconds.

Validate manually in Claude Desktop

Add to claude_desktop_config.json (use a short delay so you don't wait a full minute):

{
  "mcpServers": {
    "warmcp-poc": {
      "command": "uvx",
      "args": ["warmcp@latest"],
      "env": { "WARMCP_SWAP_DELAY": "10" }
    }
  }
}

Or run from a local checkout instead of PyPI:

{
  "mcpServers": {
    "warmcp-poc": {
      "command": "uv",
      "args": ["run", "--directory", "C:\\path\\to\\warmcp", "warmcp"],
      "env": { "WARMCP_SWAP_DELAY": "10" }
    }
  }
}

Restart Claude Desktop. Initially only mcp_status should be listed; ~10s later the tool list should refresh to tool_a + tool_b without a reconnect. That refresh is the signal the proxy plan is sound.

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.1.0.tar.gz (85.9 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.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: warmcp-0.1.0.tar.gz
  • Upload date:
  • Size: 85.9 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.1.0.tar.gz
Algorithm Hash digest
SHA256 e51f32118a551ee68a0b39daccdbe2240bd56d59adec0b7605ce42298c2d5375
MD5 c38c510286acda44f0730ebcbc51173e
BLAKE2b-256 8e2f9b96faf0013abbb4bef6dc86a1bce228d29fe0a5fb41626f300c6825356c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: warmcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9083a7240257ea378992057c988f7fda4e0d264682636c695ffdb3d4743d4e75
MD5 897fa531c30085d6999d308a1b525d10
BLAKE2b-256 cfde9e92a1565daa5969a32207b9794bae21af835d406e95cff5c036e0678273

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