Skip to content

Specify mutually exclusive gateway agentId and agentIds fields #56938

Description

@lpcox

Summary

Update the normative MCP Gateway specification and published schemas to support multiple configured agent/session identifiers.

The JSON contract should support either:

{
  "gateway": {
    "agentId": "primary-agent"
  }
}

or:

{
  "gateway": {
    "agentIds": ["primary-agent", "enclave-agent"]
  }
}

The two forms must be mutually exclusive. This is the specification counterpart to github/gh-aw-mcpg#12115.

Motivation

mcpg already maintains concurrent session label state keyed by session/agent ID, but its configuration exposes only one singular identifier. A plural form is needed as the configuration foundation for allowing a primary agent and enclave sessions to share one gateway instance while retaining independent DIFC state and policies.

Normative requirements

  • Define gateway.agentIds as an array of agent/session identifiers.
  • Require agentIds to contain at least one item.
  • Require each item to be a non-empty string.
  • Define gateway.agentId and gateway.agentIds as mutually exclusive.
  • Require a gateway configuration to select one of the singular or plural forms where an agent identifier is required today.
  • Remove gateway.apiKey from the specification and published schemas. The terminology is misleading because the field represents agent/session identity rather than a separately modeled API credential.
  • Document JSON agentIds and the corresponding mcpg TOML spelling agent_ids consistently.
  • Update examples to use agentId or agentIds, never apiKey.

Schema work

Update every maintained/published MCP Gateway schema copy so they remain identical in behavior:

  • Add agentIds with type: array, minItems: 1, and string items with minLength: 1.
  • Remove the apiKey property and any required-field alternatives referencing it.
  • Encode singular/plural mutual exclusion.
  • Add schema tests for:
    • valid agentId
    • valid one- and multi-entry agentIds
    • empty agentIds
    • empty entries
    • both agentId and agentIds
    • removed apiKey

Compatibility and rollout

The implementation may temporarily continue parsing legacy api_key/apiKey internally, but it should no longer be part of the normative or published configuration contract. Existing agentId configurations remain valid.

Runtime mapping from individual IDs to allow-only policies is explicitly follow-up work; this issue defines only the singular/plural configuration contract.

Acceptance criteria

  • The normative specification describes both forms and their exclusivity.
  • All published schema copies enforce the same constraints.
  • apiKey is absent from specification prose, examples, and schema definitions related to gateway identity.
  • Schema/spec validation and repository tests pass.
  • The resulting contract matches the implementation tracked in Add mutually exclusive gateway agent_ids configuration gh-aw-mcpg#12115.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementmcp

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions