Skip to content
This repository was archived by the owner on Mar 1, 2026. It is now read-only.
This repository was archived by the owner on Mar 1, 2026. It is now read-only.

Add MCP Stream Listeners #5

@avrabe

Description

@avrabe

Epic: MCP Integration

Priority: Critical
Story Points: 3
Phase: 1

Problem

The MCP streaming system is ready but needs specific stream listeners connected to diagram components for real-time updates.

Solution

Add stream listeners to components that need real-time synchronization with the server.

Implementation Details

Ready-to-use code in src/mcp/client.ts:

  • addStreamListener(streamType, listener) - Register stream handlers (lines 505-516)
  • removeStreamListener(streamType, listener) - Cleanup listeners (lines 518-535)
  • handleStreamEvent(eventType, data) - Process stream events (lines 639-657)

Tasks

  • Add 'diagram-update' stream listener for live diagram changes
  • Add 'component-status' stream listener for WASM component state
  • Add 'validation-result' stream listener for real-time validation
  • Add 'tool-result' stream listener for MCP tool execution updates

Stream Types to Implement

mcpClient.addStreamListener('diagram-update', (data) => {
    // Update diagram model in real-time
});

mcpClient.addStreamListener('component-status', (data) => {
    // Update WASM component status indicators
});

mcpClient.addStreamListener('validation-result', (data) => {
    // Show validation results as they complete
});

mcpClient.addStreamListener('tool-result', (data) => {
    // Update UI with MCP tool execution results
});

Acceptance Criteria

  • Diagram updates stream to UI in real-time
  • Component status changes are reflected immediately
  • Validation results appear without polling
  • Tool execution results update progressively
  • Stream listeners are properly cleaned up on component unmount

Technical Notes

  • Stream listeners automatically trigger startStreaming() when first added
  • Uses Server-Sent Events format with event types
  • JSON data parsing with error handling
  • Automatic cleanup prevents memory leaks

File: src/mcp/client.ts:505-657

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions