Design Capture

Capture, store and serve the complete visual design of any website. Gebruik de design tokens in je eigen apps via de REST API of MCP server.

REST API MCP (stdio + SSE) OpenAPI / ChatGPT Actions PostgreSQL 17

📡 REST API

Volledige REST API voor CRUD op companies en design tokens. Swagger UIopenapi.json

Companies

List all companies

GET /api/v1/companies
curl http://localhost:31009/api/v1/companies
Response
[
  {
    "id": 1,
    "name": "Example Corp",
    "url": "https://example.com",
    "domain": "example.com",
    "notes": null,
    "created_at": "2026-05-17T22:30:00"
  }
]

Create a company

POST /api/v1/companies
curl -X POST http://localhost:31009/api/v1/companies \
  -H "Content-Type: application/json" \
  -d '{"name":"Example Corp","url":"https://example.com"}'

Get / Update / Delete

GET /api/v1/companies/{id}
# Get by ID
curl http://localhost:31009/api/v1/companies/1

# Update (PATCH)
curl -X PUT http://localhost:31009/api/v1/companies/1 \
  -H "Content-Type: application/json" \
  -d '{"name":"New Name"}'

# Delete
curl -X DELETE http://localhost:31009/api/v1/companies/1

Search

GET /api/v1/companies/search/{query}
curl http://localhost:31009/api/v1/companies/search/example

Captures

Trigger a capture

POST /api/v1/captures/company/{company_id}
# Capture with existing company URL
curl -X POST http://localhost:31009/api/v1/captures/company/1

# Capture with a specific URL
curl -X POST http://localhost:31009/api/v1/captures/company/1 \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/page"}'
⏱ Tip: Captures duren 10-30 seconden (Playwright laadt de pagina + extract). De call is synchroon — na de response is de capture complete of failed.

Check capture status

GET /api/v1/captures/{capture_id}
curl http://localhost:31009/api/v1/captures/1

List recent captures

GET /api/v1/captures
curl http://localhost:31009/api/v1/captures

Design Tokens

Get all tokens (hoofd-endpoint)

GET /api/v1/companies/{id}/design
curl http://localhost:31009/api/v1/companies/1/design

Dit returned alles: colors, typography, spacing, borders, gradients, assets, components, breakpoints.

Per categorie

