Popmelt CSS Generator MCP server

Generates component-specific CSS and complete component libraries based on distinct talent profiles with unique aesthetic characteristics for consistent visual design systems
Back to servers
Provider
Popmelt
Release date
Mar 19, 2025
Language
TypeScript

The Popmelt MCP Server provides access to Talent AI profiles and styling capabilities for dynamic UI component styling through the Model Context Protocol. It connects to a PostgreSQL database to serve detailed talent profiles, including structured metadata and weighted styling attributes that can be used to generate CSS styling rules.

Prerequisites

  • Node.js 18 or higher
  • PostgreSQL database

Installation

  1. Clone the repository

  2. Install dependencies:

    npm install
    
  3. Set up environment variables:

    cp .env.example .env
    

    Then edit the .env file with your database credentials

  4. Set up the database:

    node scripts/setup-db.js
    
  5. Build the TypeScript code:

    npm run build
    

Running the Server

You can run the server in two different modes:

Standard stdio mode (for command-line tools)

npm start

HTTP server with SSE support (for remote access)

npm run start:http

The HTTP server provides:

  • SSE endpoint at /sse for real-time updates
  • POST endpoint at /messages for sending commands
  • Health check endpoint at /health

Available Resources

The server exposes these MCP resources:

Resource URI Description
talent://list List all available talent profiles
talent://{id} Get a specific talent profile by ID
talent-attribute://{id}/{attribute} Get a specific attribute of a talent
component-style://{talent_id}/{component_name} Get CSS for a component using a talent profile

Available Tools

Tool Name Description Arguments
generate-css Generate CSS for a component talentId, component, state (optional), customProperties (optional)
generate-component-library Generate CSS for a complete library talentId
query-talents Query talent metadata filters
analyze-style-compatibility Analyze talent style compatibility talentId1, talentId2

Available Prompts

Prompt Name Description Arguments
style-component LLM prompt for styling a component talentId, component, requirements (optional)
create-talent-description Create a descriptive talent summary talentId
recommend-talent Recommend talents based on requirements projectType, brandPersonality, targetAudience, aestheticPreferences (optional)

Usage Examples

Using the MCP Client

import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';

// Create transport
const transport = new StdioClientTransport({
  command: 'node',
  args: ['dist/server.js']
});

// Create client
const client = new Client(
  { name: 'example-client', version: '1.0.0' },
  { capabilities: { resources: {}, tools: {} } }
);

// Connect to server
await client.connect(transport);

// List all talents
const talents = await client.listResources('talent://');

// Get a specific talent
const talent = await client.readResource('talent://modern-minimalist');

// Generate CSS for a button
const css = await client.callTool({
  name: 'generate-css',
  arguments: {
    talentId: 'modern-minimalist',
    component: 'button',
    state: 'hover'
  }
});

// Analyze compatibility between two talents
const compatibility = await client.callTool({
  name: 'analyze-style-compatibility',
  arguments: {
    talentId1: 'modern-minimalist',
    talentId2: 'bold-vibrant'
  }
});

Running the Example Script

To quickly test functionality, run the included example:

node examples/generate-css.js

This script demonstrates generating CSS for available talents and analyzing compatibility between talent styles.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later