Skip to content

feat(mcp): stream run events as MCP progress notifications; decide PTY stance #58

Description

@jamiesun

Context

The MCP surface (sshx mcp, since v0.7.0) is execution-equivalent to the CLI by construction: every tool call self-execs the CLI and returns its --json document verbatim. Management surfaces (host mutation, password, plugin/skill lifecycle) and trust relaxations (--accept-unknown-host, --insecure-hostkey) are deliberately excluded — documented in docs/mcp.md.

Two genuine functional gaps remain:

1. Per-target progress streaming (--jsonl equivalent)

sshx run --jsonl streams run_started / target_started / target_finished / run_finished events. Over MCP, sshx_run currently returns only the final result document, so an agent fanning out to many hosts gets no incremental feedback.

Proposal: map JSONL run events to MCP progress notifications (notifications/progress with a progressToken from the tool call), keeping the final result document unchanged. The child would run with --jsonl, the server would parse events line-by-line and forward them as progress, then synthesize/passthrough the terminal result.

2. --pty (decide: expose or document as out of scope)

--pty merges stderr into stdout and is incompatible with --json. Recommendation: document as permanently out of scope for MCP (agents should not need a PTY; that is the point of the product). If accepted, add one line to docs/mcp.md and close.

Acceptance

  • sshx_run emits MCP progress notifications for multi-target runs when the client supplies a progressToken
  • Final result document unchanged (contract stability)
  • E2E: progress notification count matches selected target count
  • PTY decision recorded in docs/mcp.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions