Repository navigation
Description
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
- INV-01: MCP for cmapi: the specification, its authorization and transports #437 INV-01 spike: the MCP specification, its authorization and transports
- INV-02: An agent reads cmapi through MCP tools #438 INV-02 read tools
- INV-03: An agent plans and submits a namespace through MCP #439 INV-03 plan and submit a namespace
- INV-04: An agent plans quota changes and extends expirations through MCP #440 INV-04 quota changes and expirations
- INV-05: cmapi-mcp is an OAuth-protected resource, with agent and on-behalf-of identities #441 INV-05 identity: OAuth-protected resource, agent and on-behalf-of
- INV-06: cmapi-mcp ships as its own component, in step with each instance's contract #442 INV-06 the cmapi-mcp component, in step with the contract
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-mcpon CRC, plans and submits a namespace create that reachessynced, recorded asautomatedwith 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.
Activity