Skip to main content
Glama

autocontinue-mcp

Infinite continuation supervisor — an MCP Server that automatically resumes long generations interrupted on any AI webpage.

When you ask a webpage AI to run a long task, it often gets stuck on "Generation interrupted / Please click continue." This tool loops in the background watching the screen: takes a screenshot every few seconds → OCR recognizes the standalone "Continue" button → clicks it automatically, looping endlessly like a supervisor to keep your task going, hands-free.

Fully generic: configure the button text via environment variables to adapt to any webpage or app that pops up a "Continue / Continue generating / Resume / Continue" style button — not tied to any specific platform.


Features

  • 🔁 Infinite continuation: automatically clicks "Continue" the moment an AI webpage interrupts, looping relentlessly so long tasks never stall

  • 🌐 Fully generic: defaults to Chinese "Continue"-style buttons; change AC_KEYWORDS to adapt to English (Resume / Continue) or any text

  • 🎯 Precise recognition: only recognizes standalone short buttons, automatically filtering out false hits like "Continue reading…" in body text

  • 🖥️ Cross-platform: works on Windows / macOS / Linux (permission setup below)

  • 🛡️ Safe and controllable: only acts after you explicitly start; flick the mouse to the top-left corner of the screen for an emergency stop; never touches your files

  • ⚙️ Zero LLM dependency: pure pyautogui + OCR, no LLM / vector / cloud involved


Related MCP server: Camoufox MCP

How it works

循环(每 interval 秒):
  1. 全屏(或指定区域)截图,存系统临时目录
  2. OCR 识别屏幕文字
  3. 只认「独立的短按钮」(如「继续」「继续生成」),过滤正文里的长句(如"继续读取关键文件")
  4. 命中 → 点击按钮中心;未命中 → 静默等待下一轮
  直到你调用 stop,或把鼠标甩到屏幕左上角紧急停止

pyautogui and the OCR engine are both lazily imported, so the Server loads fine even on headless environments (e.g., a bare server) — it just can't actually click.


Installation

Requires Python 3.10+.

git clone https://github.com/<你的用户名>/autocontinue-mcp.git
cd autocontinue-mcp
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -r requirements.txt

The OCR model (~tens of MB) will be downloaded automatically on first run — keep your connection online.


Connecting to an MCP client

Add the following to your MCP config file (WorkBuddy / Claude Desktop / any client supporting stdio MCP). Be sure to replace the path in args with the absolute path on your machine:

{
  "mcpServers": {
    "autocontinue": {
      "command": "python",
      "args": ["/absolute/path/to/autocontinue-mcp/server.py"],
      "env": {
        "AC_KEYWORDS": "继续,继续生成,继续回复",
        "AC_INTERVAL": "5"
      },
      "disabled": false
    }
  }
}

See mcp-config.example.json for a more complete example.


Tool list

Tool

Purpose

autocontinue_start(interval=5.0)

Starts the infinite continuation supervisor, looping to scan and auto-click "Continue"

autocontinue_stop()

Stops the supervisor

autocontinue_status()

Shows status: whether running, scan count, last action, last detected button

autocontinue_scan_once()

Single scan and click (no loop), for manual probing


Environment variables (all optional)

Variable

Default

Description

AC_KEYWORDS

继续,继续生成,继续回复

Button text to recognize, comma-separated

AC_INTERVAL

5

Scan interval in seconds (can also be overridden by the interval argument of start)

AC_REGION

Full screen

Scan region "x,y,w,h" (relative to the top-left corner of the screen); narrowing it speeds things up

AC_MIN_LEN

2

Minimum button text length filter

AC_MAX_LEN

4

Maximum button text length filter (filters out long-sentence false hits in body text)

Example — adapting to English webpages ("Resume" / "Continue" buttons):

"env": { "AC_KEYWORDS": "Resume,Continue,继续", "AC_INTERVAL": "4" }

Safety notes

  • Real mouse and keyboard control = high privilege. This tool genuinely moves and clicks your mouse, so only use it in trusted environments, and it only acts after you explicitly start.

  • Emergency stop: flick the mouse quickly to the top-left corner of the screen to trigger pyautogui.FAILSAFE, and the supervisor halts immediately.

  • Does not read or modify your files — it only takes screenshots (stored in the system temp directory, deleted after use) and clicks.

  • It's recommended to first use autocontinue_scan_once() to manually confirm the target button is recognized correctly before starting a long-running supervisor.


Platform support

Platform

Status

Windows

✅ Recommended, most thoroughly tested

macOS

⚠️ Requires "Accessibility / Screen Recording" permissions

Linux

⚠️ Requires an X11 environment + a screenshot backend such as scrot/xwd


License

MIT

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A Python MCP server that helps AI interact with Gacha games through screenshot capture and click automation, enabling game analysis and automated actions.
    -
  • A
    license
    B
    quality
    D
    maintenance
    An MCP server for anti-detection browser automation that uses Camoufox to bypass bot detection and spoof digital fingerprints. It enables AI agents to perform human-like web interactions, including realistic cursor movements, humanized click delays, and automatic cookie popup dismissal.
    36
    34 npm
    7
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    MCP server that lets AI agents use your real browser as an API, accessing any website with your login state, no keys or scrapers needed.
    1
    MIT