Metadata-Version: 2.4
Name: cloud-keepalive-mcp
Version: 1.0.3
Summary: Universal MCP server and CLI tool that keeps Render, Fly.io, Glitch, Koyeb, Railway, and Vercel apps awake without burning free-tier quotas.
Author-email: Anand Tripathi <anandtripathiiiofficial@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/Anandtripathiii/cloud-keepalive-mcp
Project-URL: Repository, https://github.com/Anandtripathiii/cloud-keepalive-mcp
Project-URL: Issues, https://github.com/Anandtripathiii/cloud-keepalive-mcp/issues
Keywords: mcp,model-context-protocol,render,keep-alive,cold-start,flyio,glitch,koyeb,railway
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

<p align="center">
  <img src="assets/icon.png" alt="CloudKeepAlive MCP Logo" width="96" height="96" />
</p>

<h1 align="center">CloudKeepAlive MCP</h1>

<p align="center">
  <strong>Universal Anti-Cold-Start &amp; Keep-Alive Guard</strong> for Render, Fly.io, Glitch, Koyeb, Railway &amp; Vercel.<br/>
  Built by <a href="https://github.com/Anandtripathiii"><strong>Anand Tripathi (@Anandtripathiii)</strong></a>
</p>

[![PyPI version](https://img.shields.io/pypi/v/cloud-keepalive-mcp?color=blue&cacheSeconds=300)](https://pypi.org/project/cloud-keepalive-mcp/)
[![PyPI Stats](https://img.shields.io/badge/PyPI_Downloads-pepy.tech-007ec6?logo=pypi&logoColor=white)](https://pepy.tech/project/cloud-keepalive-mcp)
[![Python](https://img.shields.io/pypi/pyversions/cloud-keepalive-mcp?cacheSeconds=300)](https://pypi.org/project/cloud-keepalive-mcp/)
[![License](https://img.shields.io/github/license/Anandtripathiii/cloud-keepalive-mcp)](LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/Anandtripathiii/cloud-keepalive-mcp?style=social)](https://github.com/Anandtripathiii/cloud-keepalive-mcp)

[![CloudKeepAlive MCP server](https://glama.ai/mcp/servers/Anandtripathiii/cloud-keepalive-mcp/badge)](https://glama.ai/mcp/servers/Anandtripathiii/cloud-keepalive-mcp)

<!-- mcp-name: io.github.Anandtripathiii/cloud-keepalive-mcp -->

[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_MCP_Server-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%7B%22name%22%3A%22cloud-keepalive%22%2C%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22cloud-keepalive-mcp%22%5D%7D)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_MCP_Server-24bfa5?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%7B%22name%22%3A%22cloud-keepalive%22%2C%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22cloud-keepalive-mcp%22%5D%7D)
[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/install-mcp?name=cloud-keepalive&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyJjbG91ZC1rZWVwYWxpdmUtbWNwIl19)

*(One-click buttons open VS Code, VS Code Insiders, or Cursor if installed on your device. See [`vscode-extension/`](vscode-extension/) for the branded VS Code extension and [`antigravity-plugin/`](antigravity-plugin/) for the Antigravity plugin.)*

---

## ⚡ One-Line Install (No Repo Clone Needed)

Prerequisite: [`uv`](https://docs.astral.sh/uv/) installed (`powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"` on Windows, or `curl -LsSf https://astral.sh/uv/install.sh | sh` on macOS/Linux).

* **Claude Code:**
  ```bash
  claude mcp add cloud-keepalive -- uvx cloud-keepalive-mcp
  ```
* **VS Code CLI:**
  ```bash
  code --add-mcp '{"name":"cloud-keepalive","command":"uvx","args":["cloud-keepalive-mcp"]}'
  ```
* **Run MCP Server directly via `uvx`:**
  ```bash
  uvx cloud-keepalive-mcp
  ```
* **Normal Python (`pip`):**
  ```bash
  pip install cloud-keepalive-mcp
  ```

---

## ✨ Features & Tools

- **`keepalive_watch`**: Keep any URL awake with automatic platform detection (10m for Render, 4m for Glitch, 8m for Fly.io), optional `duration_hours` quota protection, and automatic PC idle-sleep prevention (`prevent_pc_sleep`).
- **`keepalive_status`**: Live status, HTTP codes, latency (ms), cold-start detections, and countdown timers.
- **`keepalive_warmup`**: Immediately pre-warm one or all watched deployments before demos or testing.
- **`keepalive_unwatch`**: Stop monitoring a deployment URL.
- **`detect_platform`**: Inspect any URL to detect its hosting provider, sleep threshold, and recommended interval.
- **`keepalive_cloud_config`**: Export ready-to-paste `sites.txt`, GitHub Secrets, and Cloudflare Worker configuration for 24/7 PC-off pinging.

---

## 🔧 Configuration (Per AI Client)

### VS Code (Copilot Agent Mode)
`.vscode/mcp.json` (workspace) or Command Palette → **MCP: Add Server**:
```json
{
  "servers": {
    "cloud-keepalive": {
      "type": "stdio",
      "command": "uvx",
      "args": ["cloud-keepalive-mcp"]
    }
  }
}
```

### Cursor
`~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project):
```json
{
  "mcpServers": {
    "cloud-keepalive": {
      "command": "uvx",
      "args": ["cloud-keepalive-mcp"]
    }
  }
}
```

### Claude Desktop
`claude_desktop_config.json` (Settings → Developer → Edit Config):
```json
{
  "mcpServers": {
    "cloud-keepalive": {
      "command": "uvx",
      "args": ["cloud-keepalive-mcp"]
    }
  }
}
```

### Google Antigravity / Windsurf
`~/.gemini/config/mcp_config.json` (Antigravity) or `~/.codeium/windsurf/mcp_config.json` (Windsurf):
```json
{
  "mcpServers": {
    "cloud-keepalive": {
      "command": "uvx",
      "args": ["cloud-keepalive-mcp"]
    }
  }
}
```

### Google Antigravity Plugin (`antigravity-plugin/`)
Copy [`antigravity-plugin/`](antigravity-plugin/) into `~/.gemini/config/plugins/cloud-keepalive/` to bundle the MCP server, skill, logo, and starter prompts as a single toggleable plugin.

### VS Code Marketplace Extension (`vscode-extension/`)
Install directly from the **[Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Anandtripathiii.cloud-keepalive-mcp)** (search `CloudKeepAlive MCP` in VS Code Extensions `Ctrl+Shift+X`), or run:
```bash
code --install-extension Anandtripathiii.cloud-keepalive-mcp
```
*(Or build locally from [`vscode-extension/`](vscode-extension/) using `npx @vscode/vsce package`.)*

### Continue
`.continue/mcpServers/cloudkeepalive.yaml`:
```yaml
name: CloudKeepAlive
version: 1.0.0
schema: v1

mcpServers:
  - name: CloudKeepAlive
    command: uvx
    args:
      - cloud-keepalive-mcp
```

Then ask your AI in chat:
- *"Keep my Render backend `https://my-api.onrender.com` awake for the next 3 hours."*
- *"Pre-warm my deployment before I demo it."*
- *"Generate my 24/7 cloud config so it stays awake when my PC is off."*

---

## 💻 Standalone Mode (No AI Needed)

Don't use an AI assistant? Run CloudKeepAlive directly from your terminal or double-click `run.bat`:

```bash
pip install cloud-keepalive-mcp
cloud-keepalive https://my-backend.onrender.com --duration 4
```
*(Or clone the repo and double-click `run.bat` on Windows, or run `python server.py https://my-backend.onrender.com --duration 0.5`.)*

- **Auto PC Idle-Sleep Lock:** While running locally, CloudKeepAlive automatically prevents Windows, macOS, and Linux from entering **idle sleep** so pings never stop when you step away (your display can still dim/turn off). Pass `--allow-sleep` to disable.

---

## ☁️ 24/7 Cloud Mode (Runs Even When Your PC Is OFF)

Local stdio/CLI mode stops if your PC shuts down or closes your editor. For **24/7 PC-off pinging**:

### Option A: GitHub Actions (Included)
1. Fork this repo.
2. Add your URL(s) to [`sites.txt`](sites.txt) (or set GitHub Repo Secret `CLOUDKEEPALIVE_URLS`).
3. Enable [`.github/workflows/keep_alive.yml`](.github/workflows/keep_alive.yml) in the **Actions** tab (pings every 5 minutes).

### Option B: Cloudflare Worker (Zero Cron Jitter, Free)
1. Paste [`cloudflare-worker.js`](cloudflare-worker.js) into a free Cloudflare Worker.
2. Set `TARGET_URLS` (or `DEFAULT_URLS`) and add a Cron Trigger `*/10 * * * *`.

---

## 📊 Supported Platforms & Sleep Limits

| Platform | Idle Sleep Threshold | Cold-Start Delay | CloudKeepAlive Safe Ping |
| :--- | :--- | :--- | :--- |
| **Render** | **15 minutes** | **30s – 75s** | **Every 10 mins** |
| **Glitch** | **5 minutes** | **10s – 25s** | **Every 4 mins** |
| **Fly.io** | **10 minutes** (Auto-stop) | **5s – 15s** | **Every 8 mins** |
| **Koyeb** | **15 minutes** (Pause) | **20s – 40s** | **Every 10 mins** |
| **Vercel** | Serverless Cold-Start | **1s – 5s** | **Every 5 mins** |

---

## ⚠️ Limitations & Responsible Use

- **Local stdio / CLI mode:** Pings only run while your computer and editor/terminal are powered on (auto wake-lock prevents *idle* sleep, not manual shutdown or lid-close). Use **Cloud Mode** (GitHub Actions / Cloudflare Worker) for 24/7 uptime when your PC is off.
- **Responsible use:** Only monitor your own or authorized deployments, and respect your hosting provider's monthly free-tier compute limits (e.g., Render's 750 free hours/month) using `--duration` / `duration_hours`.

---

## 📄 License

[MIT](LICENSE)
