Skip to content

INV-05: cmapi-mcp is an OAuth-protected resource, with agent and on-behalf-of identities #441

Open

Description

@ephico2real2

Part of #436

Story

As a platform owner, I want cmapi-mcp to authenticate agents through Keycloak and call cmapi either as the agent's own client or on behalf of a person, never passing a user's token through, so that every agent request is attributed and limited to the right role.

Business value

Agents get exactly the access their role allows, and the audit trail names both the agent and the person.

Context

Keycloak clients and roles: docs/15; cmapi-automation uses client credentials with cmapi-onboarding (create only); onBehalfOf exists; token exchange (RFC 8693) is proposed in docs/14. INV-01 states the MCP authorization rules.

Acceptance criteria

  • The MCP server publishes its protected resource metadata and refuses a token not issued for it, shown by a test.
  • As its own client, an agent holds only its role's permissions; a delete is refused, shown by a test and on CRC.
  • On behalf of a person, cmapi records the person as requester and the agent as caller, automated, shown by a test.
  • No user token is forwarded unchanged to cmapi, shown by a test.
  • Which tools are excluded or marked destructive is the owner's decision, recorded in the design.

Tasks

  • The owner's decisions from INV-01; the Keycloak client(s) as code in the realm files.

Out of scope

  • A new identity provider.

Definition of done

  • Mockup approved, or the work has no screen and no API shape
  • Draft pull request open
  • Build: tests fail before the change and pass after it
  • Documented where a reader looks for it
  • Review ruled
  • Merged with its proof
  • Released on the default branch

Class

INV

Activity

  1. added
    story
    class:INV
    status:open
    Backlog
    on Nov 19, 2026
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

    Backlogclass:INVstatus:openstory

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions