ThemeContext Documentation

Extract design tokens from any website with AI. Get colors, typography, spacing, and more exported to JSON, CSS, Tailwind, or SCSS.

AI-Powered Extraction

Uses Google Gemini to intelligently identify and categorize design tokens from any website.

Multiple Formats

Export to CSS Variables, Tailwind Config, SCSS, TypeScript, or raw JSON.

MCP Server

Native integration with Claude Code, Cursor, and other AI coding assistants via MCP.

Download Ready

Download complete theme packages as ZIP with documentation and all format variants.

Use Cases

Without ThemeContext

  • Manually inspecting CSS with DevTools
  • Copy-pasting colors one by one
  • Guessing font families and sizes
  • Missing semantic meaning of colors

With ThemeContext

  • Instant extraction of all design tokens
  • AI-identified semantic colors (primary, secondary, background, text)
  • Complete typography scale with font families and weights
  • Ready-to-use code in your preferred format

Quick Start

Start extracting design tokens in minutes.

Using the Web Interface

The easiest way to get started is through our web interface:

  1. Visit themecontext.com
  2. Enter a website URL (e.g., https://stripe.com)
  3. Click "Extract" and wait for the analysis
  4. Browse colors, typography, and spacing
  5. Download as ZIP or copy code snippets

Using the API

For programmatic access, use our REST API:

cURL
curl -X POST https://themecontext.com/api/extract \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{"url": "https://stripe.com"}'

Using with AI Assistants

ThemeContext integrates natively with AI coding assistants via MCP:

Claude Code / Cursor
# In your AI assistant prompt:
"Extract the design theme from stripe.com using ThemeContext"

# The assistant will use the MCP tools to:
# 1. Check if the theme already exists
# 2. Extract new theme if needed
# 3. Return formatted design tokens
Pro Tip

Use the "use themecontext" phrase in your prompts to ensure your AI assistant uses the MCP integration for up-to-date design tokens.

Authentication

Secure your API access with API keys.

Getting an API Key

  1. Sign in at themecontext.com/dashboard
  2. Navigate to the API Keys section
  3. Click "New Key" to generate a new API key
  4. Copy and securely store your key
Keep your API key secret

Never expose your API key in client-side code or public repositories. Use environment variables.

Using Your API Key

Include your API key in the X-API-Key header:

HTTP Header
X-API-Key: tc_your_api_key_here

Example Request

JavaScript (fetch)
const response = await fetch('https://themecontext.com/api/extract', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': process.env.THEMECONTEXT_API_KEY,
  },
  body: JSON.stringify({ url: 'https://example.com' }),
});

const theme = await response.json();

Multiple API Keys

You can create multiple API keys for different purposes:

  • Development - For local development and testing
  • Production - For your production applications
  • CI/CD - For automated pipelines

Each key tracks its own usage statistics, making it easy to monitor consumption per environment.

Extract Theme API

Extract design tokens from any website URL.

POST /api/extract Requires API Key

Extracts design tokens (colors, typography, spacing) from the specified URL using AI analysis.

Request Body

  • url string required The website URL to extract the theme from
  • options.formats array Output formats: "json", "css", "tailwind". Default: ["json"]
  • options.timeout number Extraction timeout in ms (1000-120000). Default: 30000

Example Request

cURL
curl -X POST https://themecontext.com/api/extract \
  -H "Content-Type: application/json" \
  -H "X-API-Key: tc_your_api_key" \
  -d '{
    "url": "https://stripe.com",
    "options": {
      "formats": ["json", "css", "tailwind"]
    }
  }'

Example Response

JSON Response
{
  "success": true,
  "domain": "stripe.com",
  "extractedAt": "2026-01-24T10:30:00.000Z",
  "data": {
    "json": {
      "colors": {
        "semantic": {
          "primary": "#635bff",
          "secondary": "#0a2540",
          "background": ["#ffffff", "#f6f9fc"],
          "text": ["#0a2540", "#425466"]
        },
        "all": ["#635bff", "#0a2540", ...]
      },
      "typography": {
        "fonts": {
          "primary": "Söhne",
          "families": ["Söhne", "system-ui"]
        },
        "sizes": ["14px", "16px", "24px", "48px"],
        "weights": ["400", "500", "600"]
      }
    },
    "css": ":root { --color-primary: #635bff; ... }",
    "tailwind": { "theme": { "extend": { ... } } }
  }
}

Extractions API

Search, retrieve, and manage stored theme extractions.

GET /api/extractions Public

List and search all stored extractions.

Query Parameters

  • q string Search query to filter by domain
  • limit number Results per page (max 100). Default: 20
  • offset number Pagination offset. Default: 0
GET /api/extractions/popular Public

Get most viewed extractions.

GET /api/extractions/trending Public

Get trending extractions (recently popular).

GET /api/extractions/recent Public

Get most recent extractions.

GET /api/extractions/domain/:domain Public

Get extraction by domain name.

URL Parameters

  • domain string required Domain name (e.g., "stripe.com")
GET /api/extractions/check/:domain Public

Check if a domain has been extracted.

GET /api/extractions/:id Public

Get extraction by ID.

Queue API

Manage the extraction processing queue.

POST /api/queue Public

Add a URL to the extraction queue for background processing.

Request Body

  • url string required Website URL to extract
  • priority number Queue priority (0-10). Higher = processed first
  • force boolean Re-extract even if domain exists
GET /api/queue Public

List queue items with optional status filter.

Query Parameters

  • status string Filter: pending, processing, completed, failed
GET /api/queue/stats Public

Get queue statistics (pending, processing, completed counts).

GET /api/queue/check/:domain Public

Check queue status for a specific domain.

Download API

Download complete theme packages as ZIP files.

GET /api/download/domain/:domain Public

Download theme package by domain name.

GET /api/download/:id Public

Download theme package by extraction ID.

ZIP Contents

The downloaded ZIP file contains:

File Description
THEME_GUIDE.md AI-generated human-readable design system documentation
README.md Quick start guide with usage examples
theme.css CSS custom properties (variables)
theme.scss SCSS variables
theme.ts TypeScript/CSS-in-JS theme object
theme.json Raw JSON theme data
tailwind.config.js Tailwind CSS configuration

MCP Server

Model Context Protocol integration for AI coding assistants.

ThemeContext provides an MCP server that enables AI assistants like Claude Code, Cursor, and Windsurf to directly access design tokens while coding.

What is MCP?

The Model Context Protocol (MCP) is a standard for connecting AI assistants to external data sources and tools. With ThemeContext's MCP server, you can:

  • Ask your AI assistant to "get the Stripe design theme"
  • Automatically apply design tokens to your code
  • Extract themes from new websites on demand
  • Get always up-to-date design system information
Use "use themecontext" in prompts

Include "use themecontext" in your prompts to ensure your AI uses the MCP integration for up-to-date design tokens instead of hallucinating values.

MCP Installation

Set up ThemeContext MCP server in your AI assistant.

Claude Code

Add to your Claude Code MCP configuration:

~/.claude/claude_desktop_config.json
{
  "mcpServers": {
    "themecontext": {
      "command": "npx",
      "args": ["-y", "themecontext-mcp"],
      "env": {
        "THEMECONTEXT_API_KEY": "tc_your_api_key"
      }
    }
  }
}

Cursor

Add to your Cursor MCP settings:

~/.cursor/mcp.json
{
  "mcpServers": {
    "themecontext": {
      "command": "npx",
      "args": ["-y", "themecontext-mcp"],
      "env": {
        "THEMECONTEXT_API_KEY": "tc_your_api_key"
      }
    }
  }
}

Windsurf

Add to your Windsurf configuration:

~/.windsurf/mcp_config.json
{
  "mcpServers": {
    "themecontext": {
      "command": "npx",
      "args": ["-y", "themecontext-mcp"],
      "env": {
        "THEMECONTEXT_API_KEY": "tc_your_api_key"
      }
    }
  }
}
Get your API key

