Expand description
The MCP servers of a host agent whose folder a container agent can write.
A host agent’s CLI starts the MCP servers of its config on this computer. Where a container agent can write the agent’s working folder or a folder beneath it, or has run in that folder, the host agent gets only the servers AgentMux writes:
- its config is kept outside the folder (
mcp_config_file::host_config_path), and the folder’s own.mcp.jsonis neither merged into it nor handed to a harness (mcp_config_file::read_for_turn); - a Claude Code turn is told to use that config alone (
agent_mcp_flag), and the config names theagentmuxcommand by its path (with_the_command_by_path); - any other harness, and any agent whose CLI is started by a terminal, session or app-server controller,
is not started there (
refusal,turn_refusal): what it reads from its folder is its own, and AgentMux has no switch for it; - the pane says which servers of the folder’s file were left out (
left_out,cli_notice).
“Can write” is asked of container_folders, as the Editor’s
language servers ask it; where that can’t be told, the rule holds. “Has run in it” is a mark kept in the
shared folder (mark), so the rule still holds when the agent is switched to the host, or another host agent
is given the folder, a folder in it or a folder that holds it. A folder no container agent has to do with
is not touched by any of this.
Constants§
- REFUSAL
- What a pane is told when
refusalstops its agent. - TURN_
REFUSAL - What a pane is told when
turn_refusalstops its agent’s turn. - WORKFLOW_
REFUSAL - What a workflow step is told when
workflow_refusalstops its agent.
Functions§
- config_
to_ import - The text of
folder’s own.mcp.jsonfor a host agent that is defined from the folder (an import), which keeps the folder’s servers as its own.Nonewhere the rule holds: the agent takes no server from the file. - folder_
of - The working folder of the host agent on a pane with
meta, expanded, when the rule holds for it. - holds_
in - Whether a host agent in
work_dirgets only the servers AgentMux writes: a container agent can write the folder or one beneath it, or has run in it, or that can’t be told. Reads the disk and the store. - is_
outside - Whether
exemay be named as a command to a host agent ofwork_dir([outside]). - left_
out - The servers of
folder’s own.mcp.jsonthat the agent’s config (ours, its text) does not have: the ones a host agent there is not given. By name, sorted, at most [MOST_NAMES]. Only reads the file. - mark
- Record that a container agent runs with
work_diras its folder. The mark stays: from now on a host agent in that folder, in one beneath it or in one that holds it gets only the servers AgentMux writes. Best-effort; a failure is logged. - mark_
when_ moved_ to_ the_ host markthe folder of an agent whose definition just changed fromoldtonew, when that moved it from a container to the host: the folder was the container’s until now. An agent with no folder of its own named is marked by its turns in the container.- names_
every_ command_ outside names_the_command_by_path, and every command is a path outsidework_dirthat no container agent can write ([outside]): what a host turn in a folder the rule holds for is given.- names_
the_ command_ by_ path - Whether
config(the text of an MCP config) names every command it has by an absolute path (a server reached over the network has none): what a host turn in a folder the rule holds for is given, and nothing else. - not_
refused Errwithrefusal’s reason when the agent on a pane withmetais not started on this computer: the first line of a controller’s start whose CLI starts with it.- refusal
- Why the agent on a pane with
metais not started on this computer by a controller that starts its CLI itself (a terminal agent, a session agent, an app-server agent): the rule holds for its folder, and nothing on that path keeps a CLI to AgentMux’s config, whatever the harness.Nonefor a container agent, for a pane that is no agent’s, and for every other folder. - turn_
refusal - Why a turn of the agent on a pane with
metais not started on this computer: asrefusal, except for Claude Code, whose turn goes on because the flags it is started with keep it to AgentMux’s config (agent_mcp_flag). Asked only where those flags are added (agent_runtime::with_runtime_flags): the turn of a turn-based agent, and the start of its process ahead of a turn. - with_
commands_ by_ path with_the_command_by_path, and the same for every other server of the config: a server the person set with a bare command (npx,uvx) is named by the path that name has on this computer’sPATH, outside the folder. A server whose command has no such path is taken out, and the names of those are returned (theagentmuxentry is not among them: it is AgentMux’s own).- with_
the_ command_ by_ path config(the text of a host agent’s MCP config) as it is written forwork_dir, a folder the rule holds for: theagentmuxentry’s command is the absolute path of theagentmux-mcpthat ships with this install, never a name. Where no such file ships outside the folder, the entry is taken out: no server rather than one found by name.- workflow_
refusal - Why a step of a workflow that runs an agent in
work_diris not started on this computer: the rule holds for the folder, and the step’s Claude Code is started with no flags of AgentMux’s, so nothing keeps it to AgentMux’s settings, servers and instructions.work_diris the folder the step starts in, as it is: the caller gives the working folder of the process when the step names none.Nonefor every other folder.