-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
This plan outlines the implementation of MCP (Model Context Protocol) tools to enhance chat-based workflow management for an orchestrator system. The orchestrator uses JSON Schema definitions to define workflows, and since the system prompt cannot be changed, MCP tools provide the necessary context and validation capabilities.
Architecture
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Chat Client │◄──►│ Lightspeed │◄──►│ MCP Server │
│ │ │ Stack │ │ (Port 8000) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ LLaMA Stack │ │ Orchestrator │
│ (Port 8321) │ │ Backend │
└─────────────────┘ └─────────────────┘
MCP Tools Design
1. Workflow Discovery & Context Tools
orchestrator_get_jsonschema()
- Purpose: Retrieves the complete JSON Schema definition for orchestrator workflows
- Returns: Full JSON Schema with all available fields, types, and constraints
- Usage: Provides AI with complete context about workflow structure
orchestrator_get_examples(number: int = 5)
- Purpose: Fetches real-world examples of orchestrator workflows
- Parameters:
number: Number of examples to return (default: 5)
- Returns: Array of example workflows with different complexity levels
- Usage: Shows AI how to structure workflows correctly
orchestrator_creation_workflow_rules()
- Purpose: Returns best practices and rules for creating workflows
- Returns: Structured guidelines including:
- Naming conventions
- Required fields
- Validation rules
- Performance considerations
- Security constraints
2. Workflow Validation & Compilation Tools
orchestrator_json_validation(workflow_json: str)
- Purpose: Validates a JSON workflow against the schema
- Parameters:
workflow_json: Stringified JSON workflow definition
- Returns: Validation result with detailed error messages if invalid
- Usage: Real-time validation during workflow creation
orchestrator_compile(workflow_json: str)
- Purpose: Compiles the workflow and checks for logical errors
- Parameters:
workflow_json: Stringified JSON workflow definition
- Returns: Compilation result with execution plan or error details
- Usage: Ensures workflow will execute correctly
orchestrator_render(workflow_json: str, format: str = "mermaid")
- Purpose: Renders workflow as a visual graph
- Parameters:
workflow_json: Stringified JSON workflow definitionformat: Output format ("mermaid", "dot", "ascii")
- Returns: Graph representation of the workflow
- Usage: Visual validation and documentation
Implementation Strategy
Phase 1: Basic MCP Server Setup ✅
- Integrate with existing Lightspeed Stack configuration
Phase 2: Schema & Examples Integration
- Connect to actual orchestrator backend
- Implement dynamic schema retrieval
- Create example workflow database
- Add caching for performance
Phase 3: Validation & Compilation
- Implement JSON Schema validation
- Add workflow compilation engine
- Create error reporting system
- Add performance metrics
Phase 4: Visualization & Enhancement
- Implement graph rendering
- Add multiple output formats
- Create interactive workflow builder assistance
- Add workflow optimization suggestions
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels