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.
Clone the repository
Install dependencies:
npm install
Set up environment variables:
cp .env.example .env
Then edit the .env
file with your database credentials
Set up the database:
node scripts/setup-db.js
Build the TypeScript code:
npm run build
You can run the server in two different modes:
npm start
npm run start:http
The HTTP server provides:
/sse
for real-time updates/messages
for sending commands/health
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 |
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 |
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) |
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'
}
});
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.
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.
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"
]
}
}
}
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.
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.