feat(mcp): phux_kill + phux_watch tools for CLI parity (phux-yhyi)#77
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).
KILL_TERMINALS(same op asphux kill). Clean server self-exit after the kill is success.collect_events(new inphux-client::watch) wraps streamingwatch_eventswith amax_events/timeout_secsbound, sincetools/callis request/response. Returns the same per-event JSON asphux 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