EndpointBeschrijving
GET /companies/{id}/design/colorsKleurenpalet
GET /companies/{id}/design/typographyLettertypen
GET /companies/{id}/design/spacingMarges, paddings, gaps
GET /companies/{id}/design/bordersBorder-radius, box-shadow
GET /companies/{id}/design/gradientsCSS gradients
GET /companies/{id}/design/assetsBrand assets (logo's, iconen)
GET /companies/{id}/design/componentsComponent styles per element
GET /companies/{id}/design/breakpointsMedia queries / breakpoints

CSS export

GET /api/v1/companies/{id}/design/css
curl http://localhost:31009/api/v1/companies/1/design/css

# Response:
/* Design tokens for Example Corp */
:root {
  --color-primary: #1a1a2e;
  --color-accent: #e94560;
  --font-body-family: 'Inter', sans-serif;
  --font-body-size: 16px;
  --padding: 24px;
}

Assets

GET /api/v1/companies/{company_id}/assets/{asset_id}/download
# Download een brand asset (logo, icoon, achtergrond)
curl -o logo.png http://localhost:31009/api/v1/companies/1/assets/1/download

🤖 MCP Server

De MCP (Model Context Protocol) server exposeert 6 tools voor programmatische toegang tot design data. Compatibel met Hermes Agent, Claude Desktop, Cursor, Continue en elke MCP-client.

Connectie methoden

🔹 SSE (HTTP) — aanbevolen

Voor Claude Desktop, Cursor en andere MCP-clients die HTTP ondersteunen:

Claude Desktop config (claude_desktop_config.json)
{
  "mcpServers": {
    "design-capture": {
      "type": "sse",
      "url": "http://192.168.10.12:31009/mcp/sse"
    }
  }
}
Cursor / Windsurf config
{
  "mcpServers": {
    "design-capture": {
      "url": "http://192.168.10.12:31009/mcp/sse"
    }
  }
}
Continue (VS Code plugin)
{
  "experimental": {
    "mcpServers": {
      "design-capture": {
        "transport": "sse",
        "url": "http://192.168.10.12:31009/mcp/sse"
      }
    }
  }
}

🔸 stdio — voor Hermes Agent

Direct Python proces, geen netwerk overhead:

Hermes config.yaml
mcp_servers:
  design-capture:
    transport: stdio
    command: python /app/app/mcp/server.py
Of standalone runnen:
python /app/app/mcp/server.py

MCP Tools (6 stuks)

ToolDoelParameters
design_list_companies Toon alle bedrijven geen
design_get_tokens Haal design tokens op company_id (int)
design_capture_website Start nieuwe capture company_name (str), url (str)
design_search Doorzoek design data query (str)
design_generate_css Genereer CSS vars company_id (int)
design_export_theme Exporteer theme als JSON company_id (int)

Voorbeeld: capture een website via MCP

design_capture_website(
  company_name="Example Corp",
  url="https://example.com"
)
# Response: ✅ Capture complete for Example Corp!
# Company ID: 1  |  Colors: 12  |  Fonts: 8

Voorbeeld: theme exporteren

design_export_theme(company_id=1)
# Response: JSON met theme.colors, theme.typography, theme.spacing
#           theme.borderRadius, theme.shadows, theme.breakpoints
📖 Volledige MCP documentatie: MCP.md — elke tool heeft uitgebreide input/output schema's en foutafhandeling.

🧠 ChatGPT / AI Assistants

OpenAPI spec (GPT Actions)

FastAPI genereert automatisch een volledige OpenAPI 3.1 spec. Deze kun je direct gebruiken als GPT Action in ChatGPT, of in elke andere AI-tool die OpenAPI ondersteunt.

OpenAPI spec URL
http://192.168.10.12:31009/openapi.json

Zo voeg je toe aan ChatGPT

  1. Open ChatGPT → Explore GPTsConfigure
  2. Scroll naar ActionsAdd action
  3. Plak de OpenAPI URL of upload openapi.json:
http://192.168.10.12:31009/openapi.json

Gepubliceerde GPT Actions

📡 Alle endepoints uit de REST API zijn beschikbaar als ChatGPT Actions, inclusief:
  • GET /api/v1/companies — bedrijven opvragen
  • POST /api/v1/companies — nieuw bedrijf aanmaken
  • POST /api/v1/captures/company/{id} — capture starten
  • GET /api/v1/companies/{id}/design — design tokens ophalen
  • GET /api/v1/companies/{id}/design/css — CSS genereren
  • ➕ asset download, search, CRUD

MCP via SSE (Claude)

Voor Claude Desktop en andere MCP-clients gebruik je de SSE-transport op:

http://192.168.10.12:31009/mcp/sse

Hermes Agent

Voeg de MCP server toe aan je Hermes config om design data direct uit Hermes te kunnen opvragen:

# Via SSH tunnel of direct als Hermes op dezelfde VM draait
mcp_servers:
  design-capture:
    transport: sse
    url: http://192.168.10.12:31009/mcp/sse
⚠️ Let op: Voor externe AI-assistenten (ChatGPT, Claude.ai) moet de server publiek bereikbaar zijn óf via een tunnel (ngrok, SSH). Intern op het Smawa-netwerk werkt het direct.

🎨 Design Tokens — Structuur

Wat wordt er precies geëxtraheerd en hoe gebruik je het in je eigen apps?

Wat er wordt opgeslagen

CategorieVoorbeeldGebruik in app
Colors #1a1a2e, --color-primary CSS vars, thema, tailwind config
Typography Inter 16px/1.5 Font stacks, headings, body text
Spacing padding: 24px Layout system, margins, gaps
Borders border-radius: 8px Cards, buttons, inputs styling
Gradients linear-gradient(...) Backgrounds, buttons, hero sections
Assets Logo SVG, favicon, backgrounds Download en gebruik in eigen UI
Components CSS voor button, card, nav, input Kopieer de CSS voor eigen componenten
Breakpoints @media (max-width: 768px) Responsive design, mobile queries

In je eigen app gebruiken

Optie 1: Directe API-call (eenmalig)

# Haal design tokens op voor company X
curl http://localhost:31009/api/v1/companies/1/design \
  | jq '.colors[] | {hex: .hex, role: .role}'

Optie 2: CSS import (continu bijgewerkt)

/* In je app's stylesheet */
@import url("http://localhost:31009/api/v1/companies/1/design/css");

/* Nu beschikbaar: */
body {
  background: var(--color-background, #fff);
  font-family: var(--font-body-family, sans-serif);
}

Optie 3: Theme JSON via MCP

// Gebruik de MCP tool design_export_theme(company_id=1)
// Dit returned een schoon, gestructureerd theme-object:
{
  "theme": {
    "colors": {
      "primary": { "--color-primary": "#1a1a2e" },
      "accent": { "--color-accent": "#e94560" }
    },
    "typography": {
      "body": { "fontFamily": "Inter", "fontSize": "16px" },
      "heading": { "fontFamily": "Poppins", "fontWeight": "700" }
    }
  }
}

Optie 4: Tailwind CSS config

// tailwind.config.js — haal design tokens via API
const designTokens = await fetch(
  'http://localhost:31009/api/v1/companies/1/design'
).then(r => r.json());

module.exports = {
  theme: {
    extend: {
      colors: Object.fromEntries(
        designTokens.colors.map(c => [c.role || 'custom', c.hex])
      ),
      fontFamily: {
        body: [designTokens.typography.find(t => t.usage_tag === 'body')?.fontFamily],
      },
    },
  },
};

Optie 5: ChatGPT / AI Assistant

Gebruik de OpenAPI spec om een GPT Action te maken. Zie tab ChatGPT / AI.

🏢 Companies overzicht

Beheer captured companies, start nieuwe captures, bekijk design data.

v0.1.0 — Design Capture — GitHub