This document explains how the Lightspeed Agent integrates with the Red Hat Lightspeed MCP server to access console.redhat.com APIs.
The agent uses the Red Hat Lightspeed MCP Server as a sidecar to access Red Hat Insights APIs. The MCP (Model Context Protocol) server provides tools that the agent can call to retrieve data from:
- Advisor: System configuration recommendations
- Inventory: Registered systems and host information
- Vulnerability: CVE data and security analysis
- Remediations: Playbook management and issue resolution
- Patch: System update information
- Image Builder: Custom RHEL image creation
┌─────────────────────────────────────────────────────────────────┐
│ Deployment Pod │
│ │
│ ┌─────────────────────┐ ┌─────────────────────────────┐ │
│ │ Lightspeed Agent │ │ Red Hat Lightspeed MCP │ │
│ │ │ │ Server │ │
│ │ ┌─────────────┐ │ HTTP │ ┌─────────────────────┐ │ │
│ │ │ Gemini │ │◄────►│ │ MCP Tools │ │ │
│ │ │ Model │ │:8080 │ │ - advisor │ │ │
│ │ └─────────────┘ │ │ │ - inventory │ │ │
│ │ │ │ │ │ - vulnerability │ │ │
│ │ ▼ │ │ │ - remediations │ │ │
│ │ ┌─────────────┐ │ │ └─────────────────────┘ │ │
│ │ │ ADK Agent │ │ │ │ │ │
│ │ └─────────────┘ │ │ │ │ │
│ │ │ │ ▼ │ │
│ │ Port 8000 │ │ ┌─────────────────────┐ │ │
│ └─────────────────────┘ │ │ OAuth2 Client │ │ │
│ │ │ (Lightspeed) │ │ │
│ │ └──────────┬──────────┘ │ │
│ │ │ │ │
│ └──────────────┼──────────────┘ │
│ │ │
└──────────────────────────────────────────────┼──────────────────┘
│
▼
┌─────────────────────┐
│ console.redhat.com │
│ │
│ - Advisor API │
│ - Inventory API │
│ - Vulnerability API│
│ - Remediations API │
│ - Patch API │
│ - Image Builder API│
└─────────────────────┘
The agent forwards the caller's JWT token to the MCP server via the Authorization: Bearer <token> header. The MCP server uses this token to authenticate with console.redhat.com on behalf of the calling user.
The MCP server connection requires these environment variables on the agent:
| Variable | Description |
|---|---|
MCP_TRANSPORT_MODE |
Transport mode: stdio, http, or sse |
MCP_SERVER_URL |
MCP server URL (for http/sse modes) |
MCP_READ_ONLY |
Enable read-only mode (recommended: true) |
The MCP server itself requires:
| Variable | Description |
|---|---|
MCP_SERVER_MODE |
Server mode: http for HTTP transport |
MCP_SERVER_PORT |
Port to listen on (default: 8080) |
READ_ONLY |
Enable read-only mode (recommended: true) |
1. User sends request to Agent with Bearer token
│
▼
2. Agent receives tool call request
│
▼
3. Agent forwards caller's JWT token to MCP server
│ via Authorization: Bearer header
│
▼
4. MCP server calls console.redhat.com API with the token
│
▼
5. Returns results to Agent
The agent can connect to the MCP server using different transport modes:
The MCP server runs as an HTTP server, and the agent connects to it.
Podman deployment (port 8081 to avoid A2A Inspector conflict):
# Agent configuration
MCP_TRANSPORT_MODE: http
MCP_SERVER_URL: http://localhost:8081
# MCP server configuration
MCP_SERVER_MODE: http
MCP_SERVER_PORT: 8081Cloud Run deployment (port 8080 for sidecar):
# Agent configuration
MCP_TRANSPORT_MODE: http
MCP_SERVER_URL: http://localhost:8080
# MCP server configuration
MCP_SERVER_MODE: http
MCP_SERVER_PORT: 8080The agent spawns the MCP server as a subprocess and communicates via stdin/stdout.
MCP_TRANSPORT_MODE: stdioThis mode runs the MCP server container using podman:
podman run --interactive --rm ghcr.io/redhatinsights/red-hat-lightspeed-mcp:latestThe lightspeed-agent-pod.yaml includes the MCP server as a container:
containers:
- name: insights-mcp
image: ghcr.io/redhatinsights/red-hat-lightspeed-mcp:latest
env:
- name: MCP_SERVER_MODE
value: "http"
- name: MCP_SERVER_PORT
value: "8080"
ports:
- containerPort: 8080The MCP server runs as a sidecar container in the Cloud Run service:
containers:
- name: lightspeed-agent
# ... agent configuration ...
env:
- name: MCP_TRANSPORT_MODE
value: "http"
- name: MCP_SERVER_URL
value: "http://localhost:8080"
- name: insights-mcp
image: ghcr.io/redhatinsights/red-hat-lightspeed-mcp:latestThe MCP server provides these tools to the agent:
| Tool | Description |
|---|---|
advisor_get_recommendations |
Get recommendations for a system |
advisor_list_rules |
List all advisor rules |
advisor_get_rule |
Get details of a specific rule |
| Tool | Description |
|---|---|
inventory_list_hosts |
List registered hosts |
inventory_get_host |
Get host details by ID |
inventory_search_hosts |
Search hosts by criteria |
| Tool | Description |
|---|---|
vulnerability_list_cves |
List CVEs affecting systems |
vulnerability_get_cve |
Get CVE details |
vulnerability_get_affected_systems |
Get systems affected by a CVE |
| Tool | Description |
|---|---|
remediations_list |
List available remediations |
remediations_get |
Get remediation details |
remediations_create |
Create a new remediation (if not read-only) |
| Tool | Description |
|---|---|
patch_list_advisories |
List available patches |
patch_get_advisory |
Get patch details |
patch_get_systems |
Get systems needing patches |
-
Check if the MCP server container is running:
podman logs lightspeed-agent-pod-insights-mcp
-
Verify the health endpoint:
curl http://localhost:8080/health
-
Check environment variables are set correctly
- Verify the caller's JWT token is valid and not expired
- Check if the user has access to the required Insights services
- Look for OAuth errors in MCP server logs:
podman logs lightspeed-agent-pod-insights-mcp | grep -i auth
- Check if you have access to the required Insights services
- Verify your Red Hat account has the necessary subscriptions
- Check the MCP server logs for API error responses
- Ensure MCP server is listening on the correct port
- Verify
MCP_SERVER_URLin agent matches MCP server configuration - Check network connectivity between containers
- Token Security: JWT tokens are forwarded per-request and not stored persistently
- Read-Only Mode: Enable
READ_ONLY=trueto prevent write operations - Network Isolation: The MCP server only needs to reach console.redhat.com
- Least Privilege: Ensure users have only the necessary permissions in console.redhat.com