Skip to main content
Glama
AgnosticD Catalog Item Generator

AgnosticD Catalog Item Generator

by ritzshah
README.md
# AgnosticD Catalog Item Generator - MCP Server

An MCP (Model Context Protocol) server that helps create and manage AgnosticD catalog items for lab environments. This server intelligently generates catalog configurations for both CNV and AWS providers, automatically selecting the appropriate provider based on workload requirements.

## Features

- **Intelligent Provider Selection**: Automatically selects CNV provider for CPU workloads and AWS for GPU-intensive workloads
- **Pre-defined Workloads**: Includes common workloads like OpenShift AI, Keycloak, Pipelines, Serverless, and more
- **Environment Analysis**: Analyzes environment descriptions to suggest appropriate configurations
- **Catalog Management**: List, view, and create catalog items
- **Template Generation**: Creates complete catalog item structure with all necessary files

## Available Tools

### 1. `create_catalog_item`
Creates a new AgnosticD catalog item with all necessary files.

**Parameters:**
- `name` (required): Catalog item name (lowercase-with-dashes)
- `display_name` (required): Display name for the catalog
- `category` (required): Catalog category (Workshops, Demos, Labs, Training)
- `workloads` (required): Array of workload IDs to include
- `maintainer_name` (required): Maintainer name
- `maintainer_email` (required): Maintainer email
- `description`: Environment description
- `openshift_version`: OpenShift version (default: "4.20")
- `cluster_size`: "sno" or "multinode" (default: "multinode")
- `multiuser`: Support multiple users (default: false)
- `num_users`: Number of users (default: 1)
- `force_provider`: Force specific provider ("cnv" or "aws")

### 2. `list_available_workloads`
Lists all available workloads that can be deployed in catalog items.

### 3. `list_catalog_items`
Lists all existing catalog items in agd_v2.

**Parameters:**
- `filter`: Optional filter string to search catalog items

### 4. `get_catalog_item`
Gets detailed information about a specific catalog item.

**Parameters:**
- `name` (required): Name of the catalog item

### 5. `analyze_environment_requirements`
Analyzes environment requirements and suggests appropriate provider and configuration.

**Parameters:**
- `description` (required): Description of the environment
- `products`: Array of products/technologies to deploy

## Available Workloads

- **openshift_ai**: Red Hat OpenShift AI platform (GPU required, AWS)
- **keycloak_auth**: Keycloak-based user authentication (CNV)
- **cert_manager**: Certificate Manager for TLS certificates (AWS)
- **nvidia_gpu**: NVIDIA GPU Operator (GPU required, AWS)
- **pipelines**: OpenShift Pipelines (CNV)
- **serverless**: OpenShift Serverless (CNV)
- **ols**: OpenShift Lightspeed (CNV)
- **nfd**: Node Feature Discovery (CNV)
- **authorino**: Authorino authorization service (CNV)

## Installation

1. Clone this repository:
```bash
cd /Users/riteshshah/github/mcp-demo-platform/agent-create-agv
```

2. Install dependencies:
```bash
pip install -r requirements.txt
```

3. Make the server executable:
```bash
chmod +x server.py
```

## Configuration

### For Claude Desktop

Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):

```json
{
  "mcpServers": {
    "agnosticd-catalog": {
      "command": "python3",
      "args": ["/Users/riteshshah/github/mcp-demo-platform/agent-create-agv/server.py"]
    }
  }
}
```

### For Claude Code CLI

Add to your MCP settings file:

```json
{
  "mcpServers": {
    "agnosticd-catalog": {
      "command": "python3",
      "args": ["/Users/riteshshah/github/mcp-demo-platform/agent-create-agv/server.py"]
    }
  }
}
```

## Usage Examples

### Example 1: Create an OpenShift AI Workshop

```
Use the create_catalog_item tool to create a new catalog item:
- name: "my-openshift-ai-workshop"
- display_name: "OpenShift AI Workshop"
- category: "Workshops"
- workloads: ["openshift_ai", "nvidia_gpu", "keycloak_auth", "cert_manager"]
- multiuser: true
- num_users: 25
- maintainer_name: "Your Name"
- maintainer_email: "your.email@redhat.com"
```

This will automatically:
- Select AWS provider (GPU workloads detected)
- Create the catalog item folder
- Generate common.yaml with all configurations
- Generate dev.yaml with development settings
- Generate description.adoc documentation

### Example 2: Analyze Environment Requirements

```
Use the analyze_environment_requirements tool:
- description: "I need an environment for a workshop teaching OpenShift Pipelines and GitOps workflows to 30 students"
- products: ["OpenShift Pipelines", "OpenShift GitOps", "Tekton"]
```

The tool will analyze and suggest:
- Provider: CNV (no GPU needed)
- Cluster size: multinode
- Workloads: pipelines, keycloak_auth
- Configuration recommendations

### Example 3: List Existing Catalog Items

```
Use the list_catalog_items tool with filter:
- filter: "ai"
```

This will list all catalog items with "ai" in their name.

## File Structure

When you create a catalog item, the following structure is generated:

```
agd_v2/
└── your-catalog-item/
    ├── common.yaml       # Main configuration
    ├── dev.yaml          # Development environment settings
    └── description.adoc  # Documentation
```

### CNV vs AWS Provider

**CNV Provider (default for CPU workloads):**
- Uses OpenShift CNV for virtualization
- No GPU support
- More cost-effective
- Suitable for most workshops and demos
- Uses `cloud_provider: none` and `config: openshift-workloads`

**AWS Provider (auto-selected for GPU workloads):**
- Native AWS EC2 instances
- GPU support available
- Required for AI/ML workloads
- Uses `cloud_provider: aws` and `config: openshift-cluster`

## Development

### Running the Server Directly

```bash
python3 server.py
```

### Testing

You can test the server by connecting it to Claude Desktop or Claude Code CLI and using the available tools.

## Configuration Paths

The server uses these default paths (configurable in server.py):
- AgnosticV catalog items: `/Users/riteshshah/github/agnosticv/agd_v2`
- AgnosticD v2 roles: `/Users/riteshshah/github/agnosticd-v2`

Update these paths in `server.py` if your repositories are located elsewhere:

```python
AGD_V2_PATH = Path("/path/to/your/agnosticv/agd_v2")
AGNOSTICD_V2_PATH = Path("/path/to/your/agnosticd-v2")
```

## Troubleshooting

1. **"Catalog item already exists"**: The catalog item name must be unique. Choose a different name or delete the existing item.

2. **"Path not found"**: Ensure the AGD_V2_PATH and AGNOSTICD_V2_PATH are correctly configured in server.py.

3. **"Module not found"**: Install dependencies with `pip install -r requirements.txt`.

## Contributing

This MCP server is designed to be extensible. To add new workloads:

1. Add the workload definition to the `WORKLOADS` dictionary in `server.py`
2. Specify whether it requires GPU
3. Specify the preferred provider
4. Add a description

## License

This project follows the same license as AgnosticD.

## Support

For issues and questions:
- AgnosticD Documentation: https://github.com/agnosticd/agnosticd-v2
- AgnosticV Repository: https://github.com/rhpds/agnosticv

## Credits

Created for the Red Hat Demo Platform (RHDP) to simplify AgnosticD catalog item creation.