Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e506853
Add Slides MCP - AI-powered presentation builder
vibegui Jan 22, 2026
1ba0c68
feat(slides): Add brand research, MCP Apps UI, and documentation
vibegui Jan 24, 2026
6e1f60e
feat(mcp-apps-testbed): add MCP Apps testbed server
vibegui Jan 24, 2026
c14bc93
feat: Add Brand MCP - AI-powered brand research & design system gener…
vibegui Jan 25, 2026
472e60e
fix(brand): Improve server logging and set port to 8003
vibegui Jan 25, 2026
ed67b7d
fix(slides): Improve server logging and startup messages
vibegui Jan 25, 2026
5f4805f
fix(brand,slides): Use inline binding schemas for Perplexity/Firecrawl
vibegui Jan 25, 2026
1a73ec2
fix(slides): Change default port to 8004
vibegui Jan 25, 2026
1e321e5
Remove testbed
vibegui Jan 25, 2026
74cec83
refactor(slides): Remove brand research, add Brand MCP binding
vibegui Jan 25, 2026
222dd01
fix(brand,slides): Use correct tool names in binding schemas
vibegui Jan 25, 2026
5492993
fix(brand,slides): Match binding schemas to actual tool definitions
vibegui Jan 26, 2026
b82552c
fix(brand): Use correct perplexity tool names and multi-element binding
vibegui Jan 26, 2026
f0d5f36
fix(brand): Use permissive binding schema for any Perplexity MCP
vibegui Jan 26, 2026
19b4409
refactor(brand,slides): Use generic binding type matched by tool format
vibegui Jan 26, 2026
5172eee
refactor(brand,slides): Use BindingOf with Registry like mcp-studio
vibegui Jan 26, 2026
aeca62b
simplify(brand,slides): Use BindingOf directly like mcp-studio
vibegui Jan 26, 2026
a69e5d5
feat(shared): Add @deco/perplexity to Registry
vibegui Jan 26, 2026
a2ae9bb
rename: @deco/perplexity -> @deco/perplexity-ai
vibegui Jan 26, 2026
7a4ad92
refactor(brand): Use @deco/firecrawl binding instead of @deco/scraper
vibegui Jan 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
221 changes: 221 additions & 0 deletions brand/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
# Brand MCP

AI-powered brand research and design system generator. Automatically discover brand identity from websites and generate complete design systems.

## Features

- **Website Scraping** - Extract colors, fonts, logos directly from websites using Firecrawl
- **AI Research** - Deep brand research using Perplexity AI
- **Design System Generation** - CSS variables, JSX components, markdown style guides
- **MCP Apps UI** - Interactive brand previews in Mesh admin
- **One-Step Creation** - Full workflow from URL to complete design system

## Quick Start

```bash
# Start the server
bun run dev

# The MCP will be available at:
# http://localhost:8001/mcp
```

## Required Bindings

Configure at least one binding for brand research:

### Firecrawl (`@deco/firecrawl`)
- Extract colors from website CSS
- Identify typography and fonts
- Find logo images in page source
- Capture visual style and aesthetics
- Take screenshots

### Perplexity (`@deco/perplexity`)
- Research brand history and background
- Find brand guidelines and press kits
- Discover logo URLs and assets
- Analyze brand voice and personality
- Find color palettes from various sources

## Tools

### Research Tools

| Tool | Description |
|------|-------------|
| `BRAND_SCRAPE` | Scrape a website to extract brand identity using Firecrawl |
| `BRAND_RESEARCH` | Deep research on a brand using Perplexity AI |
| `BRAND_DISCOVER` | Combined scraping + research for complete identity |
| `BRAND_STATUS` | Check available research capabilities |

### Generator Tools

| Tool | Description |
|------|-------------|
| `BRAND_GENERATE` | Generate design system from brand identity |
| `BRAND_CREATE` | Full workflow: discover + generate in one step |

## MCP Apps (UI Resources)

| Resource URI | Description |
|--------------|-------------|
| `ui://brand-preview` | Interactive brand identity preview |
| `ui://brand-list` | Grid view of all created brands |

## Workflow

### Quick: One-Step Brand Creation

```
BRAND_CREATE(brandName: "Acme Corp", websiteUrl: "https://acme.com")
```

Returns:
- Complete brand identity object
- CSS variables file
- JSX design system
- Markdown style guide

### Detailed: Step-by-Step

1. **Check Status**
```
BRAND_STATUS()
```
Verify which bindings are available.

2. **Discover Brand**
```
BRAND_DISCOVER(brandName: "Acme", websiteUrl: "https://acme.com")
```
Combines scraping and research for complete identity.

3. **Generate Design System**
```
BRAND_GENERATE(identity: {...}, outputFormat: "all")
```
Creates CSS, JSX, and style guide.

## Output Formats

### CSS Variables

```css
:root {
--brand-primary: #8B5CF6;
--brand-primary-light: #A78BFA;
--brand-secondary: #10B981;
--bg-dark: #1a1a1a;
--font-heading: 'Inter', system-ui, sans-serif;
/* ... */
}
```

### JSX Design System

```jsx
// Brand configuration
const BRAND = {
name: "Acme Corp",
colors: { primary: "#8B5CF6", ... },
logos: { primary: "https://...", ... },
};

// Components
function BrandLogo({ variant, height }) { ... }
function Heading({ level, children }) { ... }
function Button({ variant, children }) { ... }
function Card({ children }) { ... }
```

### Markdown Style Guide

Complete documentation including:
- Color palette with hex codes
- Typography specifications
- Logo usage guidelines
- Visual style rules
- Brand voice description

## Brand Identity Schema

```typescript
interface BrandIdentity {
name: string;
tagline?: string;
description?: string;
industry?: string;

colors: {
primary: string; // Main brand color
secondary?: string; // Supporting color
accent?: string; // Highlight color
background?: string; // Background color
text?: string; // Text color
palette?: string[]; // Full palette
};

logos?: {
primary?: string; // Main logo URL
light?: string; // For dark backgrounds
dark?: string; // For light backgrounds
icon?: string; // Square icon
};

typography?: {
headingFont?: string;
bodyFont?: string;
monoFont?: string;
};

style?: {
aesthetic?: string; // e.g., "modern", "minimal"
mood?: string; // e.g., "professional", "playful"
keywords?: string[];
};

voice?: {
tone?: string;
personality?: string[];
values?: string[];
};

confidence: "high" | "medium" | "low";
sources: string[];
}
```

## Integration with Slides MCP

The Brand MCP is designed to work seamlessly with the Slides MCP:

1. Create a brand with `BRAND_CREATE`
2. Use the generated identity with Slides' `DECK_INIT`
3. The design system JSX can be used directly

## Development

```bash
# Install dependencies
bun install

# Run development server
bun run dev

# Type check
bun run check

# Build for production
bun run build
```

## Configuration

| Variable | Default | Description |
|----------|---------|-------------|
| `PORT` | `8001` | Server port |

## License

MIT
29 changes: 29 additions & 0 deletions brand/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "@decocms/brand",
"version": "1.0.0",
"description": "AI-powered brand research and design system generator",
"private": true,
"type": "module",
"scripts": {
"dev": "bun run --hot server/main.ts",
"build:server": "NODE_ENV=production bun build server/main.ts --target=bun --outfile=dist/server/main.js",
"build": "bun run build:server",
"check": "tsc --noEmit"
},
"exports": {
"./tools": "./server/tools/index.ts"
},
"dependencies": {
"@decocms/bindings": "^1.0.9",
"@decocms/runtime": "1.2.0",
"zod": "^4.0.0"
},
"devDependencies": {
"@decocms/mcps-shared": "workspace:*",
"@modelcontextprotocol/sdk": "1.25.1",
"typescript": "^5.7.2"
},
"engines": {
"node": ">=22.0.0"
}
}
119 changes: 119 additions & 0 deletions brand/server/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/**
* Brand MCP - AI-Powered Brand Research & Design System Generator
*
* A complete toolset for discovering brand identity and generating design systems.
*
* ## Features
*
* - **Brand Scraping** - Extract colors, fonts, logos from websites using Firecrawl
* - **Brand Research** - Deep research using Perplexity AI
* - **Design System Generation** - CSS variables, JSX components, style guides
* - **MCP Apps UI** - Interactive brand previews
*
* ## Optional Bindings
*
* Configure for full functionality:
* - **FIRECRAWL** - For website scraping and brand extraction (firecrawl-mcp)
* - **PERPLEXITY** - For AI-powered brand research (@perplexity-ai/mcp-server)
*/
import { withRuntime } from "@decocms/runtime";
import { tools } from "./tools/index.ts";
import { resources } from "./resources/index.ts";
import { StateSchema, type Env, type Registry } from "./types/env.ts";

