An open API service indexing awesome lists of open source software.

https://github.com/ben-rogerson/lucky-dev-figma-tailwind


https://github.com/ben-rogerson/lucky-dev-figma-tailwind

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

          

# Lucky Dev - Figma to Tailwind MCP Server

This is a simple MCP server that converts figma designs to tailwind css.

The server grabs figma design code and runs it through an openai prompt to convert it to tailwind css.

The tailwind classes are grabbed from the tailwind config file and the tailwind preset (v3 only for now).

## Get started

You'll need the following:

1. A redis installation - add the url `.env` (eg: `REDIS_URL=redis://127.0.0.1:6379`)
2. An openAI API key - add to `.env` (eg: `OPENAI_API_KEY=sk-...`)
3. A figma API key - add to `.env` (eg: `FIGMA_API_KEY=figd_...`)

Install redis with brew (or however you like) - it's needed for the SSE server:

```sh
brew install redis
# Then start with
npm run redis-foreground
# Feel free to use it in the background too.
```

Run the dev server:

```sh
npm run dev
```

Add the sse server to cursor:

```
{
"mcpServers": {
"lucky-dev-next": {
"command": "npx",
"args": ["mcp-remote", "http://localhost:3000/sse"]
}
}
}
```

Then ask the cursor agent nicely to convert the figma design to tailwind css:

```
Convert this figma design:
@https://www.figma.com/design/7I7OPsHsJoMOhItIUQrrD9/Page?node-id=1-2&t=ZFTC2tIvJYLbhi8x-4
```

You can also use the id directly:

```
Convert the figma design to tailwind css:
7I7OPsHsJoMOhItIUQrrD9
```

Run the inspector (optional), this is useful for debugging:

```sh
npm run inspect
```