Skip to content

Epic 7: Agent access to cmapi over MCP #436

Open
0 of 6 issues completed
Open

Description

@ephico2real2

Part of #6

Goal

AI agents use cmapi through a Model Context Protocol (MCP) server: they read clusters, namespaces, requests, quotas, capacity and policies, and they plan and submit changes, with the same rules a person meets in the portal (plan before submit, approvals, idempotency, If-Match), under an identity cmapi records.

Business value

Teams can onboard and change namespaces from the AI tools they already use, without a person clicking through the portal, and without giving an agent more power than a person has. Every agent request is attributed and auditable.

Why

cmapi already expects agent callers: the cmapi-automation client, the create-only cmapi-onboarding role, onBehalfOf, and the automated and requesterClient facts that approval rules can match (docs/01, "Onboarding and automation accounts"). It publishes an OpenAPI 3.1 document per instance (/openapi.json, Swagger at /docs). There is no MCP server, so each agent must hand-write HTTP calls and learn the plan/submit rules itself. Proposed by the owner, 2026-11-19.

Scope

  • Curated task-level MCP tools, not one tool per OpenAPI operation (the contract has 39 operations).
  • Tool schemas generated from each instance's /openapi.json, so required labels and annotations stay exact per instance and the tools sit under the contract gate.
  • Writes safe by construction: plan first, Idempotency-Key, If-Match; approvals unchanged; destructive tools excluded or marked for a human.
  • Identity: the MCP server is an OAuth-protected resource in front of Keycloak; the agent acts as its own client (cmapi-onboarding) or on behalf of a person through token exchange (RFC 8693); a user's token is never passed through unchanged.
  • A separate component cmapi-mcp: image, chart entry, remote (HTTP) and local (stdio) transports, deployed and proven on CRC.

Out of scope

  • Changes to the cmapi API's behaviour (the MCP server is a client of the published contract).
  • Agent frameworks or prompts beyond the tools' own descriptions.

Issues

Risks and open questions

  • The MCP specification moves fast: version, authorization rules and transports are researched from primary sources first (INV-01).
  • Token exchange is only proposed in docs/14; on-behalf-of may wait for it.
  • Which writes an agent may make without a human (the owner decides; approvals already gate them).

Exit criteria

  • An agent, through cmapi-mcp on CRC, plans and submits a namespace create that reaches synced, recorded as automated with its client, checked by a live walk with evidence.
  • Each MCP tool's input schema equals the instance's /openapi.json, checked by a CI test.
  • No tool sends a write without a prior plan the agent saw, checked by a test that fails when it does.

Sub-issues

Sub-issues

0 of 6 Issues completed
Loading 6 sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Backlogepicstatus:open

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions