Sponsored by Deepsite.site

Popmelt MCP Server

Created By
MCP-Mirror10 months ago
Mirror of
Content

Popmelt MCP Server

An MCP (Model Context Protocol) server for Popmelt, providing access to Talent AI and Taste Profiles for dynamic UI component styling.

Overview

The Popmelt MCP Server leverages the Model Context Protocol to expose Talent AI profiles and styling capabilities to LLMs and other applications. It connects directly to Popmelt's PostgreSQL database to access and serve detailed Talent profiles, including structured metadata and weighted styling attributes.

Features

  • Talent AI Profile Access: Retrieve complete Talent profiles with their unique aesthetic characteristics and design attributes
  • CSS Styling Generation: Generate CSS styling rules directly from stored metadata
  • Dynamic UI Component Styling: Easily integrate Talent-driven design choices into your UI components
  • Database Integration: Direct connection to PostgreSQL database where Talent profiles are stored
  • Multiple Transport Options: Run the server using stdio for command-line tools or HTTP with SSE for remote servers

Project Structure

popmelt-mcp-server/
├── src/                         # Source code
│   ├── db/                      # Database access layer
│   │   └── index.ts             # Database connection and query functions
│   ├── utils/                   # Utility modules
│   │   └── css-generator.ts     # CSS generation utilities
│   ├── mcp-server.ts            # MCP server core implementation
│   ├── server.ts                # Stdio transport server
│   └── http-server.ts           # HTTP/SSE transport server
├── scripts/                     # Helper scripts
│   ├── setup-db.sql             # SQL for setting up the database
│   └── setup-db.js              # Script to run the SQL setup
├── examples/                    # Example client usage
│   └── generate-css.js          # Example script to generate CSS
├── dist/                        # Compiled TypeScript output
├── package.json                 # Project configuration
└── tsconfig.json                # TypeScript configuration

Database Schema

The Popmelt MCP Server uses a PostgreSQL database with the following schema:

CREATE TABLE talents (
  id VARCHAR(50) PRIMARY KEY,
  name VARCHAR(100) NOT NULL,
  description TEXT,
  created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
  metadata JSONB NOT NULL
);

Where the metadata JSON field has the following structure:

{
  "aesthetic_characteristics": {
    "style": "minimalist",
    "mood": "calm",
    "complexity": 2,
    "minimalism": 9,
    "boldness": 3,
    "playfulness": 2,
    "elegance": 8
  },
  "design_attributes": {
    "whitespace_balance": 9,
    "color_harmony": 7,
    "visual_rhythm": 6,
    "layout_density": 2,
    "texture_use": 1,
    "border_use": 2,
    "shadow_use": 3
  },
  "color_palette": {
    "primary": "#2D3748",
    "secondary": "#4A5568",
    "accent": "#38B2AC",
    "background": "#FFFFFF",
    "text": "#1A202C"
  },
  "typography": {
    "headingFont": "Inter, sans-serif",
    "bodyFont": "Inter, sans-serif",
    "scale": 1.2,
    "weight": "light",
    "letterSpacing": 0.02,
    "lineHeight": 1.5
  }
}

Getting Started

Prerequisites

  • Node.js 18 or higher
  • PostgreSQL database

Installation

  1. Clone this repository
  2. Install dependencies:
    npm install
    
  3. Copy the example environment file and update with your database details:
    cp .env.example .env
    
  4. Set up the database:
    node scripts/setup-db.js
    
  5. Build the TypeScript code:
    npm run build
    

Running the Server

Two server modes are available:

  1. Standard stdio mode (for command-line tools and direct integration):
npm start
  1. HTTP server with SSE support (for remote access and web integration):
npm run start:http

The HTTP server provides:

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

API Reference

Resources

The server exposes the following MCP resources:

Resource URIDescription
talent://listList all available talent profiles
talent://{id}Get a specific talent profile by ID
talent-attribute://{id}/{attribute}Get a specific attribute of a talent (supports dot notation for nested properties)
component-style://{talent_id}/{component_name}Get CSS for a specific component using a talent profile

Tools

The server provides the following MCP tools:

Tool NameDescriptionArguments
generate-cssGenerate CSS for a component based on a talent profiletalentId, component, state (optional), customProperties (optional)
generate-component-libraryGenerate CSS for a complete component librarytalentId
query-talentsPerform a read-only query on talent metadatafilters
analyze-style-compatibilityAnalyze compatibility between different talent stylestalentId1, talentId2

Prompts

The server offers the following MCP prompts:

Prompt NameDescriptionArguments
style-componentLLM prompt for styling a componenttalentId, component, requirements (optional)
create-talent-descriptionLLM prompt for creating a descriptive summary of a talenttalentId
recommend-talentLLM prompt for recommending talents based on requirementsprojectType, brandPersonality, targetAudience, aestheticPreferences (optional)

Example Usage

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

node examples/generate-css.js

This example script demonstrates how to use the MCP client to generate CSS for all available talents and analyze compatibility between two talents.

Development

Building the Project

npm run build

Running in Development Mode

npm run dev

License

MIT

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
ChatWiseThe second fastest AI chatbot™
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
CursorThe AI Code Editor
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Amap Maps高德地图官方 MCP Server
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
WindsurfThe new purpose-built IDE to harness magic
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Serper MCP ServerA Serper MCP Server
DeepChatYour AI Partner on Desktop
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Playwright McpPlaywright MCP server
Tavily Mcp
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.