Skip to main content
Glama
dmarsters

Brassiere Aesthetics MCP Server

by dmarsters
README.md
# Brassiere Aesthetics MCP Server

MCP server implementing visual vocabulary and structural parameters for brassiere/lingerie design. Maps professional design taxonomy to image-generation-ready specifications with zero LLM cost for composition.

## Architecture

**Three-layer cost optimization:**

- **Layer 1: Pure Taxonomy** (0 tokens)
  - 7 canonical silhouette types with geometric parameters
  - 7 material properties (opacity, stretch, surface finish)
  - 6 construction techniques (molded, seamed, padded, etc.)
  - 6 structural elements (gore, underwire, straps, etc.)
  - 6 decorative elements (bows, piping, appliqué, etc.)

- **Layer 2: Deterministic Operations** (0 tokens)
  - Silhouette parameter mapping
  - Material/construction composition
  - Visual vocabulary extraction
  - Support distribution physics
  - Design constraint validation

- **Layer 3: LLM Synthesis** (client-side)
  - Creative interpretation
  - Style adaptation
  - Narrative generation

## Installation

### FastMCP Cloud Deployment

```bash
# Install from directory
pip install -e .

# Test locally
python brassiere_aesthetics_mcp.py

# Deploy to FastMCP Cloud
fastmcp deploy brassiere_aesthetics_mcp.py:mcp
```

### Claude Desktop Configuration

Add to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "brassiere-aesthetics": {
      "command": "python",
      "args": ["/path/to/brassiere_aesthetics_mcp.py"]
    }
  }
}
```

## Taxonomy Overview

### Silhouette Types

| ID | Name | Coverage | Lift Angle | Support | Visual Geometry |
|----|------|----------|------------|---------|-----------------|
| `balconette` | Balconette | 75% | 45° | Underwire | Horizontal top edge, 20° outward cups |
| `plunge` | Plunge | 65% | 35° | Underwire | Deep V center, 25° outward, low gore |
| `demi` | Demi/Half Cup | 50% | 40° | Underwire | Horizontal at 50% coverage, upper curve emphasis |
| `full_coverage` | Full Coverage | 95% | 30° | Underwire | Vertical seams, high gore, complete enclosure |
| `triangle` | Triangle/Bralette | 60% | 15° | Minimal | Soft triangular drape, natural contour |
| `push_up` | Push-Up | 70% | 50° | Underwire | Graduated padding, central elevation |
| `longline` | Longline | 85% | 35° | Underwire | Extended band to waist, 12-15cm height |

### Materials

- **Power Mesh**: 30% opacity, 1:3 stretch, matte grid texture, structural support
- **Chantilly Lace**: 40% opacity, 1:1.5 stretch, delicate floral, overlay use
- **Guipure Lace**: 20% opacity, non-stretch, 3D raised texture, appliqué
- **Satin**: 100% opacity, minimal stretch, high gloss reflective
- **Silk**: 90% opacity, minimal stretch, soft natural luster
- **Spacer Foam**: 100% opacity, 1:1.3 stretch, seamless 3D breathable
- **Cotton**: 95% opacity, minimal/moderate stretch, matte soft texture

### Construction Techniques

- **Molded/Seamless**: Smooth surface, no visible seams, uniform thickness
- **Seamed**: Visible tension lines, 2-4 panels, directional shaping
- **Padded/Push-Up**: Graduated thickness, 5-20mm foam, enhanced projection
- **Wire-Free**: Soft structure, band compression support, flexible
- **Lined**: Double layer, opacity, clean interior finish
- **Unlined**: Single layer, visible lace/mesh, minimal structure

## Usage Examples

### 1. List Available Options

```python
# View all silhouette types
result = list_silhouette_types()

# View materials and construction techniques
result = list_materials_and_techniques()

# View structural and decorative elements
result = list_structural_and_decorative_elements()
```

### 2. Get Silhouette Specifications

```python
result = get_silhouette_specifications("balconette")

# Returns:
{
  "silhouette_id": "balconette",
  "parameters": {
    "silhouette_type": "Balconette",
    "coverage": 0.75,
    "lift_angle": 45.0,
    "separation": 0.7,
    "center_gore_height": "medium",
    "cup_angle": 20.0,
    "support_type": "underwire",
    "visual_geometry": "horizontal top edge, cups angled 20° outward, gore height 3-4cm"
  },
  "support_distribution": {
    "band_support_percentage": 75.0,
    "strap_support_percentage": 25.0,
    "support_type": "underwire"
  },
  "cost_tokens": 0
}
```

### 3. Compose Complete Design

```python
result = compose_brassiere_design(
    silhouette_id="plunge",
    materials='["chantilly_lace", "power_mesh"]',
    construction="seamed",
    decorative_elements='["bow", "contrast_piping"]',
    intensity=0.9
)

# Returns complete visual vocabulary with:
# - Silhouette geometric parameters
# - Material surface/opacity/stretch properties
# - Construction visual signatures
# - Decorative element placements
# - Support distribution physics
```

### 4. Generate Image Prompt

```python
result = generate_image_prompt(
    silhouette_id="balconette",
    materials='["chantilly_lace", "satin"]',
    construction="seamed",
    decorative_elements='["bow", "scalloped_edge"]',
    style_modifier="photorealistic fashion photography",
    intensity=1.0
)

