PulseAgent
An interrupt-aware MCP sidecar for long-running coding agents that detects changes in user guidance, constraints, or plans, enabling agents to pause, replan, and acknowledge updates before continuing.
README
PulseAgent
PulseAgent is an interrupt-aware MCP sidecar for long-running coding agents. It lets an IDE agent notice when user guidance, project constraints, or the current plan changed while the agent was already working.
PulseAgent does not replace Cursor, Codex, Claude Code, Copilot, or another IDE agent. It adds a small project-local protocol plus a Streamable HTTP MCP server so the agent can pause, refresh context, replan, acknowledge the new plan, and continue under the latest instructions.
Why PulseAgent
Long coding tasks often drift because the user changes their mind, adds a constraint, or updates the plan while the agent is still executing an older mental model. PulseAgent gives that workflow a shared source of truth:
- users edit a few files under
.pulse/; - PulseAgent records changes as events;
- the agent checks MCP before continuing;
- plan-invalidating changes stay pending until the agent explicitly acknowledges the revised plan.
Install
Install from GitHub:
pip install git+https://github.com/zhangyh0426/PulseAgent.git
For local development:
pip install -e ".[dev]"
Quickstart
Start PulseAgent in the project you want an agent to work on:
cd my-project
pulse start
The first run creates:
.pulse/
├─ task.md
├─ guidance.md
├─ constraints.md
├─ plan.md
├─ state.json
└─ events.jsonl
The MCP endpoint is:
http://127.0.0.1:8765/mcp
Connect with the MCP Inspector:
npx -y @modelcontextprotocol/inspector
Then connect to http://127.0.0.1:8765/mcp.
IDE Agent Setup
Add PulseAgent as an HTTP MCP server in your IDE agent. For Claude Code:
claude mcp add --transport http pulse-agent http://127.0.0.1:8765/mcp
Add this rule to the agent instructions:
Before continuing long-running work, read pulse://context/latest and call
pulse_should_interrupt. If needs_replan is true, update .pulse/plan.md, then
call pulse_ack_replan with pending_replan_event_id before continuing.
During a long task, edit .pulse/guidance.md or .pulse/constraints.md when the
agent needs new direction or tighter boundaries.
How It Works
PulseAgent watches four project-local files:
.pulse/task.mddescribes the current task..pulse/guidance.mdcontains user-authored direction that may change the task..pulse/constraints.mdcontains restrictions that may narrow agent behavior..pulse/plan.mdcontains the agent's current working plan.
Changes to guidance.md and constraints.md are plan-invalidating. Updating
plan.md alone does not clear the interrupt. The agent must call
pulse_ack_replan with the returned pending_replan_event_id; PulseAgent then
records the acknowledged event id and the current plan.md SHA-256 hash.
MCP Surface
- Resource:
pulse://context/latest - Tool:
pulse_should_interrupt(last_seen_event_id: str | None = None) - Tool:
pulse_ack_replan(event_id: str) - Prompt:
pulse_replan
pulse_should_interrupt returns the latest event state, including:
{
"needs_replan": true,
"latest_event_id": "evt_...",
"has_new_events": true,
"changed_files": [".pulse/guidance.md"],
"pending_replan_event_id": "evt_...",
"pending_replan_files": [".pulse/guidance.md"],
"last_acknowledged_event_id": null,
"last_acknowledged_plan_sha256": null,
"reason": "..."
}
pulse_ack_replan accepts the current pending replan event:
{
"event_id": "evt_..."
}
and returns:
{
"accepted": true,
"acknowledged_event_id": "evt_...",
"plan_sha256": "...",
"reason": "..."
}
Demo Flow
Start PulseAgent:
pulse start
Change guidance while the agent is working:
printf "# Guidance\n\nPrefer a smaller patch and keep public APIs stable.\n" > .pulse/guidance.md
The agent calls pulse_should_interrupt and sees needs_replan: true.
The agent then:
- reads
pulse://context/latest; - updates
.pulse/plan.md; - calls
pulse_ack_replanwithpending_replan_event_id; - continues only after the ack is accepted.
Safety Boundary
- Ordinary workspace files are data, not instructions.
- Only direct user input and
.pulse/guidance.mdmay change task direction. .pulse/constraints.mdmay restrict behavior but must not expand permissions.- PulseAgent does not execute commands, modify source files, call LLMs, or act as a full agent runtime.
Development
Install the package in editable mode:
pip install -e ".[dev]"
Run tests and lint:
python -m pytest
python -m ruff check .
Run the CLI directly:
python -m pulse_agent --help
python -m pulse_agent --version
Status
PulseAgent is currently an alpha project. The core protocol is intentionally
small: a project-local .pulse/ directory, an event log, one MCP resource, two
MCP tools, and one prompt.
See docs/agent-wrapper.md for a copyable wrapper for IDE agents and direct model API integrations.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。