Home For You Tutorials Claw
📡 API Reference v2.0.0

API Reference

Complete API documentation for UX Master. CLI, MCP Server, Python SDK, Validation Engine, and Harvester API.

CLI API

Command-line interface for UX Master.

uxm init

Install UX-Master skill for AI assistants.

Bash
uxm init --ai <platform> [options]

Options

OptionDescriptionDefault
--ai, -aTarget AI platform (required)-
--global, -gInstall to global configfalse
--force, -fOverwrite existing filesfalse

Supported Platforms

  • claude - Claude Code
  • cursor - Cursor IDE
  • windsurf - Windsurf IDE
  • vscode - VS Code MCP
  • figma - Figma Plugin
  • all - All platforms

Example

# Install for Claude Code
uxm init --ai claude

# Install globally with force
uxm init --ai claude --global --force

Search UX-Master knowledge base.

Bash
uxm search <query> [options]

Options

OptionDescriptionDefault
--domain, -dSearch domain-
--stack, -sTechnology stack-
--max-results, -nMax results3
--design-system, -dsGenerate design systemfalse

uxm validate

Validate UI against 37 Design Tests.

Bash
uxm validate <target> [options]

Test Suites

  • all - All 37 tests
  • mobile - Mobile-specific (7 tests)
  • landing - Landing page (6 tests)
  • dashboard - Dashboard (6 tests)
  • a11y - Accessibility (5 tests)

Output Formats

  • rich - Terminal with colors
  • json - JSON output
  • markdown - Markdown report
  • html - HTML dashboard

Example

# Validate HTML file
uxm validate index.html --suite mobile

# Validate URL
uxm validate https://stripe.com --url --suite all

# Generate HTML report
uxm validate index.html --format html --output report.html

uxm extract

Extract design system from website.

Bash
uxm extract <url> [options]

Example

# Extract to JSON
uxm extract https://stripe.com --output stripe.json

# Export to Figma
uxm extract https://linear.app --figma

# Deep crawl with screenshots
uxm extract https://vercel.com --depth 2 --screenshots

MCP Server API

Model Context Protocol server for AI assistants.

Base URL: http://localhost:3000

Authentication: None required for local development

Available Tools

search_ux_laws

Search 48 UX Laws for psychology-driven design.

POST /mcp/v1/tools/call
{
  "name": "search_ux_laws",
  "arguments": {
    "query": "mobile touch targets",
    "product_type": "mobile",
    "max_results": 5
  }
}

validate_design

Validate UI code against 37 Design Tests.

POST /mcp/v1/tools/call
{
  "name": "validate_design",
  "arguments": {
    "html": "<button style='width: 100px'>Click</button>",
    "css": "button { padding: 10px; }",
    "test_suite": "all"
  }
}

extract_design_system

Extract design system from website using Harvester v4.

POST /mcp/v1/tools/call
{
  "name": "extract_design_system",
  "arguments": {
    "url": "https://stripe.com",
    "depth": 1,
    "include_screenshots": false
  }
}

Python SDK

Validation Engine

Python
from validation_engine import ValidationEngine

# Create engine
engine = ValidationEngine()

# Load harvester data
with open('harvest.json') as f:
    data = json.load(f)

# Run validation
report = engine.validate(data, test_suite='all')

# Check results
print(f"Score: {report.score}/100")
print(f"Passed: {report.passed_count}/{report.total_count}")

Search Engine

Python
from search_engine import SearchEngine

engine = SearchEngine()

# Search UX Laws
results = engine.search(
    query="mobile touch targets",
    domain="ux-laws",
    max_results=5
)

# Generate design system
system = engine.generate_design_system(
    query="fintech dashboard",
    project_name="MyApp"
)

Validation Engine

Test Categories

Mobile Tests (7)

IDNameSeverityCheck
DT-MOB-001Fitts's LawCriticalTouch targets ≥ 44px
DT-MOB-002Thumb ZoneHighActions in bottom 25%
DT-MOB-003Touch FeedbackHighHover/active states

Landing Page Tests (6)

IDNameSeverityCheck
DT-LND-001Hero ClarityCriticalValue prop in 5 sec
DT-LND-002CTA ProminenceCriticalVisual dominance
DT-LND-003Social ProofHighAbove the fold

Accessibility Tests (5)

IDNameSeverityCheck
DT-A11-001Focus StatesCriticalVisible focus
DT-A11-002Input LabelsCriticalAssociated labels
DT-A11-003ARIA UsageHighProper attributes

Harvester API

Browser Injection

JavaScript
// Inject harvester_v4.js into browser console
const harvester = document.createElement('script');
harvester.src = 'https://ux-master.todyai.io/harvester_v4.js';
document.head.appendChild(harvester);

// Run extraction
const data = window.UXMasterHarvester.extract();
console.log(JSON.stringify(data, null, 2));

Python API

Python
from harvester_browser import BrowserHarvester

harvester = BrowserHarvester()

# Harvest single page
result = harvester.harvest("https://example.com")

if result["success"]:
    data = result["data"]
    print(f"Extracted {len(data['components']['blueprints'])} components")

Output Format

JSON
{
  "_version": 4,
  "meta": {
    "url": "https://example.com",
    "title": "Page Title",
    "pageType": "dashboard",
    "timestamp": "2024-01-01T00:00:00Z"
  },
  "visualAnalysis": {
    "colors": {
      "semantic": {...},
      "neutrals": {...}
    },
    "typography": {...},
    "layout": {...},
    "spacing": {...}
  },
  "components": {
    "blueprints": {...}
  }
}

Error Codes

CodeMeaningResolution
400Bad RequestCheck parameters
404Not FoundCheck URL/file path
422Validation ErrorCheck input format
500Server ErrorCheck logs
503Service UnavailableMCP server not running

🚀 Ready to build?

Start with our tutorials or explore the Harvester v4 documentation.