CLI Native Bridge
April 13, 2026 ยท View on GitHub
The qos-claude-code plugin (v2.1.1) connects Claude Code to Qualixar OS through two channels: MCP tools for structured LLM interaction, and native CLI commands via Bash for operations that MCP does not cover. This dual approach gives Claude Code complete access to every QOS capability.
Two Channels, One System
Channel 1: MCP Tools (Automatic)
The plugin declares an MCP server in plugin.json:
{
"mcp": {
"command": "npx",
"args": ["qualixar-os", "--mcp"]
}
}
Claude Code connects to this server on startup. The MCP server exposes domain-grouped tools (qos_task, qos_system, qos_agents, qos_context, qos_quality, qos_workspace, qos_workflow_create) plus the legacy 25 individual tools. These are called as native tool invocations during conversation.
Channel 2: CLI via Bash (Agent + Skills)
The plugin's qos-orchestrator agent has access to Bash, Read, Write, Grep, and Glob tools. It runs QOS CLI commands directly:
# The orchestrator agent runs these via Bash tool
qos run "your task prompt" -t code -m power
qos status abc-123
qos output abc-123
qos forge code
qos agents abc-123
qos cost abc-123
The plugin's skills (qos-task-orchestrator) and commands (/qos-task, /qos-workspace) also use curl against the HTTP API or direct filesystem access to ~/.qualixar-os/workspaces/.
What Uses Which Channel
| Operation | Channel | Why |
|---|---|---|
| Submit a task | MCP (qos_task action=run) | Structured input/output for LLM |
| Poll task status | MCP (qos_task action=status) | Fast, no shell overhead |
| Steer a running task | MCP (qos_task action=steer) | Not available as direct CLI command |
| Browse Forge designs | MCP (qos_agents action=forge_design) | JSON response for LLM reasoning |
| Search memory | MCP (qos_quality action=memory_search) | Structured results |
| Browse workspace files | CLI (ls ~/.qualixar-os/workspaces/<id>/) | Filesystem operation |
| Read agent logs | CLI (cat .../.qos-log/team.jsonl) | File content, not an MCP tool |
| Export an agent | CLI (qos export <id> -f soul-md) | CLI-only command |
| Initial setup | CLI (qos init) | Interactive, CLI-only |
| Health check | CLI (qos doctor) | CLI-only |
| Start server | CLI (qos serve --dashboard) | Server lifecycle, CLI-only |
| Change config | Either | CLI for persistence, MCP for runtime |
How the Plugin Commands Work
/qos-task
Submits a task via HTTP POST to the running QOS server:
curl -s -X POST http://localhost:3000/api/tasks \
-H "Content-Type: application/json" \
-d '{"prompt": "Review auth module", "mode": "power"}'
The server routes through the same orchestrator pipeline as qos run.
/qos-status
Hits the health and task list endpoints:
curl -s http://localhost:3000/api/health
curl -s http://localhost:3000/api/tasks
/qos-workspace
Directly reads the filesystem:
ls -la ~/.qualixar-os/workspaces/<taskId>/
cat ~/.qualixar-os/workspaces/<taskId>/.qos-log/team.jsonl
Also available via API:
curl -s http://localhost:3000/api/tasks/<taskId>/logs
/qos-forge
Activates the Forge design skill, which internally calls the MCP qos_agents tool with action=forge_design.
/qos-marketplace
Browses the skill store via the marketplace API or MCP tools.
Example: Combined Workflow
A typical Claude Code session might use both channels in sequence:
User: "Set up QOS and run a code review on my auth module"
Claude Code:
1. [Bash] qos doctor # CLI: check health
2. [Bash] qos serve --dashboard -p 3000 & # CLI: start server
3. [MCP] qos_task action=run # MCP: submit task
prompt="Review src/auth/ for vulnerabilities"
type="code" mode="power"
4. [MCP] qos_task action=status # MCP: poll until complete
taskId="abc-123"
5. [Bash] ls ~/.qualixar-os/workspaces/abc-123/ # CLI: browse output
6. [Read] ~/.qualixar-os/workspaces/abc-123/review.md # Read: show results
7. [MCP] qos_system action=cost_summary # MCP: check cost
taskId="abc-123"
Steps 1-2 use CLI (server lifecycle). Steps 3-4 and 7 use MCP (structured tool calls). Steps 5-6 use filesystem access (workspace browsing).
Example: Agent Export + Re-Import
User: "Export the reviewer agent as SOUL.md, then re-import it"
Claude Code:
1. [MCP] qos_agents action=list # MCP: find the agent ID
2. [Bash] qos export abc-agent -f soul-md \ # CLI: export (CLI-only)
-o ./reviewer-SOUL.md
3. [Read] ./reviewer-SOUL.md # Read: show the export
4. [Bash] qos import ./reviewer-SOUL.md # CLI: re-import
Export is CLI-only. Import works via both CLI and MCP (qos_workspace action=import_agent).
When to Prefer CLI Over MCP
- Server lifecycle --
qos serve,qos dashboard,qos mcpare inherently CLI operations. - Initial setup --
qos initis interactive and CLI-only. - Diagnostics --
qos doctorruns connectivity and config validation checks. - File export --
qos exportwrites to files, which MCP tools cannot do. - Batch scripting -- Chaining multiple
qos runcalls in a shell loop is simpler than repeated MCP calls. - Workspace browsing --
lsandcaton workspace directories is more flexible than API endpoints.
When to Prefer MCP Over CLI
- During conversation -- MCP tools return structured JSON that Claude can reason about directly.
- Task steering --
qos_taskaction=steer redirects a running task mid-execution, not available as a direct CLI command. - Token efficiency -- The UCP adapter groups 25 commands into 7 tools, keeping the tool list compact.
- Context management --
qos_contexttools (add, scan, list) are UCP-only, not exposed as top-level CLI commands. - Memory storage --
qos_qualityaction=memory_store writes to memory, while the CLIqos memorycommand only reads.
Configuration
The plugin auto-discovers the QOS server at http://localhost:3000. To change the port:
qos config server.port 3000
The MCP server is started automatically by Claude Code when the plugin is installed. No manual qos mcp invocation is needed.