YAML Configuration Reference#
Complete YAML configuration schema for MassGen.
Note
For a complete overview of supported models and capabilities, see Supported Models & Backends.
Tip
Validate your configs! MassGen includes a built-in validator that checks for errors before running. Use massgen --validate config.yaml to verify your configuration. See Validating Configurations for details.
Configuration Hierarchy#
MassGen configurations have a clear hierarchy of settings. Understanding this structure helps you place parameters in the correct location.
Configuration Levels:
Top Level - Global settings
agentsoragent: List of agents (or single agent)memory: Memory system configuration (conversation + persistent)orchestrator: Coordination and workspace settingsui: Display and logging settings
Agent Level - Per-agent settings (inside
agents[])id: Unique agent identifierbackend: Backend configuration objectsystem_message: Agent-specific instructions
Backend Level - Model and tool settings (inside
agent.backend)Core:
type,model,api_key,temperature,max_tokensTool Enablement:
enable_web_search,enable_code_execution,enable_code_interpreterMCP Integration:
mcp_servers,exclude_toolsBackend-Specific:
cwd,permission_mode,allowed_tools, etc.
MCP Server Level - Tool server settings (inside
backend.mcp_servers[])Connection:
name,type,command,args,url,envSecurity:
securityobject (level,allow_localhost,allow_private_ips)Tool Filtering:
allowed_tools,exclude_tools
Orchestrator Level - Multi-agent coordination (top-level
orchestrator)Workspace:
snapshot_storage,agent_temporary_workspaceProject Integration:
context_pathsCoordination:
coordination.enable_planning_mode,coordination.planning_mode_instruction,coordination.max_orchestration_restartsDebug:
debug_final_answerAdvanced:
skip_coordination_rounds,timeout
UI Level - Display settings (top-level
ui)display_type: “rich_terminal” or “simple”logging_enabled: Enable/disable logging
Backend Types Overview#
MassGen supports multiple backend types with varying capabilities:
API-Based Backends:
Backend Type |
Description & Key Features |
|---|---|
|
Anthropic’s Claude API with full tool support and MCP integration |
|
Claude Code SDK with native dev tools (Read, Write, Edit, Bash, etc.) |
|
Google’s Gemini API with planning mode and MCP support |
|
OpenAI’s GPT models with full tool and MCP support |
|
xAI’s Grok models with web search and MCP integration |
|
Azure-deployed OpenAI models (limited tool support) |
|
ZhipuAI’s GLM models with basic MCP support |
|
Generic OpenAI-compatible backend - Works with Cerebras, Together AI, Fireworks, Groq, OpenRouter, etc. Requires |
Local/Inference Backends:
Backend Type |
Description & Key Features |
|---|---|
|
Local LM Studio server for running open-weight models |
|
vLLM inference server (auto-detects port 8000) |
|
SGLang inference server (auto-detects port 30000) |
Framework Backends:
Backend Type |
Description & Key Features |
|---|---|
|
AG2 framework integration with code execution support |
Basic Structure#
# Agent definitions (required)
agents:
- id: "agent1"
backend:
# Backend configuration
system_message: "..."
# Orchestrator settings (optional)
orchestrator:
# Coordination and workspace settings
# UI settings (optional)
ui:
# Display and logging configuration
Agent Configuration#
Single Agent#
agent: # Singular for single agent
id: "my_agent"
backend:
type: "claude"
model: "claude-sonnet-4"
system_message: "You are a helpful assistant"
Multiple Agents#
agents: # Plural for multiple agents
- id: "agent1"
backend:
type: "gemini"
model: "gemini-2.5-flash"
system_message: "You are a researcher"
- id: "agent2"
backend:
type: "openai"
model: "gpt-5-nano"
system_message: "You are an analyst"
Backend Configuration#
Basic Backend#
backend:
type: "openai" # Backend type (required)
model: "gpt-5-mini" # Model name (required)
api_key: "${API_KEY}" # Optional, uses env var by default
temperature: 0.7 # Optional
max_tokens: 2000 # Optional
Claude Code Backend#
backend:
type: "claude_code"
model: "sonnet"
cwd: "workspace" # Working directory for file operations
permission_mode: "bypassPermissions" # Optional
With MCP Servers#
backend:
type: "gemini"
model: "gemini-2.5-flash"
mcp_servers:
- name: "weather"
type: "stdio"
command: "npx"
args: ["-y", "@modelcontextprotocol/server-weather"]
- name: "search"
type: "stdio"
command: "npx"
args: ["-y", "@modelcontextprotocol/server-brave-search"]
env:
BRAVE_API_KEY: "${BRAVE_API_KEY}"
Tool Filtering#
backend:
type: "openai"
model: "gpt-4o-mini"
exclude_tools: # Backend-level exclusions
- mcp__discord__send_webhook
mcp_servers:
- name: "discord"
type: "stdio"
command: "npx"
args: ["-y", "@modelcontextprotocol/server-discord"]
allowed_tools: # Server-specific whitelist
- mcp__discord__read_messages
- mcp__discord__send_message
AG2 Backend#
backend:
type: ag2
agent_config:
type: assistant # or "conversable"
name: "AG2_Coder"
system_message: "You write Python code"
llm_config:
api_type: "openai"
model: "gpt-4o"
code_execution_config:
executor:
type: "LocalCommandLineCodeExecutor"
timeout: 60
work_dir: "./workspace"
Orchestrator Configuration#
Basic Orchestrator#
orchestrator:
snapshot_storage: "snapshots"
agent_temporary_workspace: "temp_workspaces"
session_storage: "sessions" # For interactive mode
Context Paths#
orchestrator:
context_paths:
- path: "/absolute/path/to/src"
permission: "read" # Read-only access
- path: "/absolute/path/to/docs"
permission: "write" # Write access for final agent
Coordination Config#
orchestrator:
coordination:
enable_planning_mode: true
planning_mode_instruction: |
PLANNING MODE: Describe intended actions.
Do not execute during coordination phase.
Skills System Config#
Enable the skills system for domain-specific guidance and workflows:
orchestrator:
coordination:
# Enable skills system
use_skills: true
# Optional: Skills discovery directory (default: .agent/skills)
skills_directory: ".agent/skills"
# Optional: Enable specific built-in MassGen skills
massgen_skills:
- "file_search" # Always useful (ripgrep/ast-grep)
- "serena" # Symbol-level code understanding (LSP)
- "semtools" # Semantic search (embeddings)
Available Built-in Skills:
file_search: Fast text and structural code search (ripgrep/ast-grep)serena: Symbol-level code understanding using LSP (optional, requires installation)semtools: Semantic search using embeddings (optional, requires installation)
Notes:
Skills require command line execution (
enable_mcp_command_line: true)Default skills (memory, file_search) are always available when
use_skills: trueOptional skills (serena, semtools) must be explicitly listed in
massgen_skillsExternal skills from
openskillsare discovered fromskills_directory
See Skills System for complete documentation.
UI Configuration#
ui:
display_type: "rich_terminal" # or "simple"
logging_enabled: true
Complete Example#
Full multi-agent configuration demonstrating all 6 configuration levels:
# ========================================
# LEVEL 1: TOP LEVEL - Global Settings
# ========================================
# Define agents, orchestrator, and UI at the top level
# ========================================
# LEVEL 2: AGENT LEVEL - Per-Agent Settings
# ========================================
agents:
# Agent 1: Gemini with web search and tool enablement
- id: "researcher"
system_message: "You are a researcher with web search and weather tools"
# ========================================
# LEVEL 3: BACKEND LEVEL - Model & Tools
# ========================================
backend:
type: "gemini"
model: "gemini-2.5-flash"
temperature: 0.7
max_tokens: 2000
# Tool Enablement Flags (Backend Level)
enable_web_search: true # Gemini built-in web search
enable_code_execution: true # Gemini code execution
# Backend-level tool filtering
exclude_tools:
- mcp__weather__set_location # Prevent location changes
# ========================================
# LEVEL 4: MCP SERVER LEVEL - Tool Servers
# ========================================
mcp_servers:
- name: "search"
type: "stdio"
command: "npx"
args: ["-y", "@modelcontextprotocol/server-brave-search"]
env:
BRAVE_API_KEY: "${BRAVE_API_KEY}"
# MCP Server-level security configuration
security:
level: "high" # Strict security
allow_localhost: true # Allow local connections
allow_private_ips: false # Block private IPs
# MCP Server-level tool filtering
allowed_tools:
- mcp__search__web_search
- mcp__search__local_search
- name: "weather"
type: "stdio"
command: "npx"
args: ["-y", "@modelcontextprotocol/server-weather"]
security:
level: "permissive" # Relaxed for testing
# Agent 2: Claude Code with native tools
- id: "coder"
system_message: "You write and execute code with file operations"
backend:
type: "claude_code"
model: "claude-sonnet-4-20250514"
cwd: "coder_workspace" # Working directory
permission_mode: "bypassPermissions"
# Claude Code-specific parameters
max_thinking_tokens: 10000 # Extended reasoning
system_prompt: "You are an expert Python developer"
disallowed_tools: # Blacklist dangerous ops
- "Bash(rm*)"
- "Bash(sudo*)"
- "WebSearch" # Block web access
# File operations handled via cwd parameter
# Agent 3: OpenAI with code interpreter
- id: "analyst"
system_message: "You analyze data and generate reports"
backend:
type: "openai"
model: "gpt-5-nano"
# OpenAI-specific tool enablement
enable_web_search: true # OpenAI web search
enable_code_interpreter: true # Code interpreter tool
cwd: "analyst_workspace" # File operations handled via cwd
# ========================================
# LEVEL 5: ORCHESTRATOR LEVEL - Coordination
# ========================================
orchestrator:
# Workspace management
snapshot_storage: "snapshots"
agent_temporary_workspace: "temp_workspaces"
# Project integration
context_paths:
- path: "/Users/me/project/src"
permission: "read" # Read-only access
- path: "/Users/me/project/docs"
permission: "write" # Write access for winner
# Coordination settings
coordination:
enable_planning_mode: true # Enable planning mode
max_orchestration_restarts: 2 # Allow up to 2 restarts (3 total attempts)
planning_mode_instruction: |
PLANNING MODE ACTIVE: You are in coordination phase.
1. Describe your intended actions
2. Analyze other agents' proposals
3. Use only vote/new_answer tools
4. DO NOT execute MCP commands
5. Save execution for final presentation
# Voting and answer control
voting_sensitivity: "balanced" # How critical agents are when voting (lenient/balanced)
max_new_answers_per_agent: 2 # Cap new answers per agent (null=unlimited)
answer_novelty_requirement: "balanced" # How different new answers must be (lenient/balanced/strict)
# Advanced settings
skip_coordination_rounds: false # Normal coordination
timeout:
orchestrator_timeout_seconds: 1800 # 30 minute timeout
# ========================================
# LEVEL 6: UI LEVEL - Display Settings
# ========================================
ui:
display_type: "rich_terminal" # Rich terminal display
logging_enabled: true # Enable logging
Parameter Reference#
Agents#
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Unique agent identifier |
|
object |
Yes |
Backend configuration |
|
string |
No |
System prompt for the agent |
Backend#
Parameter |
Type |
Required |
Supported Backends |
Description |
|---|---|---|---|---|
|
string |
Yes |
All |
Backend type: |
|
string |
Yes |
All |
Model name (provider-specific) |
|
string |
No |
All API backends |
API key (uses env var by default) |
|
string |
Yes* |
|
API endpoint URL (required for chatcompletion) |
|
string |
No |
|
Working directory for file operations |
|
boolean |
No |
All with MCP support |
Exclude file operation MCP tools (read/write/copy/delete). Agents use command-line tools instead. Keeps command execution, media generation, and planning MCPs. (default: false) |
|
boolean |
No |
All with MCP support |
Enable image generation tools (default: false) |
|
boolean |
No |
All with MCP support |
Enable audio generation tools (default: false) |
|
boolean |
No |
All with MCP support |
Enable file generation tools (default: false) |
|
boolean |
No |
All with MCP support |
Enable video generation tools (default: false) |
|
boolean |
No |
All with MCP support |
Enable code-based tools (CodeAct paradigm). MCP tools presented as Python code in workspace (default: false) |
|
string |
No |
All with MCP support |
Path to custom tools directory to copy into workspace (for code-based tools) |
|
boolean |
No |
All with MCP support |
Auto-discover custom tools from massgen/tool/ directory (default: false) |
|
list |
No |
All with MCP support |
List of custom tool directories to exclude (e.g., [“_claude_computer_use”]) |
|
string |
No |
All with MCP support |
Shared directory for code-based tools. Tools generated once and shared across agents (default: per-agent) |
|
boolean |
No |
All with MCP support |
Enable command-line execution tool (default: false) |
|
string |
No |
All with MCP support |
Execution mode: “local” or “docker” (default: “local”) |
|
string |
No |
All with MCP support |
Docker image for command execution (default: “massgen:runtime”) |
|
string |
No |
All with MCP support |
Docker memory limit (e.g., “2g”, default: “4g”) |
|
string |
No |
All with MCP support |
Docker CPU limit (e.g., “2.0”, default: “4.0”) |
|
string |
No |
All with MCP support |
Docker network mode: “bridge”, “host”, “none” (default: “none”) |
|
boolean |
No |
All with MCP support |
Enable sudo in Docker containers (default: false) |
|
object |
No |
All with MCP support |
Docker credentials config (env_file, env_vars, env_vars_from_file, pass_all_env) |
|
object |
No |
All with MCP support |
Docker packages to install (apt, pip, npm lists) |
|
list |
No |
All with MCP support |
Whitelist of allowed command patterns |
|
list |
No |
All with MCP support |
Blacklist of blocked command patterns |
|
list |
No |
All except |
MCP server configurations |
|
list |
No |
All with tool support |
Tools to exclude from this backend |
|
float |
No |
All |
Sampling temperature (0.0-1.0) |
|
integer |
No |
All |
Maximum response tokens |
|
string |
No |
|
Permission handling: |
|
object |
Yes* |
|
AG2-specific agent configuration (required for AG2) |
|
boolean |
No |
|
Enable built-in web search capability |
|
boolean |
No |
|
Enable built-in code execution tool |
|
boolean |
No |
|
Enable OpenAI code interpreter tool |
|
list |
No |
|
Whitelist of allowed Claude Code tools (legacy - use disallowed_tools instead) |
|
list |
No |
|
Blacklist of dangerous tools to block (e.g., [“Bash(rm*)”, “Bash(sudo*)”]) |
|
integer |
No |
|
Maximum tokens for internal thinking (default: 8000) |
|
string |
No |
|
Custom system prompt for Claude Code agent |
|
string |
Yes* |
|
Azure OpenAI API version (required, default: “2024-02-15-preview”) |
MCP Server#
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Server name |
|
string |
Yes |
“stdio” or “streamable-http” |
|
string |
stdio only |
Command to launch server |
|
list |
stdio only |
Command arguments |
|
string |
http only |
Server URL |
|
object |
No |
Environment variables |
|
list |
No |
Whitelist of allowed tools |
|
list |
No |
Tools to exclude |
|
object |
No |
Security configuration for the MCP server |
MCP Server Security#
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
Security level: |
|
boolean |
No |
Allow connections to localhost (required for local MCP servers) |
|
boolean |
No |
Allow connections to private IP ranges (for testing environments) |
Orchestrator#
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
Directory for workspace snapshots |
|
string |
No |
Directory for temporary workspaces |
|
list |
No |
Shared project directories |
|
object |
No |
Coordination configuration (planning mode settings) |
|
boolean |
No |
Debug/test mode: skip voting rounds and go straight to final presentation (default: false) |
|
string |
No |
Debug mode for restart feature: override final answer on attempt 1 only to test restart flow (default: null). Example: “I only created one file.” |
|
object |
No |
Timeout configuration |
Coordination Configuration#
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
boolean |
No |
Enable planning mode during coordination (default: false). When enabled, agents plan without executing MCP tools during the coordination phase. Only the winning agent executes actions during final presentation. |
|
string |
No |
Custom instruction added to agent prompts when planning mode is enabled. Should explain to agents that they should describe intended actions without executing them. |
|
integer |
No |
Maximum number of orchestration restarts allowed (default: 0). When set > 0, enables post-evaluation where the winning agent reviews the final answer and can request a restart with specific improvement instructions. Recommended values: 1-2. |
Note
New in v0.1.3: Orchestration restart enables automatic quality checks after coordination. The winning agent evaluates its own answer and can trigger a restart if the answer is incomplete or incorrect, with specific instructions for improvement.
Note
Planning Mode Support: Planning mode works with all backends that support MCP integration (claude, claude_code, gemini, openai, grok, chatcompletion, lmstudio, vllm, sglang). It does NOT work with ag2 or azure_openai.
When to Use Planning Mode:
When using MCP tools that perform irreversible actions (file deletion, database modifications, API calls)
When coordinating multiple agents that should agree on a plan before execution
When you want a “dry run” discussion phase before actual tool execution
How It Works:
Coordination Phase (with planning mode): Agents discuss and vote on approaches WITHOUT executing MCP tools
Final Presentation Phase: The winning agent EXECUTES the planned actions
Voting and Answer Control#
These parameters control coordination behavior to balance quality and duration.
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
Controls how critical agents are when evaluating answers. Options: |
|
integer or null |
No |
Maximum number of new answers each agent can provide. Once an agent reaches this limit, they can only vote (not provide new answers). Options: |
|
string |
No |
Controls how different new answers must be from existing ones to prevent rephrasing. Options: |
Example Configurations:
Fast but thorough (recommended for balanced evaluation):
orchestrator:
voting_sensitivity: "balanced" # Critical evaluation
max_new_answers_per_agent: 2 # But cap at 2 tries
answer_novelty_requirement: "balanced" # Must actually improve
Maximum quality with bounded time:
orchestrator:
voting_sensitivity: "strict" # Highest quality bar
max_new_answers_per_agent: 3
answer_novelty_requirement: "strict" # Only accept real improvements
Quick convergence:
orchestrator:
voting_sensitivity: "lenient"
max_new_answers_per_agent: 1
answer_novelty_requirement: "lenient"
Timeout Configuration#
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
No |
Maximum time for orchestrator coordination in seconds (default: 1800 = 30 minutes) |
Context Path#
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Absolute path to directory |
|
string |
Yes |
“read” or “write” |
UI#
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
“rich_terminal” or “simple” |
|
boolean |
No |
Enable/disable logging |
See Also#
Configuration - Configuration guide
MCP Integration - MCP configuration details
Project Integration & Context Paths - Context paths setup
CLI Reference - CLI parameters