Problem Statement
PatternFly icons are available in @patternfly/react-icons and displayed on the website at https://www.patternfly.org/design-foundations/icons#all-icons, but there is no API endpoint to fetch icon metadata or SVGs programmatically.
Key Requirement: The API must support fine-grained filtering to minimize response size for MCP/LLM consumption, reducing context bloat when fetching icons.
Goal
Create API endpoints that expose PatternFly icons with a hierarchical structure consistent with existing API patterns, enabling MCPs and other consumers to fetch only the specific icons they need.
Proposed Solution
Add icon endpoints following the existing API hierarchy pattern:
GET /api/icons → Returns list of all available icons with metadata
GET /api/icons?filter=circle → Returns filtered list of icons with metadata
GET /api/icons/[icon-name] → Returns actual SVG markup for the icon
Completion Criteria
Out of Scope
- Serving React components (only SVG markup and metadata)
- Icon categorization if metadata not available in package (can be added later via manual mapping)
- Customizing icon colors or sizes via query parameters
- Curating to website's subset of 194 icons (expose all ~873 icons)
Jira Issue: PF-2810
Problem Statement
PatternFly icons are available in
@patternfly/react-iconsand displayed on the website at https://www.patternfly.org/design-foundations/icons#all-icons, but there is no API endpoint to fetch icon metadata or SVGs programmatically.Key Requirement: The API must support fine-grained filtering to minimize response size for MCP/LLM consumption, reducing context bloat when fetching icons.
Goal
Create API endpoints that expose PatternFly icons with a hierarchical structure consistent with existing API patterns, enabling MCPs and other consumers to fetch only the specific icons they need.
Proposed Solution
Add icon endpoints following the existing API hierarchy pattern:
GET /api/icons→ Returns list of all available icons with metadataGET /api/icons?filter=circle→ Returns filtered list of icons with metadataGET /api/icons/[icon-name]→ Returns actual SVG markup for the iconCompletion Criteria
API Routes Created
/api/icons/index.tsroute returning array of icon objects with metadata/api/icons/[icon-name].tsroute returning SVG markup asimage/svg+xml@patternfly/react-icons/dist/esm/iconsindexRoute:
/api/icons(index){ name, reactName, style, usage, unicode }?filter=query parameter for case-insensitive substring match on icon nameRoute:
/api/icons/[icon-name]<svg width="{width}" height="{height}" viewBox="{xOffset} {yOffset} {width} {height}"><path d="{svgPath}"/></svg>image/svg+xmlError Handling
/api/icons?filter=...Documentation
src/pages/api/index.tsendpoints array with icon endpoints/api/openapi.json.tsif applicableTesting
Out of Scope
Jira Issue: PF-2810