Skip to main content

Module operator

Module operator 

Source
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 McpServerConfig for 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 whatever Config is being assembled.

§Multi-Provider Support

The operator prompt is split into two layers:

  1. Core layer (core::OPERATOR_CORE_PROMPT) — universal orchestration philosophy that works with any LLM (planning, governance, rules).
  2. 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_prompt instead.
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 McpServerConfig for the Operator stdio server.
resolve_operator_mcp_path
Resolve the absolute path to run_operator_mcp.py.