Skip to content

Remove engine types from the mcpbroker contract #2528

Closed as not planned
Closed as not planned

Description

@ChrisJBurns

Problem

The MCP broker's contract is defined in engine types, which ties the broker to the engine and stops the contract crossing a process boundary cleanly.

Design

What

The contract package internal/mcpbroker (broker.go, connector.go, continuity.go) is defined in engine types:

  • from engine/session: SessionID, IncarnationID, Principal, PrincipalScopeHash, ExternalBinding, ExternalAuthorization, AuthorizationStatus, WorkspaceEnrollmentID, ValidWorkspaceEnrollmentToolNames;
  • from engine/tool: Tool (whose Execute brings in session.ToolCall, session.ToolResult, and tool.Environment), ToolSpec, AuthorizationRequester, and the optional tool interfaces Disclosable, DispatchSerial, PlanOnly.

Give the contract its own request and result types and map at the server boundary. The optional tool interfaces control how the engine dispatches broker tools, so the mapping must keep their behavior.

How it fits

An engine-shaped contract cannot cross a process boundary cleanly; see "The same contract in-process" under Modulith constraints.

Done when

internal/mcpbroker exports broker-owned types; engine types appear only in the adapters that map them; behavior unchanged.

Activity

  1. ChrisJBurns commented on Nov 5, 2026

    @ChrisJBurns
    ContributorAuthor

    Closing as not planned. This ticket's reason was letting the MCP broker contract cross a process boundary. That's no longer the plan: the MCP broker stays in mecak8s as the MCP client that sends gateway calls, and the identity broker stays a separate component that authorizes calls and issues the gateway tokens (design PR #2726).

    What's left of it:

    • No engine types in new contract code. This is now a requirement on the slice 4 sending path (MCP broker authorizes gateway calls and sends them to the configured gateway #2536).
    • The unused continuity interfaces in internal/mcpbroker/continuity.go (CredentialCustodyStager, CredentialContinuityAdvertiser, CredentialContinuityService, ExpectedBindingAttacher) have no implementer or caller outside that file and its tests. Delete them whenever that code is next touched.
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

    agent-identity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions