Skip to main content

AI Intervention Agent: MCP server enabling real-time user intervention in AI-assisted development workflows.

Project description

AI Intervention Agent

AI Intervention Agent

Real-time user intervention for MCP agents.

Tests PyPI Python Versions Open VSX Open VSX Downloads Open VSX Rating Ask DeepWiki License

English | 简体中文

When using AI CLIs/IDEs, agents can drift from your intent. This project gives you a simple way to intervene at key moments, review context in a Web UI, and send your latest instructions via interactive_feedback so the agent can continue on track.

Works with Cursor, VS Code, Claude Code, Augment, Windsurf, Trae, and more.

Quick start

  1. Install:
pip install ai-intervention-agent

# or
uv add ai-intervention-agent
  1. Configure your AI tool to launch the MCP server via uvx:
{
  "mcpServers": {
    "ai-intervention-agent": {
      "command": "uvx",
      "args": ["ai-intervention-agent"],
      "timeout": 600,
      "autoApprove": ["interactive_feedback"]
    }
  }
}

[!NOTE] > interactive_feedback is a long-running tool. Some clients have a hard request timeout, so the Web UI provides a countdown + auto re-submit option to keep sessions alive.

Prompt snippet (copy/paste)
- Only ask me through the MCP `ai-intervention-agent` tool; do not ask directly in chat or ask for end-of-task confirmation in chat.
- If a tool call fails, keep asking again through `ai-intervention-agent` instead of making assumptions, until the tool call succeeds.

ai-intervention-agent usage details:

- If requirements are unclear, use `ai-intervention-agent` to ask for clarification with predefined options.
- If there are multiple approaches, use `ai-intervention-agent` to ask instead of deciding unilaterally.
- If a plan/strategy needs to change, use `ai-intervention-agent` to ask instead of deciding unilaterally.
- Before finishing a request, always ask for feedback via `ai-intervention-agent`.
- Do not end the conversation/request unless the user explicitly allows it via `ai-intervention-agent`.

Screenshots

Desktop - feedback page Mobile - feedback page

Feedback page (auto switches between dark/light)

More screenshots (empty state + settings)

Desktop - empty state Mobile - empty state

Empty state (auto switches between dark/light)

Desktop - settings Mobile - settings

Settings (dark)

Key features

  • Real-time intervention: the agent pauses and waits for your input via interactive_feedback
  • Web UI: Markdown, code highlighting, and math rendering
  • Multi-task: tab switching with independent countdown timers
  • Auto re-submit: keep sessions alive by auto-submitting at timeout
  • Notifications: web / sound / system / Bark
  • SSH-friendly: great with port forwarding

VS Code extension (optional)

Item Value
Purpose Embed the interaction panel into VS Code’s sidebar to avoid switching to a browser.
Install (Open VSX) Open VSX
Download VSIX (GitHub Release) GitHub Releases
Setting ai-intervention-agent.serverUrl (should match your Web UI URL, e.g. http://localhost:8080; you can change web_ui.port in config.jsonc.default)

Configuration

Item Value
Docs (English) docs/configuration.md
Docs (简体中文) docs/configuration.zh-CN.md
Default template config.jsonc.default (on first run it will be copied to config.jsonc)
OS User config directory
Linux ~/.config/ai-intervention-agent/
macOS ~/Library/Application Support/ai-intervention-agent/
Windows %APPDATA%/ai-intervention-agent/

Architecture

flowchart TD
  subgraph CLIENTS["AI clients"]
    AI_CLIENT["AI CLI / IDE<br/>(Cursor, VS Code, Claude Code, ...)"]
  end

  subgraph MCP_PROC["MCP server process"]
    MCP_SRV["ai-intervention-agent<br/>(server.py)"]
    MCP_TOOL["MCP tool<br/>interactive_feedback"]
    CFG_MGR["Config manager<br/>(config_manager.py)"]
    NOTIF_MGR["Notification manager<br/>(notification_manager.py)"]
  end

  subgraph WEB_PROC["Web UI process"]
    WEB_SRV["Web UI service<br/>(web_ui.py / Flask)"]
    HTTP_API["HTTP API<br/>(/api/*)"]
    TASK_Q["Task queue<br/>(task_queue.py)"]
    WEB_SRV --> HTTP_API
    WEB_SRV --> TASK_Q
  end

  subgraph USER_UI["User interfaces"]
    BROWSER["Browser"]
    VSCODE["VS Code extension<br/>(Webview)"]
  end

  CFG_FILE["config.jsonc<br/>(user config directory)"]

  AI_CLIENT -->|MCP call| MCP_TOOL
  MCP_SRV -->|exposes| MCP_TOOL

  MCP_TOOL -->|ensure Web UI running| WEB_SRV
  MCP_TOOL <-->|create task / poll result| HTTP_API

  BROWSER <-->|HTTP| HTTP_API
  VSCODE <-->|HTTP| HTTP_API

  CFG_MGR <-->|read/write| CFG_FILE
  WEB_SRV <-->|read| CFG_FILE

  MCP_SRV --> NOTIF_MGR
  NOTIF_MGR -->|web / sound / system / Bark| USER["User"]

Documentation

Related projects

License

MIT License

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

ai_intervention_agent-1.4.14.tar.gz (894.2 kB view details)

Uploaded Source

Built Distribution

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

ai_intervention_agent-1.4.14-py3-none-any.whl (3.0 MB view details)

Uploaded Python 3

File details

Details for the file ai_intervention_agent-1.4.14.tar.gz.

File metadata

  • Download URL: ai_intervention_agent-1.4.14.tar.gz
  • Upload date:
  • Size: 894.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ai_intervention_agent-1.4.14.tar.gz
Algorithm Hash digest
SHA256 66979dfd8165ffd193cbdb7f8d52037afba2e89f96ba132472c47652e3f0358c
MD5 b7770d2e49dc04e9b7ee7460a87de949
BLAKE2b-256 59f26a974c129e6dffcc80eca6fbeeffa9c936d3eea0fbf5cc612c7d33f6a02c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_intervention_agent-1.4.14.tar.gz:

Publisher: release.yml on XIADENGMA/ai-intervention-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_intervention_agent-1.4.14-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_intervention_agent-1.4.14-py3-none-any.whl
Algorithm Hash digest
SHA256 34fbcc9bc8b34d941cc8cb2125be4d90859530659f5213f94b8ce146ae15d8c2
MD5 52bc8072c2f3ae7e2f3e31f0bf6ae30b
BLAKE2b-256 fab657bff0e967b4ee1b64ad31d58a79eccb94b9f170158448d6cebea0d35482

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_intervention_agent-1.4.14-py3-none-any.whl:

Publisher: release.yml on XIADENGMA/ai-intervention-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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