Skip to content

feat(mcp): phux_kill + phux_watch tools for CLI parity (phux-yhyi)#77

Merged
phall1 merged 1 commit into
mainfrom
feat/yhyi-mcp-watch-kill
Jun 7, 2026
Merged

feat(mcp): phux_kill + phux_watch tools for CLI parity (phux-yhyi)#77
phall1 merged 1 commit into
mainfrom
feat/yhyi-mcp-watch-kill

Conversation

@phall1

@phall1 phall1 commented Jun 7, 2026

Copy link
Copy Markdown
Owner

The MCP adapter had ls/snapshot/send_keys/run/wait/new but lacked the lifecycle and event halves the CLI has. Closes the parity gap (child of the phux-3cw agent epic).

  • phux_kill — resolves a selector to its id set, sends one atomic KILL_TERMINALS (same op as phux kill). Clean server self-exit after the kill is success.
  • phux_watch — the push surface as a bounded one-shot: collect_events (new in phux-client::watch) wraps streaming watch_events with a max_events/timeout_secs bound, since tools/call is request/response. Returns the same per-event JSON as phux watch --json.

ADR-0022: MCP stays a thin adapter over the same agent surface; no new wire surface. docs/consumers/mcp.md §3.7/§3.8 added (the old 'not yet an MCP tool' note is obsolete). Catalog + event-projection unit tests; mcp/client suites green (356/356), clippy clean, docs 0 violations.

Closes phux-yhyi.

🤖 Generated with Claude Code

The MCP adapter exposed ls/snapshot/send_keys/run/wait/new but lacked the
lifecycle and event halves the CLI has — agents could read and drive panes
but not tear them down or observe pushed events through MCP.

Add both:
- phux_kill: resolves a selector to its id set and sends one atomic
  KILL_TERMINALS (the same op `phux kill` uses); a clean server self-exit
  after the kill is success.
- phux_watch: the push surface as a BOUNDED one-shot — collect_events (new in
  phux-client::watch) wraps the streaming watch_events with a max_events /
  timeout bound, since tools/call is request/response, not streaming. Returns
  the same per-event JSON shape as `phux watch --json`.

ADR-0022: MCP stays a thin adapter over the same agent surface the CLI uses;
no new wire surface. docs/consumers/mcp.md §3.7/§3.8 document the tools (the
old "event stream is not yet an MCP tool" note is now obsolete). Catalog +
event-projection unit tests; full mcp/client suites green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@phall1 phall1 merged commit cb4e5a7 into main Jun 7, 2026
2 checks passed
@phall1 phall1 deleted the feat/yhyi-mcp-watch-kill branch June 7, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant