Skip to main content
Glama

Z-Code MCP

MCP (Model Context Protocol) server for orchestrating multiple Claude Code sessions with HEAD/SUB coordination pattern.

Overview

Z-Code MCP enables complex, multi-task coding projects by coordinating multiple Claude Code CLI sessions:

  • HEAD Phase: Analyzes objectives and creates execution plans

  • SUB Phase: Executes tasks in parallel with controlled concurrency

  • Aggregation Phase: Combines results and generates summaries

Related MCP server: switchboard

Installation

npx z-code-mcp

For always getting the latest version:

npx z-code-mcp@latest

Global Installation

npm install -g z-code-mcp

Claude Desktop / Claude Code Configuration

Add to your Claude configuration file:

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "z-code-mcp": {
      "command": "npx",
      "args": ["-y", "z-code-mcp@latest"]
    }
  }
}

Local Development Configuration

For testing local changes without publishing:

{
  "mcpServers": {
    "z-code-mcp-dev": {
      "command": "node",
      "args": ["C:/path/to/z-code-mcp/build/index.js"]
    }
  }
}

Environment Variables

Variable

Description

Default

Z_MCP_CLAUDE_COMMAND

Claude CLI command

claude

Z_MCP_MAX_CONCURRENT

Max concurrent processes (1-10)

3

Z_MCP_TEMP_DIR

Temp directory for outputs

System temp

Z_MCP_KEEP_TEMP

Keep temp files on error

false

Z_MCP_TEMPLATE_DIR

Custom templates directory

Built-in

Z_MCP_LOG_LEVEL

Log level (debug/info/warn/error)

info

Available Task Templates

Template

Description

code_analysis

Analyze existing code structure and patterns

code_generation

Generate new code based on specifications

test_writing

Write tests for existing code

documentation

Create documentation

security_review

Security analysis and vulnerability detection

refactoring

Code improvements and refactoring

custom

Use custom template

Usage Example

Once configured, the MCP exposes an orchestrate tool:

{
  "objective": "Implement user authentication feature",
  "workingDirectory": "/path/to/project",
  "tasks": [
    {
      "id": "analyze",
      "type": "code_analysis",
      "description": "Analyze current auth implementation"
    },
    {
      "id": "implement",
      "type": "code_generation",
      "description": "Implement JWT authentication",
      "dependencies": ["analyze"]
    },
    {
      "id": "test",
      "type": "test_writing",
      "description": "Write auth tests",
      "dependencies": ["implement"]
    }
  ],
  "coordination": {
    "strategy": "dependency-based",
    "maxConcurrent": 3
  }
}

Development

# Install dependencies
npm install

# Build
npm run build

# Watch mode
npm run dev

# Run MCP Inspector
npm run inspector

Auto-Update Behavior

  • npx caches packages: Use npx z-code-mcp@latest to force latest version

  • Local development: Use direct path reference for immediate updates after build

License

MIT

Available Tools

1 tool
orchestrateB

Orchestrate multiple Claude Code sessions with HEAD/SUB coordination. HEAD analyzes the objective, creates an execution plan, spawns SUB processes to handle individual tasks, and aggregates results.

Inputs: tasks (required), objective (required), workingDirectory (required), coordination, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of confusion between tools. The tool's purpose is clearly defined.

    Naming Consistency5/5

    Single tool named with a verb ('orchestrate'), consistent with a command-style action. No pattern inconsistency possible.

    Tool Count3/5

    A single tool for a server that coordinates multiple sessions is borderline thin. While the tool itself is non-trivial, the server would benefit from additional tools for session management, making the count slightly low for its apparent scope.

    Completeness2/5

    The tool set is severely incomplete. The server's purpose implies managing multiple Claude Code sessions, but there are no tools for creating, listing, monitoring, or terminating sessions—only a single orchestration tool that attempts to handle everything.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables Claude Code to launch and supervise multiple concurrent Claude Code sessions in tmux, sending them briefs, reading their progress, answering their prompts, and managing isolated git worktrees.
      20
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables multiple Claude Code sessions, one per repository, to coordinate through shared design decisions and task progress, inspect each other's git commits, diffs, and files, and wait for specified tasks or decisions to complete.
      30 npm
      MIT