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:
- Visit themecontext.com
- Enter a website URL (e.g.,
https://stripe.com) - Click "Extract" and wait for the analysis
- Browse colors, typography, and spacing
- Download as ZIP or copy code snippets
Using the API
For programmatic access, use our REST API:
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:
# 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
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
- Sign in at themecontext.com/dashboard
- Navigate to the API Keys section
- Click "New Key" to generate a new API key
- Copy and securely store your key
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:
X-API-Key: tc_your_api_key_here
Example Request
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.
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 -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
{
"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.
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 most viewed extractions.
Get trending extractions (recently popular).
Get most recent extractions.
Get extraction by domain name.
URL Parameters
- domain string required Domain name (e.g., "stripe.com")
Check if a domain has been extracted.
Get extraction by ID.
Queue API
Manage the extraction processing queue.
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
List queue items with optional status filter.
Query Parameters
- status string Filter: pending, processing, completed, failed
Get queue statistics (pending, processing, completed counts).
Check queue status for a specific domain.
Download API
Download complete theme packages as ZIP files.
Download theme package by domain name.
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
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:
{
"mcpServers": {
"themecontext": {
"command": "npx",
"args": ["-y", "themecontext-mcp"],
"env": {
"THEMECONTEXT_API_KEY": "tc_your_api_key"
}
}
}
}
Cursor
Add to your Cursor MCP settings:
{
"mcpServers": {
"themecontext": {
"command": "npx",
"args": ["-y", "themecontext-mcp"],
"env": {
"THEMECONTEXT_API_KEY": "tc_your_api_key"
}
}
}
}
Windsurf
Add to your Windsurf configuration:
{
"mcpServers": {
"themecontext": {
"command": "npx",
"args": ["-y", "themecontext-mcp"],
"env": {
"THEMECONTEXT_API_KEY": "tc_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.
Retrieve design tokens for a website domain.
Parameters
- domain string required Website domain (e.g., "stripe.com")
- format string Output format: "json", "css", "tailwind"
Extract theme from a new website URL.
Parameters
- url string required Full website URL to extract from
Search for existing extracted themes.
Parameters
- query string required Search query (matches domain names)
Check if a theme has already been extracted for a domain.
Parameters
- domain string required Domain to check
Example Usage
# 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
{
"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:
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/:domainendpoint 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:
- Check the GitHub issues
- Join our Discord community
- Email support@themecontext.com