Sign in to your dashboard to generate an API key for MCP integration.

MCP Tools Reference

Available tools in the ThemeContext MCP server.

TOOL get_theme

Retrieve design tokens for a website domain.

Parameters

  • domain string required Website domain (e.g., "stripe.com")
  • format string Output format: "json", "css", "tailwind"
TOOL extract_theme

Extract theme from a new website URL.

Parameters

  • url string required Full website URL to extract from
TOOL search_themes

Search for existing extracted themes.

Parameters

  • query string required Search query (matches domain names)
TOOL check_theme_exists

Check if a theme has already been extracted for a domain.

Parameters

  • domain string required Domain to check

Example Usage

AI Assistant Prompt
# Get existing theme
"Use themecontext to get the Stripe design theme and apply it to my button component"

# Extract new theme
"Extract the design theme from linear.app using themecontext"

# Search themes
"Search themecontext for tech company design themes"

Response Format

Understanding the theme data structure.

JSON Theme Structure

theme.json
{
  "colors": {
    "semantic": {
      "primary": "#635bff",
      "secondary": "#0a2540",
      "accent": "#00d4ff",
      "background": ["#ffffff", "#f6f9fc", "#0a2540"],
      "text": ["#0a2540", "#425466", "#697386"],
      "border": ["#e6ebf1", "#c4c9d4"]
    },
    "all": ["#635bff", "#0a2540", ...]
  },
  "typography": {
    "fonts": {
      "primary": "Söhne",
      "secondary": "system-ui",
      "families": ["Söhne", "system-ui", "sans-serif"]
    },
    "sizes": [
      { "value": "14px", "usage": "body" },
      { "value": "16px", "usage": "body-lg" },
      { "value": "24px", "usage": "heading" }
    ],
    "weights": ["400", "500", "600", "700"]
  },
  "spacing": {
    "scale": ["4px", "8px", "12px", "16px", "24px", "32px", "48px"]
  },
  "borders": {
    "radii": ["4px", "8px", "12px", "9999px"]
  },
  "shadows": {
    "values": [
      "0 2px 4px rgba(0,0,0,0.1)",
      "0 4px 12px rgba(0,0,0,0.15)"
    ]
  }
}

Semantic Colors

Property Type Description
primary string Main brand/action color
secondary string Secondary brand color
accent string Highlight/accent color
background array Background colors (light to dark)
text array Text colors (primary to muted)
border array Border colors

Rate Limits

API usage limits and best practices.

Endpoint Rate Limit Window
POST /api/extract 10 requests per minute
GET /api/extractions/* 100 requests per minute
GET /api/download/* 30 requests per minute
POST /api/queue 20 requests per minute

Rate Limit Headers

Responses include rate limit information in headers:

Response Headers
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 7
X-RateLimit-Reset: 1706097600

Best Practices

  • Cache extracted themes locally to reduce API calls
  • Use the /api/extractions/check/:domain endpoint before extracting
  • Implement exponential backoff for retries
  • Use the queue API for bulk extractions

Troubleshooting

Common issues and solutions.

Authentication Errors

401 - Missing API Key

Include your API key in the X-API-Key header:

curl -H "X-API-Key: tc_your_api_key" ...

401 - Invalid API Key

Verify your API key in the dashboard. Keys start with tc_.

Extraction Errors

Timeout Errors

Some websites take longer to load. Increase the timeout:

{
  "url": "https://example.com",
  "options": { "timeout": 60000 }
}

Website Blocked

Some websites block automated access. Try:

  • Using a different page on the site
  • Adding the URL to the queue for background processing
  • Contacting us for enterprise solutions

MCP Issues

Tools Not Showing

Restart your AI assistant after updating MCP configuration.

API Key Not Working

Ensure the THEMECONTEXT_API_KEY environment variable is set correctly in your MCP config.

Getting Help

If you're still having issues: