Skip to main content

AI Agents and MCP

LumoAuth treats AI agents as first-class identities: each agent is a registered OAuth client with its own credentials, scopes, budget, and audit trail. This page covers how to register and operate agents, how agents authenticate, and how they connect to Model Context Protocol (MCP) servers — a protocol for LLM hosts (Claude, ChatGPT, Cursor) to discover and call external tools.


Why AI agent identity?

As AI agents become part of enterprise workflows, they need:

  • Authentication — verify which agent is making a request.
  • Authorization — control what each agent can access.
  • Audit trail — track agent actions for compliance.
  • Scoped access — limit agents to specific resources and operations.
  • Revocation — disable agent access immediately.

LumoAuth treats AI agents as first-class identities, similar to users and service accounts.


Managing AI agents

Portal

Navigate to /orgs/{orgId}/portal/agents:

  • Register Agent — create a new agent identity.
  • Agent List — view all registered agents.
  • Agent Detail — manage credentials, permissions, and MCP connections.
  • Revoke Agent — disable an agent immediately.

Registering an agent

  1. Go to /orgs/{orgId}/portal/agents.
  2. Click Register Agent.
  3. Configure:
FieldDescription
NameDisplay name for the agent
DescriptionWhat the agent does
Allowed ScopesWhich scopes the agent can request
PermissionsSpecific permissions granted
Token LifetimeHow long agent tokens are valid
  1. After creation, you receive:
    • Client ID — the agent's identity.
    • Client Secret — the agent's credential.

Agent authentication

Agents authenticate using the OAuth 2.0 client-credentials flow:

curl -X POST https://your-domain.com/orgs/{orgId}/api/v1/oauth/token \
-d grant_type=client_credentials \
-d client_id=AGENT_CLIENT_ID \
-d client_secret=AGENT_CLIENT_SECRET \
-d scope="agent:read agent:execute"

The returned access token contains agent-specific claims:

{
"sub": "agent-uuid",
"client_id": "agent-client-id",
"agent_name": "data-processor",
"scope": "agent:read agent:execute",
"organization": "acme-corp",
"iat": 1706400000,
"exp": 1706403600
}

Workload identity

For agents running on Kubernetes, AWS, GCP, or Azure, LumoAuth can trust the platform's own identity token — a K8s ServiceAccount JWT, an AWS IAM-signed identity, a GCP metadata-server token, or an Azure Managed Identity token — and exchange it for a LumoAuth access token via RFC 8693 — OAuth 2.0 Token Exchange (swap one token for another, recording the subject). No static client secret required. See Workload Identity Federation.


Model Context Protocol (MCP)

LumoAuth is the OAuth 2.1 authorization server for MCP servers: agents obtain a token from LumoAuth and present it to the MCP server, which validates it against LumoAuth.

What is MCP?

MCP lets LLM hosts discover and invoke external tools in a standardized way. MCP servers expose tools; MCP clients call them. LumoAuth authorizes those tool calls.

Configuring MCP servers

  1. Go to /orgs/{orgId}/portal/agentsMCP Servers.
  2. Click Add MCP Server.
  3. Configure:
FieldDescription
NameDisplay name for the MCP server
URLMCP server endpoint
AuthenticationHow the agent authenticates to the MCP server
Allowed AgentsWhich agents can use this MCP server
ScopesWhat operations are permitted

MCP authentication flow

  1. Agent authenticates with LumoAuth.
  2. LumoAuth issues a token scoped for the organization and audience-bound to the MCP server (aud claim set to the server's Resource URI).
  3. Agent presents the token to the MCP server.
  4. MCP server validates the token (JWT signature + aud check, or via introspection).

Agent permissions

Agents can be assigned:

  • Roles — the same RBAC roles used for users.
  • Scopes — OAuth scopes limiting API access.
  • ABAC policies — attribute-based conditions (e.g., time restrictions, IP ranges).
  • Zanzibar relations — fine-grained per-object access.

Principle of least privilege

Grant agents only the minimum permissions they need:


Audit trail

All agent actions are logged in the audit log:

EventDescription
agent.createdAgent registered
agent.authenticatedAgent obtained a token
agent.actionAgent performed an action
agent.revokedAgent access revoked
mcp.connectionAgent connected to MCP server

Use cases

ScenarioDescription
Data processingAgent accesses databases and APIs to process data
Customer supportAI assistant accesses user information to help customers
Code reviewAgent accesses repositories and review tools
MonitoringAgent checks system health and triggers alerts
Content generationAgent accesses CMS and publishes content