Skip to content

BYO agents Phase 3: generic mcp.mode: config declarative MCP injection #202

Closed

Description

@JAORMX

Follow-up to #191 (epic). Phase 1 (#200) added mcp.mode: env (the agent discovers the proxy via BBOX_MCP_URL). This issue adds the second generic mode, mcp.mode: config, so a custom/BYO agent whose harness only reads a config file can be wired to the proxy declaratively — without a per-agent Go MCPInjector.

Scope

Declaratively patch a JSON/JSONC/TOML/YAML config file in the guest home:

mcp:
  enabled: true
  mode: config
  inject:
    - guest_path: .config/aider/mcp.json
      format: json
      merge:
        mcpServers:
          broodbox:
            type: streamable-http
            url: "${BBOX_MCP_URL}"
  • Config shape (inject entries: guest_path, format, merge tree) stays pure domain data in pkg/domain/config / pkg/domain/agent.
  • The generic merge implementation lives in internal/infra — reuse pkg/clients/internal/configio (JSON/TOML/YAML merge) and the JSONC support already in internal/infra/settings.
  • ${BBOX_MCP_URL} (and other BBOX_*) substitution should resolve against the universal env from Add declarative bring-your-own agent support (#191 Phase 1) #200; config.MCPEndpointPath remains the single source of truth for the /mcp path.
  • ValidateCustomAgent currently rejects mcp.mode: config with "not supported in this version" — flip that to accept + validate the inject entries (safe relative guest_path, known format).
  • Built-ins keep their bespoke Plugin.MCPConfig(); this is only for data-only agents.

Acceptance criteria

A data-only agent with mcp.mode: config boots with its config file patched to point at the in-VM proxy, with no pkg/clients/ package.

Activity

  1. added
    enhancement
    on Jun 27, 2026
  2. added
    needs-triage
    on Jun 27, 2026
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

    enhancementneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions