Skip to content

Agents defined in ~/.claude/agents keep their MCP servers in sessions hub starts #436

Open

Description

@ooloth

Current state

In every session hub starts, the subagents that bring their own MCP server get none, so browser-automation-agent cannot open a browser, and nextjs-agent and notion-agent cannot reach their servers. The agent sees no tools and no error, so it reports that it ran nothing. On 2026-11-18, in a PR review hub started, browser-automation-agent had no mcp__playwright__* tools and received no MCP notice. Its only MCP server was the atlassian-rovo server hub passes. compose() starts every session with --strict-mcp-config, and Claude Code's sub-agents page says "The MCP restrictions that apply to the main session also cover servers declared in subagent frontmatter". Claude Code 2.1.327 was running. The invariant's note that /mcp still lists agent-defined servers describes 2.1.296.

Ideal state

  • In a session hub starts, an agent defined in ~/.claude/agents gets the MCP servers its definition declares, so browser-automation-agent can drive a browser
  • Those servers reach only the agent that declares them, never the session's main conversation
  • The agents hub lets through never drift from the agents available in ~/.claude/agents: adding, removing or editing one there changes what the next session hub starts gets, with no change to hub or hub.toml
  • A repository's .mcp.json and its own .claude/agents/ still add no MCP server to a session hub starts
  • The invariant's note on MCP servers defined by agents says what the current Claude Code does with them

Decisions

Constraints

Open

  • How do the agents in ~/.claude/agents reach a session hub starts with their servers intact, and does that change the invariant or only its enforcement notes? The option proposed so far is passing them with --agents, which the docs say --strict-mcp-config "doesn't filter … since those are explicit caller input". (new public interface: hub would read Claude Code's agent file format)

Starting points

  • ui/tui/src/investigations/command.rs: compose() builds each session's claude command
  • docs/invariants/an-investigation-never-loads-mcp-servers-from-the-repository-it-investigates.md: the rule --strict-mcp-config enforces, and its note on agent-defined servers
  • tools/claude/config/agents/browser-automation-agent.md in dotfiles: an agent that declares its own MCP server

Activity

  1. ooloth commented on Nov 19, 2026

    @ooloth
    OwnerAuthor

    The browser agent no longer needs this fix: since ooloth/dotfiles@e59ae3ba it runs Microsoft's Playwright CLI (@playwright/cli, binary playwright-cli) through Bash, so --strict-mcp-config cannot drop it. This issue still matters for nextjs-agent and notion-agent, whose servers are only available over MCP.

  2. ooloth commented on Nov 19, 2026

    @ooloth
    OwnerAuthor

    Since #435, the command starts with "$HUB_LAUNCHER", not claude. On the work laptop that's cc.bash, which reaches claude through exec claude … "$@", so a flag hub adds, such as --agents, still arrives. Decision 034 and the MCP invariant rule out a launcher adding its own --mcp-config, so the fix belongs in what hub passes, not in the launcher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions