Expand description
Operator MCP server injection.
Every non-internal agent in Construct gets the Operator orchestration MCP server wired in automatically. This module defines:
- The canonical
McpServerConfigfor the Operator stdio server. - The system-prompt text that teaches the lead agent how to use operator
tools (
create_agent,wait_for_agent, etc.). inject_operator()– called during agent/config construction to splice both the server config and the prompt into whateverConfigis being assembled.
§Multi-Provider Support
The operator prompt is split into two layers:
- Core layer (
core::OPERATOR_CORE_PROMPT) — universal orchestration philosophy that works with any LLM (planning, governance, rules). - Tool layer (
providers) — provider-specific tool-calling examples adapted for each LLM family (Claude MCP, OpenAI JSON, etc.).
Provider detection is automatic via providers::Provider::detect using
the model name string.
Modules§
- core
- Universal operator prompt — provider-agnostic orchestration philosophy.
- providers
- Provider detection and tool-layer dispatch.
Constants§
- DEFAULT_
OPERATOR_ MCP_ PATH_ SUFFIX - Default path to the Operator MCP runner script (relative to
$HOME). - OPERATOR_
PROMPT - Backward-compatible constant — use
build_operator_promptinstead. - OPERATOR_
SERVER_ NAME - Name used as the MCP server prefix (tools appear as
construct-operator__<tool>).
Functions§
- append_
operator_ channel_ prompt - Append the compact operator prompt for channel agents.
- append_
operator_ prompt - Append the full Operator prompt to
system_prompt. - build_
operator_ prompt - Build the complete operator prompt for a given model.
- inject_
operator - Inject the Operator MCP server into
config. - operator_
mcp_ server_ config - Build the
McpServerConfigfor the Operator stdio server. - resolve_
operator_ mcp_ path - Resolve the absolute path to
run_operator_mcp.py.