Client Integration

infrastrActure exposes one canonical integration endpoint:

GET /api/integrations/client?instanceId=<id>&userId=<optional-user>

This is the authoritative runtime config feed for clients.

Response Model

{
  "mcpServers": {
    "google-workspace": {
      "type": "streamable",
      "url": "http://host:13200/mcp"
    },
    "infrastrActure": {
      "type": "streamable",
      "url": "http://host:7500/mcp"
    }
  }
}

What Gets Merged

The endpoint merges:

  1. user-specific installations
  2. shared tools
  3. running sandboxes
  4. built-in infrastrActure MCP server

Tier-Aware Behavior

This is the most important integration rule.

Caller Key TierWhat It Gets
standarduser installs, standard shared tools, sandboxes
admineverything in standard, plus admin shared tools and built-in infrastrActure MCP server

Normal users should never receive the shared GitHub admin server or the built-in infrastructure server through a standard sync path.

Shared Tool Reconciliation

Before shared-tool config is served, the service reconciles database state against Docker runtime state. That prevents dead or stale shared-tool entries from poisoning client bootstrap.

Multi-tenant key pattern

A client that serves both end users and operators (TessarAct is the canonical example) should hold two upstream keys and pick which one to use per call, based on the caller's privilege:

Caller pathUpstream key
end-user runtime syncINFRASTRACTURE_API_KEY_STANDARD
operator / admin toolingINFRASTRACTURE_API_KEY_ADMIN

The upstream key tier is the real security boundary. App-layer filtering inside the client is useful belt-and-braces, but secondary.

Push Notifications (Webhook)

Instead of relying solely on clients polling the integration endpoint, infrastrActure can push config-change events as soon as something changes.

See Push Notifications for the full contract.

Quick summary:

VariablePurpose
WEBHOOK_CLIENT_URLURL to POST events to
WEBHOOK_CLIENT_SECRETShared secret (Authorization: Bearer)

When set, the WebhookEmitter service fires on install, uninstall, and shared-tool state changes. Clients that implement the receiver can apply an incremental delta without a full re-fetch.

Connecting to the Built-in MCP Server

Only admin-tier clients should receive the built-in server entry:

{
  "infrastrActure": {
    "type": "streamable",
    "url": "https://mcp.aeromechindustries.com.au/mcp"
  }
}

That entry is used for management operations, not ordinary end-user runtime access.