# Returns:
{
  "prompt": "photorealistic fashion photography, Balconette silhouette: horizontal top edge, cups angled 20° outward, gore height 3-4cm, cup angle 20.0° outward from center, lift angle 45.0° from horizontal, medium center gore height, Chantilly Lace: semi-matte, delicate floral pattern, opacity 40%, Satin: high gloss, smooth reflective, opacity 100%, Seamed: visible seam lines, 2-4 panel construction, tension lines, Bow at center gore (60%), strap junctions (30%), side panels (10%): ribbon width 0.5-2cm, bow span 2-5cm, can be flat or dimensional, Scalloped Edge at cup tops, band edges: wave pattern 0.5-2cm amplitude, follows lace motifs or creates geometric repeat",
  "geometric_specifications": [
    "Balconette silhouette: horizontal top edge, cups angled 20° outward, gore height 3-4cm",
    "cup angle 20.0° outward from center",
    "lift angle 45.0° from horizontal",
    "medium center gore height",
    "Chantilly Lace: semi-matte, delicate floral pattern, opacity 40%",
    "Satin: high gloss, smooth reflective, opacity 100%",
    "Seamed: visible seam lines, 2-4 panel construction, tension lines",
    "Bow at center gore (60%), strap junctions (30%), side panels (10%): ribbon width 0.5-2cm, bow span 2-5cm",
    "Scalloped Edge at cup tops, band edges: wave pattern 0.5-2cm amplitude"
  ],
  "cost_tokens": 0
}
```

### 5. Analyze Design Constraints

```python
result = analyze_design_constraints(
    silhouette_id="push_up",
    materials='["silk", "cotton"]',
    construction="wire_free"
)

# Returns:
{
  "compatibility": "incompatible",
  "warnings": [
    "Incompatibility: silhouette expects underwire support but construction is wireless",
    "Recommendation: Push-Up silhouette typically requires structural material (power_mesh or spacer_foam) for adequate support"
  ],
  "support_requirements": {
    "type": "underwire",
    "lift_angle": 50.0,
    "coverage": 0.7
  }
}
```

## Cost Analysis

| Operation | Tokens | Method |
|-----------|--------|--------|
| List silhouette types | 0 | Pure taxonomy lookup |
| Get specifications | 0 | Deterministic mapping |
| Compose design | 0 | Taxonomy extraction |
| Generate image prompt | 0 | Vocabulary assembly |
| Analyze constraints | 0 | Rule-based validation |

**Total system cost: $0** for all deterministic operations.

LLM synthesis only required for creative interpretation (client-side, Layer 3).

## Technical Details

### Support Distribution Physics

Empirical support ratios:
- **Underwire**: 75% band, 25% straps
- **Wireless**: 70% band, 30% straps
- **Minimal**: 60% band, 40% straps

Band efficiency calculated as: `min(1.0, band_height_cm / 5.0)`

Optimal band height: 5cm (100% efficiency)

### Geometric Specifications

Following user preference for explicit geometric descriptions:

- **Angles**: "cups angled 20° outward from center"
- **Dimensions**: "gore height 3-4cm", "ribbon width 0.5-2cm"
- **Ratios**: "opacity 40%", "coverage 75%"
- **Positions**: "at center gore (60%), strap junctions (30%)"

These translate directly to image generation parameters without requiring LLM interpretation.

## Design Workflow

**Typical usage pattern:**

1. **Explore taxonomy**: List available options
2. **Select components**: Choose silhouette, materials, construction, decorative elements
3. **Validate constraints**: Check compatibility
4. **Compose design**: Generate complete parameter set
5. **Extract vocabulary**: Generate image prompt with geometric specs
6. **Synthesize** (Layer 3): Apply creative interpretation via LLM

**Cost optimization:**
- Steps 1-5: 0 tokens (pure deterministic)
- Step 6: ~100-200 tokens (optional creative synthesis)

## Integration with Lushy

This server provides the **deterministic backbone** for a Lushy workflow that:
1. Accepts natural language design intent
2. Maps to taxonomy parameters (this server, 0 tokens)
3. Synthesizes creative interpretation (LLM, minimal tokens)
4. Generates ComfyUI workflow for rendering

**Cost savings**: ~60-70% vs pure LLM approach by offloading taxonomy mapping and composition to deterministic operations.

## Domain Expansion

**Potential additions:**
- Size grading parameters (band circumference, cup volume)
- Color palette taxonomy
- Seasonal style modifiers
- Brand/designer aesthetic profiles
- Cultural/regional design variations
- Historical period silhouettes

**Functional extensions:**
- Fit analysis (body shape compatibility)
- Material comfort ratings
- Durability predictions
- Manufacturing complexity scoring

## Research Applications

**Academic domains:**
- Fashion design education
- Apparel engineering
- Textile science
- Biomechanics (support distribution)
- Industrial design (structural optimization)

**Industry applications:**
- Automated design specification
- Quality control (constraint validation)
- Inventory categorization
- Size recommendation systems
- Manufacturing optimization

## License

MIT

## Author

Dal Marsters - Lushy AI Workflows