Skip to main content

CLEO MCP Gateway Specification

Version: 1.0.0 Status: DRAFT Date: 2026-01-31

Overview

This specification defines a complete set of MCP (Model Context Protocol) gateways that expose CLEO’s capabilities through a unified interface. The gateways are designed for LLM agents to interact with CLEO without requiring direct CLI invocation.

Design Principles

  1. Domain Cohesion: Each gateway groups related operations
  2. Consistent Response Format: All gateways return structured JSON with _meta, success, data/error
  3. Protocol Enforcement: Gateways enforce RCSD-IVTR lifecycle where applicable
  4. Exit Code Mapping: CLI exit codes map to structured error responses

Architecture Alignment

MCP Gateways

    ├── cleo_tasks      ─────► Task CRUD (66 scripts)
    ├── cleo_session    ─────► Session + Focus Management
    ├── cleo_orchestrate ────► Multi-Agent Coordination
    ├── cleo_research   ─────► Research Protocol + Manifest
    ├── cleo_lifecycle  ─────► RCSD-IVTR Gate Management
    ├── cleo_validate   ─────► Protocol Validation + Compliance
    ├── cleo_release    ─────► Release Workflow
    └── cleo_system     ─────► Config, Backup, Health

Gateway 1: cleo_tasks

Purpose: Task CRUD operations and hierarchy management

Operations

OperationParametersReturnsCLI Mapping
createtitle, description?, parent?, depends?[], labels?[], priority?Task JSONcleo add
readidTask JSON with full detailscleo show
updateid, title?, description?, status?, priority?, notes?, labels?[]Updated taskcleo update
completeid, notes?Completion confirmationcleo complete
deleteid, strategy? (orphan|cascade|reparent)Deletion confirmationcleo delete
reopenidReopened taskcleo reopen
reparentid, newParentUpdated taskcleo reparent
promoteid, toType (task|epic)Promoted taskcleo promote

Gateway 2: cleo_session

Purpose: Session lifecycle and focus management

Operations

OperationParametersReturnsCLI Mapping
startscope, name?, autoFocus?, focus?Session JSONcleo session start
endnote?Session summarycleo session end
status-Current session statecleo session status
liststatus?Session listcleo session list
focus.settaskIdFocus confirmationcleo focus set
focus.show-Current focuscleo focus show
focus.clear-Clear confirmationcleo focus clear

Gateway 3: cleo_orchestrate

Purpose: Multi-agent coordination and subagent spawning

Operations

OperationParametersReturnsCLI Mapping
startepicIdSession + context statecleo orchestrator start
analyzeepicIdDependency wavescleo orchestrator analyze
readyepicId, phase?Parallel-safe taskscleo orchestrator ready
nextepicIdNext task suggestioncleo orchestrator next
spawntaskIdSpawn prompt JSONcleo orchestrator spawn
context-Context budget statuscleo orchestrator context

Gateway 4: cleo_research

Purpose: Research protocol and manifest management

Operations

OperationParametersReturnsCLI Mapping
liststatus?, limit?, filter?Manifest entriescleo research list
showidEntry detailscleo research show
pending-Followup itemscleo research pending
linktaskId, researchIdLink confirmationcleo research link

Gateway 5: cleo_lifecycle

Purpose: RCSD-IVTR gate management

Operations

OperationParametersReturnsCLI Mapping
phase.show-Current phasecleo phase show
phase.advance-Phase transitioncleo phase advance
phases.stats-Phase statisticscleo phases stats
gate.checkepicId, targetStageGate statusN/A (internal)

Gateway 6: cleo_validate

Purpose: Protocol validation and compliance

Operations

OperationParametersReturnsCLI Mapping
protocoltaskId, protocolValidation resultcleo validate protocol
complianceperiod?Compliance metricscleo compliance value
schemafileSchema validationcleo validate

Gateway 7: cleo_release

Purpose: Release workflow management

Operations

OperationParametersReturnsCLI Mapping
bumptype (patch|minor|major), dryRun?Version infodev/bump-version.sh
releasetype, push?Release resultdev/release-version.sh
changelogversion?Changelog contentscripts/generate-changelog.sh

Gateway 8: cleo_system

Purpose: Configuration, backup, and health

Operations

OperationParametersReturnsCLI Mapping
config.getkeyConfig valuecleo config get
config.setkey, valueUpdated configcleo config set
backup.createtype?Backup infocleo backup
backup.restoreidRestore confirmationcleo restore
health-System healthcleo doctor
version-Version infocleo version

Response Format

All gateways return consistent JSON structure:
{
  "_meta": {
    "gateway": "cleo_tasks",
    "operation": "create",
    "timestamp": "2026-01-31T10:30:00Z",
    "version": "0.80.0"
  },
  "success": true,
  "data": { ... },
  "error": null
}

Error Response

{
  "_meta": { ... },
  "success": false,
  "data": null,
  "error": {
    "code": "E_NOT_FOUND",
    "exitCode": 4,
    "message": "Task T9999 not found",
    "fix": "Use 'cleo find' to discover valid task IDs"
  }
}

References