export { StateSchema };

const PORT = process.env.PORT || 8003;
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Default port doesn�t match the documented Brand MCP port (8001). This will make the quick start instructions incorrect unless PORT is set.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At brand/server/main.ts, line 26:

<comment>Default port doesn�t match the documented Brand MCP port (8001). This will make the quick start instructions incorrect unless PORT is set.</comment>

<file context>
@@ -0,0 +1,119 @@
+
+export { StateSchema };
+
+const PORT = process.env.PORT || 8003;
+
+console.log("[brand-mcp] Starting server...");
</file context>
Fix with Cubic


console.log("[brand-mcp] Starting server...");
console.log("[brand-mcp] Port:", PORT);
console.log("[brand-mcp] Tools count:", tools.length);
console.log("[brand-mcp] Resources count:", resources.length);

const runtime = withRuntime<Env, typeof StateSchema, Registry>({
configuration: {
scopes: ["PERPLEXITY::*", "FIRECRAWL::*"],
state: StateSchema,
},
tools,
prompts: [],
resources,
});

console.log("[brand-mcp] Runtime initialized");

/**
* Fetch handler with logging
*/
const fetchWithLogging = async (req: Request): Promise<Response> => {
const url = new URL(req.url);
const startTime = Date.now();

// Log incoming request
if (req.method === "POST" && url.pathname === "/mcp") {
try {
const body = await req.clone().json();
const method = body?.method || "unknown";
const toolName = body?.params?.name;

if (method === "tools/call" && toolName) {
console.log(`[brand-mcp] 🔧 Tool call: ${toolName}`);
} else if (method !== "unknown") {
console.log(`[brand-mcp] 📨 Request: ${method}`);
}
} catch {
// Ignore JSON parse errors
}
}

// Call the runtime
const response = await runtime.fetch(req);

// Log response time for tool calls
const duration = Date.now() - startTime;
if (duration > 100) {
console.log(`[brand-mcp] ⏱️ Response in ${duration}ms`);
}

return response;
};

// Start the server
Bun.serve({
port: PORT,
hostname: "0.0.0.0",
idleTimeout: 0, // Required for SSE
fetch: fetchWithLogging,
development: process.env.NODE_ENV !== "production",
});

console.log("");
console.log("🎨 Brand MCP running at: http://localhost:" + PORT + "/mcp");
console.log("");
console.log("[brand-mcp] Available tools:");
console.log(" - BRAND_SCRAPE - Extract brand identity from websites");
console.log(" - BRAND_RESEARCH - Deep research using Perplexity AI");
console.log(" - BRAND_DISCOVER - Combined scraping + research");
console.log(" - BRAND_STATUS - Check available capabilities");
console.log(" - BRAND_GENERATE - Generate design system from identity");
console.log(" - BRAND_CREATE - Full workflow: discover + generate");
console.log("");
console.log("[brand-mcp] MCP Apps (UI Resources):");
console.log(" - ui://brand-preview - Interactive brand preview");
console.log(" - ui://brand-list - Grid view of brands");
console.log("");
console.log("[brand-mcp] Optional bindings: SCRAPER, PERPLEXITY");

// Copy URL to clipboard on macOS
if (process.platform === "darwin") {
try {
const proc = Bun.spawn(["pbcopy"], {
stdin: "pipe",
});
proc.stdin.write(`http://localhost:${PORT}/mcp`);
proc.stdin.end();
console.log("[brand-mcp] 📋 MCP URL copied to clipboard!");
} catch {
// Ignore clipboard errors
}
}
Loading