Command Center - Complete MCP Workflow Visualization
Proposal to transform the Command Center from decision-only display to complete MCP lifecycle visualization
π― Command Center - Complete MCP Workflow Visualization
π Problem Statement
Current State: The Command Center primarily displays logged decisions but doesn't visualize the complete MCP workflow lifecycle.
User Feedback:
"I don't think it should only be showing the logged decisions, but the complete MCP process. Whatever the process is."
Gap: The Command Center is missing visualization for:
- MCP Init Dashboard stage
- Preflight context gathering
- Tool execution stages
- Agent orchestration (multi-agent mode)
- Outcome reporting
- Pattern mining
- Golden decision promotion
- Embedding generation
- Session lifecycle
π Complete MCP Workflow Analysis
Based on MCP documentation (docs/english/AI/MCP), here's the complete MCP process:
1. MCP Init Dashboard (mcp_init)
βββββββββββββββββββββββββββββββββββββββββββββββ
β π§ MCP INIT DASHBOARD β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β β
System Health Check β
β π Quick Stats β
β π― Mode Selection: β
β 1. Quick Task β
β 2. Multi-Agent Orchestration β
β 3. Search Mode β
β 4. Stats View β
βββββββββββββββββββββββββββββββββββββββββββββββ
2. Preflight Context (preflight)
βββββββββββββββββββββββββββββββββββββββββββββββ
β π§ PREFLIGHT CONTEXT GATHERING β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ Loading HOT memory (current session) β
β β’ Loading WARM memory (last 7 days) β
β β’ Searching COLD memory (historical) β
β β’ Fetching conventions β
β β’ Retrieving recent decisions (~3) β
β β’ Checking pending outcomes β
βββββββββββββββββββββββββββββββββββββββββββββββ
3. Task Execution (Mode-Dependent)
A. Quick Mode (Single Agent)
βββββββββββββββββββββββββββββββββββββββββββββββ
β π QUICK MODE EXECUTION β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Task: "Implement authentication" β
β Agent: cursor-storage-agent β
β Status: IN_PROGRESS β
β Progress: [ββββββββββββ] 45% β
βββββββββββββββββββββββββββββββββββββββββββββββ
B. Orchestrated Mode (Multi-Agent)
βββββββββββββββββββββββββββββββββββββββββββββββ
β π ORCHESTRATED MODE β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Stage 1: Planning (Complete) β
β β
Architect: Designed API structure β
β β
β Stage 2: Execution (In Progress) β
β π Implementor: Writing auth service... β
β βΈοΈ Security: Waiting for service... β
β β
β Stage 3: Review (Pending) β
β β³ Reviewer: Not started β
βββββββββββββββββββββββββββββββββββββββββββββββ
4. Decision Logging (log_decision)
βββββββββββββββββββββββββββββββββββββββββββββββ
β π‘ DECISION LOGGED β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Question: "Use signals vs RxJS?" β
β Chosen: "Use signals" β
β Confidence: 94% β
β Type: implementation β
β Status: π’ Auto-approved (>95%) β
βββββββββββββββββββββββββββββββββββββββββββββββ
5. 3-Tier Decision Pipeline
βββββββββββββββββββββββββββββββββββββββββββββββ
β π DECISION PIPELINE β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Raw Decision β Embedded β Golden β
β β
β 1. RAW: Stored in MongoDB β
β Status: β
Saved β
β β
β 2. EMBEDDING: Vector generation β
β Status: π Processing... β
β ETA: 2s β
β β
β 3. GOLDEN: Promotion evaluation β
β Status: β³ Pending (needs outcome) β
β Criteria: confidence β₯85%, outcome=true β
βββββββββββββββββββββββββββββββββββββββββββββββ
6. Outcome Reporting (report_outcome)
βββββββββββββββββββββββββββββββββββββββββββββββ
β π OUTCOME REPORTED β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Decision: dec_123 β
β Outcome: β
Success β
β Rating: βββββ 5/5 β
β Feedback: "Signals worked great!" β
β β
β π― Promoted to GOLDEN β
β π§ Agent learning updated β
βββββββββββββββββββββββββββββββββββββββββββββββ
7. Pattern Mining (mine_patterns)
βββββββββββββββββββββββββββββββββββββββββββββββ
β βοΈ PATTERN MINING TRIGGERED β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Trigger: 10 new decisions β
β Patterns found: 3 β
β β
β 1. Sequential: "Use signals β OnPush" β
β Support: 8/10, Success: 100% β
β β
β 2. Contextual: "Auth β standalone comps" β
β Support: 7/10, Success: 95% β
βββββββββββββββββββββββββββββββββββββββββββββββ
8. Session Lifecycle
βββββββββββββββββββββββββββββββββββββββββββββββ
β π SESSION TRACKING β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Session: editor2-31.13 β
β Started: 2026-01-08 10:30:00 β
β Duration: 2h 15m β
β β
β Stats: β
β β’ Decisions logged: 12 β
β β’ Outcomes reported: 8 (67%) β
β β’ Golden promotions: 5 β
β β’ Embeddings generated: 12 β
β β’ Patterns mined: 3 β
βββββββββββββββββββββββββββββββββββββββββββββββ
π¨ Proposed UI Enhancement
New Workflow Visualization Panel
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π― AI COMMAND CENTER - MCP WORKFLOW β LIVE 15 Events β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββ MCP WORKFLOW PIPELINE βββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β β
β β 1. MCP INIT β
Complete (2s ago) β β
β β Mode: Quick Task Health: All systems OK β β
β β β β
β β 2. PREFLIGHT β
Complete (1s ago) β β
β β Context: ~98 tokens β β
β β Sources: 3 recent decisions, 5 conventions β β
β β β β
β β 3. TASK EXECUTION π In Progress β β
β β Task: "Implement user auth" β β
β β Agent: cursor-storage-agent β β
β β Progress: [ββββββββββββ] 45% (Working on token validation...) β β
β β β β
β β 4. DECISIONS π 2 logged (awaiting outcomes) β β
β β β’ dec_123: "Use JWT tokens" β
Auto-approved (96%) β β
β β β’ dec_124: "Use signals for state" β³ Processing embedding... β β
β β β β
β β 5. PIPELINE π Processing β β
β β RAW [12] β EMBEDDED [10] β GOLDEN [5] β β
β β Pending: 2 embeddings, 5 awaiting outcomes β β
β β β β
β β 6. LEARNING βΈοΈ Idle (triggers at 10 decisions) β β
β β Next pattern mining: 8 more decisions needed β β
β β β β
β β 7. SESSION β
Active (2h 15m) β β
β β Session: editor2-31.13 β β
β β Stats: 12 decisions, 8 outcomes (67% reported) β β
β β β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββ MULTI-AGENT ORCHESTRATION (When Active) βββββββββββββββββββββββββββββ β
β β β β
β β Stage 1: PLANNING β
Complete (30s) β β
β β β’ cursor-architect β
API design complete β β
β β β β
β β Stage 2: EXECUTION π In Progress (1m 45s) β β
β β β’ cursor-implementor π Writing AuthService... (70%) β β
β β β’ cursor-security βΈοΈ Waiting for service completion... β β
β β β β
β β Stage 3: REVIEW β³ Pending β β
β β β’ cursor-reviewer β³ Not started β β
β β β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββ LIVE TIMELINE (Last 10 Events) βββββββββββββββββββββββββββββββββββββββ β
β β 10:45:23 π§ Preflight completed (~98 tokens) β β
β β 10:45:25 π Task started: "Implement user auth" β β
β β 10:45:30 π‘ Decision: "Use JWT tokens" (96% confidence) β β
β β 10:45:31 β
Decision auto-approved (>95%) β β
β β 10:45:31 πΎ Decision saved to MongoDB (RAW) β β
β β 10:45:33 π’ Embedding generated (512 dimensions) β β
β β 10:45:33 π¦ Decision moved to EMBEDDED tier β β
β β 10:45:45 π‘ Decision: "Use signals for state" (91%) β β
β β 10:45:46 π Processing embedding... β β
β β 10:45:50 π Agent writing code: auth.service.ts β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββ 3-TIER MEMORY STATUS βββββββββββββββββββββββββββββββββββββββββββββββββ β
β β π₯ HOT (Current Session): 12 decisions β β
β β π‘οΈ WARM (Last 7 days): 145 decisions (cached) β β
β β βοΈ COLD (Historical): 8,234 decisions (vector search) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Required Backend Events
New WebSocket Events to Implement
| Event | When Emitted | Payload |
|---|---|---|
mcp.init.started |
MCP init begins | { mode, healthCheck } |
mcp.init.completed |
MCP init finishes | { mode, duration, stats } |
preflight.started |
Preflight begins | { task } |
preflight.completed |
Preflight finishes | { tokens, sources, duration } |
decision.embedded |
Embedding generated | { decisionId, dimensions, duration } |
decision.promoted-to-golden |
Golden promotion | { decisionId, reason, criteria } |
pattern.mined |
Pattern discovered | { pattern, support, successRate } |
learning.triggered |
Learning cycle starts | { trigger, decisionsCount } |
session.stats-updated |
Session stats change | { stats } |
pipeline.status |
Pipeline state change | { raw, embedded, golden, pending } |
orchestration.stage-change |
Multi-agent stage shift | { stage, agents, progress } |
memory.tier-accessed |
Memory tier accessed | { tier, query, results } |
ποΈ Implementation Plan
Phase 1: Backend Event Broadcasting (Priority: High)
Goal: Emit all MCP lifecycle events via WebSocket
Tasks:
MCP Init Events (
MCP/mcp-development-ai/src/tools/mcp-init.ts)await commandCenter.mcpInitStarted({ mode, healthCheck }); // ... health checks ... await commandCenter.mcpInitCompleted({ mode, duration, stats });Preflight Events (
MCP/mcp-development-ai/src/tools/preflight.ts)await commandCenter.preflightStarted({ task }); // ... context gathering ... await commandCenter.preflightCompleted({ tokens, sources, duration });Pipeline Events (Backend AI API)
- Hook into embedding generation
- Hook into golden promotion logic
- Emit
decision.embeddedanddecision.promoted-to-golden
Pattern Mining Events (
MCP/mcp-development-ai/src/tools/mine-patterns.ts)patterns.forEach(pattern => { await commandCenter.patternMined(pattern); });Session Stats Events (Backend AI API)
- Listen to MongoDB changes
- Emit
session.stats-updatedon decision count changes
Orchestration Events (Backend AI API)
- Hook into multi-agent orchestration
- Emit
orchestration.stage-changeon stage transitions
Phase 2: Frontend Visualization (Priority: High)
Goal: Display complete MCP workflow in Command Center UI
Tasks:
Add New State Signals (
command-center.component.ts)// MCP Workflow State readonly mcpInitStatus = autoFlashState<InitStatus>(...); readonly preflightStatus = autoFlashState<PreflightStatus>(...); readonly pipelineStatus = autoFlashState<PipelineStatus>(...); readonly orchestrationState = autoFlashState<OrchestrationState>(...); readonly memoryTierStats = autoFlashState<MemoryTierStats>(...); readonly timelineEvents = autoFlashState<TimelineEvent[]>(...);Add WebSocket Listeners
this.socket.on('mcp.init.completed', (data) => { this.mcpInitStatus.set(data); this.addTimelineEvent('mcp-init', data); }); this.socket.on('preflight.completed', (data) => { this.preflightStatus.set(data); this.addTimelineEvent('preflight', data); }); // ... more listeners ...Create Workflow Pipeline Component
// New component: workflow-pipeline.component.ts @Component({ selector: 'lib-workflow-pipeline', standalone: true, template: ` <div class="workflow-pipeline"> <div class="pipeline-stage" [class.active]="stage === 'init'"> <span class="stage-icon">π§ </span> <span class="stage-name">MCP Init</span> <span class="stage-status">{{ initStatus }}</span> </div> <!-- More stages... --> </div> ` }) export class WorkflowPipelineComponent { }Create Timeline Component
// New component: event-timeline.component.ts @Component({ selector: 'lib-event-timeline', standalone: true, template: ` <div class="event-timeline"> @for (event of timelineEvents(); track event.id) { <div class="timeline-event" [class]="event.type"> <span class="timestamp">{{ event.timestamp | date:'HH:mm:ss' }}</span> <span class="icon">{{ event.icon }}</span> <span class="message">{{ event.message }}</span> </div> } </div> ` }) export class EventTimelineComponent { }Create Multi-Agent Orchestration Panel
// New component: orchestration-panel.component.ts @Component({ selector: 'lib-orchestration-panel', standalone: true, template: ` <div class="orchestration-panel" *ngIf="orchestrationState()"> @for (stage of orchestrationState().stages; track stage.id) { <div class="stage" [class.active]="stage.status === 'in-progress'"> <h4>Stage {{ stage.order }}: {{ stage.name }}</h4> @for (agent of stage.agents; track agent.id) { <div class="agent" [class]="agent.status"> <span class="agent-icon">{{ agent.icon }}</span> <span class="agent-name">{{ agent.name }}</span> <span class="agent-progress">{{ agent.progress }}%</span> </div> } </div> } </div> ` }) export class OrchestrationPanelComponent { }Update Main Command Center Template
- Add new panels for workflow pipeline
- Add timeline component
- Add orchestration panel (conditional)
Phase 3: Flash-Persistence Integration (Priority: Medium)
Goal: Persist all workflow state for instant reload
Tasks:
- Configure all new signals with
autoFlashState - Set appropriate TTLs for different data types
- Add clear functionality per panel
Phase 4: Backend API Integration (Priority: High)
Goal: Ensure backend emits all events correctly
Tasks:
Update CommandCenterGateway (
apis/backend-ai-api/src/app/command-center/command-center.gateway.ts)- Add new event handlers
- Broadcast pipeline status changes
- Broadcast learning triggers
Update CommandCenter Client (
MCP/mcp-development-ai/src/services/command-center.ts)- Add new methods:
mcpInitStarted(),preflightCompleted(), etc. - Add automatic event emission in lifecycle hooks
- Add new methods:
Hook into Embedding Service
- Emit
decision.embeddedwhen embedding completes
- Emit
Hook into Golden Promotion Logic
- Emit
decision.promoted-to-goldenon promotion
- Emit
Phase 5: Testing & Documentation (Priority: Medium)
Tasks:
- Test complete workflow visualization
- Test multi-agent orchestration display
- Test persistence across refreshes
- Document new events in MCP docs
- Update command-center documentation
π Success Metrics
| Metric | Target |
|---|---|
| Workflow Stages Visualized | 8/8 (100%) |
| Event Coverage | All 24 MCP tools emit events |
| Latency | <100ms from event to UI update |
| Persistence | All workflow state persists correctly |
| Multi-Agent Display | Real-time orchestration visualization |
| User Feedback | "I can see the complete MCP process" |
π― Benefits
- Complete Visibility: See entire MCP lifecycle, not just decisions
- Debugging: Understand where in the workflow issues occur
- Learning: Watch how MCP learns and improves
- Multi-Agent Tracking: Visualize complex orchestration
- Performance Monitoring: Identify slow stages
- Educational: Perfect for onboarding new developers
π Next Steps
- Review Proposal: Confirm scope and approach
- Backend Events: Implement event broadcasting first
- Frontend Components: Build workflow visualization UI
- Integration: Connect frontend to backend events
- Testing: Validate complete workflow display
- Documentation: Update MCP command-center docs
π Open Questions
- Should we show historical sessions in a separate tab?
- Do we want filtering by event type?
- Should we add export functionality for workflow traces?
- Do we need real-time performance metrics (events/sec)?
- Should we add notifications for critical events?
Status: π§ Awaiting approval to proceed with implementation
Estimated Time:
- Backend Events: 4-6 hours
- Frontend UI: 6-8 hours
- Integration & Testing: 2-3 hours
- Total: 12-17 hours
Priority: High (transforms Command Center into true MCP mission control)