Skip to content

feat(mcp): deploy polling + channel error streaming#25

Open
hellno wants to merge 5 commits intomainfrom
claude/explore-channels-jack-integration-hWBHl
Open

feat(mcp): deploy polling + channel error streaming#25
hellno wants to merge 5 commits intomainfrom
claude/explore-channels-jack-integration-hWBHl

Conversation

@hellno
Copy link
Copy Markdown
Contributor

@hellno hellno commented Mar 23, 2026

Summary

  • Deploy polling: deploy_project MCP tool now waits for final status instead of returning "building". Polls fetchProjectOverview() every 3s until "live" or "failed" (3 min timeout). Managed mode only.
  • Channel capability: MCP server declares claude/channel and streams production errors into Claude's session via log SSE subscription. Includes dedup (60s window), clean shutdown, exponential backoff reconnect.

What works

  • Deploy polling: tested E2E via raw JSON-RPC — returns deployStatus: "live" in ~10s
  • Channel capability declared correctly (verified in MCP initialize response)
  • Log filter: 18 unit tests pass (errors, exceptions, resource limits)
  • Stdout safety: passes existing mcp-stdout-safety.test.ts

What's blocked

Channel E2E is blocked by Anthropic's allowlist. During the research preview, --channels only accepts plugins from Anthropic's curated allowlist (fakechat, telegram, discord). Custom server: entries are rejected at Gate 7 with:

Channel notifications skipped: server jack is not on the approved channels allowlist

--dangerously-load-development-channels server:jack is supposed to bypass this but doesn't work reliably (#36460, #37071, 20+ open issues).

Options to unblock

  1. Wait for Anthropic to fix the bypass flag or open the allowlist
  2. Package as a plugin and submit to claude-plugins-official for allowlist approval
  3. Fork fakechat to proxy our jack log events (hacky but testable)

Files changed

File Change
apps/cli/src/mcp/tools/index.ts pollDeploymentStatus() + call after managed deploy
apps/cli/src/mcp/server.ts Channel capability, instructions, log subscriber startup
apps/cli/src/mcp/channel/log-subscriber.ts New — SSE log stream → filtered channel notifications
apps/cli/tests/channel-log-filter.test.ts New — 18 tests for filter + formatting logic
docs/plans/channels-integration.md PRD with demo script, error patterns, testing strategy

Test plan

  • bun test apps/cli/tests/channel-log-filter.test.ts — 18/18 pass
  • bun test apps/cli/tests/mcp-stdout-safety.test.ts — 4/4 pass
  • Deploy polling E2E — deployStatus: "live" returned via MCP
  • Channel E2E — blocked by Anthropic allowlist (see above)

claude and others added 5 commits March 21, 2026 12:40
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).
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.

2 participants