feat(mcp): deploy polling + channel error streaming#25
Open
Conversation
Explores two approaches for one-way Claude Code channel integration: - Option A: Extend existing `jack mcp serve` with channel capability - Option B: Standalone `jack channel serve` command with webhook support Recommends starting with Option A (extend MCP server) for zero-friction deploy notifications and log error alerts, with extraction path to B if webhook ingestion becomes needed. https://claude.ai/code/session_01ScGRSLQkBzUEUkhiPhBbnC
Decisions made: - Extend `jack mcp serve` (not standalone server) - Local Claude Code users only (channels are stdio/local-only) - Phase 1: deploy status notifications (tool-triggered polling) - Managed mode only for v1 - Session-scoped is acceptable Discarded standalone option — webhook ingestion needs tunneling, too much friction. Extraction path documented if needed later.
Key insight: channels are wrong primitive for deploy notifications. The deploy_project MCP tool should just poll until resolved (~15 LOC). Channels are right for production error streaming — async events Claude can't know about unless something pushes them in. Priority 1: Make deploy_project return final status (no channels) Priority 2: Stream production errors via channel (genuinely unique)
Concrete additions: - Live demo script: API + D1 schema drift (the #1 vibecoding error) - Real error patterns from all templates ranked by frequency - Log stream filter criteria from actual LogStreamDO format - Testing: unit (InMemoryTransport), integration (live project), E2E (demo) - Demo designed for screen recording with actual user value
Two improvements to the MCP server: 1. deploy_project now polls until deployment resolves to "live" or "failed" instead of returning "building". Polls fetchProjectOverview every 3s, 60 attempts max (3 min timeout). Managed mode only. 2. Channel capability (claude/channel) declared on MCP server. Log subscriber connects to project's SSE log stream and pushes production errors/exceptions into Claude's session as channel notifications. Includes dedup (60s window), clean shutdown via AbortController, and exponential backoff reconnect. Channel is blocked by Anthropic's allowlist during research preview — --dangerously-load-development-channels bypass is unreliable. Deploy polling tested and working (returns "live" in ~10s).
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.
Summary
deploy_projectMCP tool now waits for final status instead of returning"building". PollsfetchProjectOverview()every 3s until"live"or"failed"(3 min timeout). Managed mode only.claude/channeland streams production errors into Claude's session via log SSE subscription. Includes dedup (60s window), clean shutdown, exponential backoff reconnect.What works
deployStatus: "live"in ~10smcp-stdout-safety.test.tsWhat's blocked
Channel E2E is blocked by Anthropic's allowlist. During the research preview,
--channelsonly accepts plugins from Anthropic's curated allowlist (fakechat, telegram, discord). Customserver:entries are rejected at Gate 7 with:--dangerously-load-development-channels server:jackis supposed to bypass this but doesn't work reliably (#36460, #37071, 20+ open issues).Options to unblock
claude-plugins-officialfor allowlist approvalFiles changed
apps/cli/src/mcp/tools/index.tspollDeploymentStatus()+ call after managed deployapps/cli/src/mcp/server.tsapps/cli/src/mcp/channel/log-subscriber.tsapps/cli/tests/channel-log-filter.test.tsdocs/plans/channels-integration.mdTest plan
bun test apps/cli/tests/channel-log-filter.test.ts— 18/18 passbun test apps/cli/tests/mcp-stdout-safety.test.ts— 4/4 passdeployStatus: "live"returned via MCP