flowbite-mcp 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -58
- package/build/index.js +240 -15
- package/data/overview.md +12 -0
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -12,17 +12,23 @@
|
|
|
12
12
|
<a href="https://flowbite.com/docs/getting-started/license/"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License"></a>
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
|
+
[](https://cursor.com/en-US/install-mcp?name=flowbite&config=eyJlbnYiOnsiRklHTUFfQUNDRVNTX1RPS0VOIjoiWU9VUl9QRVJTT05BTF9GSUdNQV9BQ0NFU1NfVE9LRU4ifSwiY29tbWFuZCI6Im5weCAteSBmbG93Yml0ZS1tY3AifQ%3D%3D)
|
|
16
|
+
|
|
15
17
|
An MCP server that enables AI assistants to access the [Flowbite](https://flowbite.com/) library of Tailwind CSS components—including UI elements, forms, typography, and plugins—while offering an intelligent theme generator for creating custom branded designs within AI-driven development environments.
|
|
16
18
|
|
|
17
19
|
## MCP Features
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
21
|
+
### Resources:
|
|
22
|
+
|
|
23
|
+
- **📦 60+ UI Components** - Complete access the [Flowbite Library](https://flowbite.com/docs/getting-started/introduction/) components of buttons, cards, modals, dropdowns, and more
|
|
24
|
+
|
|
25
|
+
### Tools:
|
|
26
|
+
|
|
27
|
+
- **🎯 AI-Powered Theme Generator** - Create custom branded themes from any branded hex color
|
|
28
|
+
- **🎨 [NEW] Figma to Code Generator** - Copy the Figma node url and generate code ([video demo](https://x.com/zoltanszogyenyi/status/1996953610966405547))
|
|
29
|
+
|
|
30
|
+
### Server:
|
|
31
|
+
|
|
26
32
|
- **🌐 Dual Transport Support** - Standard I/O (stdio) for CLI or HTTP Streamable for server deployments
|
|
27
33
|
- **⚡ Production Ready** - Docker support with health checks and monitoring
|
|
28
34
|
- **🎨 Quickstart Guide** - Complete setup and integration documentation
|
|
@@ -44,7 +50,7 @@ npx flowbite-mcp --help
|
|
|
44
50
|
npx flowbite-mcp --mode http --port 3000
|
|
45
51
|
```
|
|
46
52
|
|
|
47
|
-
## Transport Modes
|
|
53
|
+
## Local Transport Modes
|
|
48
54
|
|
|
49
55
|
### Standard I/O (stdio)
|
|
50
56
|
|
|
@@ -54,17 +60,22 @@ The default mode for local development and CLI integrations:
|
|
|
54
60
|
# Start in stdio mode (default)
|
|
55
61
|
node build/index.js
|
|
56
62
|
|
|
57
|
-
# Configure in
|
|
63
|
+
# Configure in MCP client (ie. Cursor, Windsurf, Claude)
|
|
58
64
|
{
|
|
59
65
|
"mcpServers": {
|
|
60
66
|
"flowbite": {
|
|
61
67
|
"command": "node",
|
|
62
|
-
"args": ["/path/to/flowbite-mcp/build/index.js"]
|
|
68
|
+
"args": ["/path/to/flowbite-mcp/build/index.js"],
|
|
69
|
+
"env": {
|
|
70
|
+
"FIGMA_ACCESS_TOKEN": "YOUR_PERSONAL_FIGMA_ACCESS_TOKEN"
|
|
71
|
+
}
|
|
63
72
|
}
|
|
64
73
|
}
|
|
65
74
|
}
|
|
66
75
|
```
|
|
67
76
|
|
|
77
|
+
Learn how to get the [Figma personal access token](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens) to enable the Figma to code generation tool.
|
|
78
|
+
|
|
68
79
|
### HTTP server
|
|
69
80
|
|
|
70
81
|
HTTP-based transport for production and multi-client scenarios:
|
|
@@ -77,6 +88,17 @@ This will make the MCP server available at 'http://localhost:3000/mcp'.
|
|
|
77
88
|
|
|
78
89
|
### Environment variables
|
|
79
90
|
|
|
91
|
+
Currently you only need the Figma personal access token if you want to enable the [Figma to code generation tool](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens). You set this variable in your MCP client configuration file.
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
// other options
|
|
95
|
+
"env": {
|
|
96
|
+
"FIGMA_ACCESS_TOKEN": "YOUR_PERSONAL_FIGMA_ACCESS_TOKEN"
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Hosting variables
|
|
101
|
+
|
|
80
102
|
Configure the server behavior with these environment variables:
|
|
81
103
|
|
|
82
104
|
```bash
|
|
@@ -93,48 +115,23 @@ MCP_HOST=0.0.0.0
|
|
|
93
115
|
MCP_CORS_ORIGINS=http://localhost:3000,https://myapp.com
|
|
94
116
|
```
|
|
95
117
|
|
|
96
|
-
##
|
|
97
|
-
|
|
98
|
-
Make sure that you have the following installed:
|
|
118
|
+
## Integration examples
|
|
99
119
|
|
|
100
|
-
|
|
101
|
-
- Tailwind CSS v4+ (for generated themes)
|
|
102
|
-
|
|
103
|
-
### Local development
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
# Clone the repository
|
|
107
|
-
git clone https://github.com/themesberg/flowbite-mcp.git
|
|
108
|
-
cd flowbite-mcp
|
|
109
|
-
|
|
110
|
-
# Install dependencies
|
|
111
|
-
npm install
|
|
112
|
-
|
|
113
|
-
# Build the project
|
|
114
|
-
npm run build
|
|
115
|
-
|
|
116
|
-
# Run in stdio mode (for Claude Desktop, Cursor)
|
|
117
|
-
npm start
|
|
118
|
-
|
|
119
|
-
# Run inspector
|
|
120
|
-
npm run start inspector
|
|
121
|
-
|
|
122
|
-
# Run in HTTP server mode (for production/multi-client)
|
|
123
|
-
MCP_TRANSPORT_MODE=http npm start
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Integration Examples
|
|
120
|
+
Use the following configuration examples to install the Flowbite MCP server in popular clients such as Cursor, Claude, Windsurf, and more.
|
|
127
121
|
|
|
128
122
|
### Claude desktop
|
|
129
123
|
|
|
130
|
-
|
|
124
|
+
Update the `claude_desktop_config.json` file and add the following configuration:
|
|
131
125
|
|
|
132
126
|
```json
|
|
133
127
|
{
|
|
134
128
|
"mcpServers": {
|
|
135
129
|
"flowbite": {
|
|
136
130
|
"command": "npx",
|
|
137
|
-
"args": ["-y", "flowbite-mcp"]
|
|
131
|
+
"args": ["-y", "flowbite-mcp"],
|
|
132
|
+
"env": {
|
|
133
|
+
"FIGMA_ACCESS_TOKEN": "YOUR_PERSONAL_FIGMA_ACCESS_TOKEN"
|
|
134
|
+
}
|
|
138
135
|
}
|
|
139
136
|
}
|
|
140
137
|
}
|
|
@@ -142,52 +139,69 @@ MCP_TRANSPORT_MODE=http npm start
|
|
|
142
139
|
|
|
143
140
|
### Cursor editor
|
|
144
141
|
|
|
145
|
-
|
|
142
|
+
[](https://cursor.com/en-US/install-mcp?name=flowbite&config=eyJlbnYiOnsiRklHTUFfQUNDRVNTX1RPS0VOIjoiWU9VUl9QRVJTT05BTF9GSUdNQV9BQ0NFU1NfVE9LRU4ifSwiY29tbWFuZCI6Im5weCAteSBmbG93Yml0ZS1tY3AifQ%3D%3D)
|
|
143
|
+
|
|
144
|
+
Update the `mcp.json` file and add the following configuration:
|
|
146
145
|
|
|
147
146
|
```json
|
|
148
147
|
{
|
|
149
148
|
"mcpServers": {
|
|
150
149
|
"flowbite": {
|
|
151
150
|
"command": "npx",
|
|
152
|
-
"args": ["-y", "flowbite-mcp"]
|
|
151
|
+
"args": ["-y", "flowbite-mcp"],
|
|
152
|
+
"env": {
|
|
153
|
+
"FIGMA_ACCESS_TOKEN": "YOUR_PERSONAL_FIGMA_ACCESS_TOKEN"
|
|
154
|
+
}
|
|
153
155
|
}
|
|
154
156
|
}
|
|
155
157
|
}
|
|
156
158
|
```
|
|
157
159
|
|
|
158
|
-
###
|
|
160
|
+
### Windsurf editor
|
|
161
|
+
|
|
162
|
+
Update the `mcp_config.json` file and add the following configuration:
|
|
159
163
|
|
|
160
164
|
```json
|
|
161
165
|
{
|
|
162
|
-
"mcpServers":
|
|
163
|
-
{
|
|
164
|
-
"name": "flowbite",
|
|
166
|
+
"mcpServers": {
|
|
167
|
+
"flowbite": {
|
|
165
168
|
"command": "npx",
|
|
166
|
-
"args": ["-y", "flowbite-mcp"]
|
|
169
|
+
"args": ["-y", "flowbite-mcp"],
|
|
170
|
+
"env": {
|
|
171
|
+
"FIGMA_ACCESS_TOKEN": "YOUR_PERSONAL_FIGMA_ACCESS_TOKEN"
|
|
172
|
+
}
|
|
167
173
|
}
|
|
168
|
-
|
|
174
|
+
}
|
|
169
175
|
}
|
|
170
176
|
```
|
|
171
177
|
|
|
172
|
-
###
|
|
178
|
+
### Glama.ai
|
|
179
|
+
|
|
180
|
+
<a href="https://glama.ai/mcp/servers/@zoltanszogyenyi/flowbite-mcp">
|
|
181
|
+
<img width="380" height="200" src="https://glama.ai/mcp/servers/@zoltanszogyenyi/flowbite-mcp/badge" />
|
|
182
|
+
</a>
|
|
173
183
|
|
|
174
|
-
|
|
184
|
+
### Local development
|
|
175
185
|
|
|
176
186
|
```bash
|
|
187
|
+
# Clone the repository
|
|
188
|
+
git clone https://github.com/themesberg/flowbite-mcp.git
|
|
189
|
+
cd flowbite-mcp
|
|
190
|
+
|
|
177
191
|
# Install dependencies
|
|
178
192
|
npm install
|
|
179
193
|
|
|
180
194
|
# Build the project
|
|
181
195
|
npm run build
|
|
182
196
|
|
|
183
|
-
# Run in stdio mode
|
|
197
|
+
# Run in stdio mode (for Claude Desktop, Cursor)
|
|
184
198
|
npm start
|
|
185
199
|
|
|
186
|
-
# Run
|
|
187
|
-
npm run start
|
|
200
|
+
# Run inspector
|
|
201
|
+
npm run start inspector
|
|
188
202
|
|
|
189
|
-
#
|
|
190
|
-
npm
|
|
203
|
+
# Run in HTTP server mode (for production/multi-client)
|
|
204
|
+
MCP_TRANSPORT_MODE=http npm start
|
|
191
205
|
```
|
|
192
206
|
|
|
193
207
|
### Production deployment (HTTP Mode)
|
|
@@ -318,7 +332,7 @@ This project is licensed under the MIT License License - see the [LICENSE](LICEN
|
|
|
318
332
|
- [x] AI-powered theme generator
|
|
319
333
|
- [x] Dual transport support (stdio + HTTP)
|
|
320
334
|
- [ ] Flowbite Pro blocks integration (with license authentication)
|
|
321
|
-
- [
|
|
335
|
+
- [x] Figma to code conversion tool
|
|
322
336
|
- [ ] Enhanced theme customization options
|
|
323
337
|
- [ ] Component search and filtering
|
|
324
338
|
- [ ] Real-time component preview generation
|
package/build/index.js
CHANGED
|
@@ -551,6 +551,22 @@ const getDataPath = (relativePath) => {
|
|
|
551
551
|
};
|
|
552
552
|
// Function to setup all resources and tools
|
|
553
553
|
const setupServer = (server) => {
|
|
554
|
+
server.resource("flowbite_overview", "flowbite://overview/file", {
|
|
555
|
+
description: "Overview of the Flowbite MCP server and its capabilities.",
|
|
556
|
+
title: "Flowbite Overview",
|
|
557
|
+
mimeType: "text/markdown",
|
|
558
|
+
}, async (uri) => {
|
|
559
|
+
const overviewContent = readFileSync(getDataPath("overview.md"), "utf-8");
|
|
560
|
+
return {
|
|
561
|
+
contents: [
|
|
562
|
+
{
|
|
563
|
+
uri: uri.href,
|
|
564
|
+
text: overviewContent,
|
|
565
|
+
mimeType: "text/markdown",
|
|
566
|
+
},
|
|
567
|
+
],
|
|
568
|
+
};
|
|
569
|
+
});
|
|
554
570
|
server.resource("flowbite_theme", "flowbite://theme/file", {
|
|
555
571
|
description: "The theme file that sets the Tailwind CSS variables to make UI look unique for every website.",
|
|
556
572
|
title: "Flowbite Theme",
|
|
@@ -615,41 +631,250 @@ const setupServer = (server) => {
|
|
|
615
631
|
};
|
|
616
632
|
});
|
|
617
633
|
});
|
|
618
|
-
server.tool('convert-figma-to-code', '
|
|
619
|
-
figmaNodeUrl: z.string().describe('The URL of the Figma node
|
|
634
|
+
server.tool('convert-figma-to-code', 'Fetches a Figma node and its rendered image from the Figma API and converts it to a code block. Requires FIGMA_ACCESS_TOKEN environment variable to be set.', {
|
|
635
|
+
figmaNodeUrl: z.string().describe('The URL of the Figma node (e.g., https://www.figma.com/design/fileKey/fileName?node-id=123-456)'),
|
|
620
636
|
}, async ({ figmaNodeUrl }) => {
|
|
621
637
|
try {
|
|
638
|
+
// Get Figma access token from environment variables
|
|
639
|
+
const figmaAccessToken = process.env.FIGMA_ACCESS_TOKEN;
|
|
640
|
+
if (!figmaAccessToken) {
|
|
641
|
+
return {
|
|
642
|
+
content: [
|
|
643
|
+
{
|
|
644
|
+
type: 'text',
|
|
645
|
+
text: `Error: FIGMA_ACCESS_TOKEN environment variable is not set.
|
|
646
|
+
|
|
647
|
+
To use this tool, you need to:
|
|
648
|
+
1. Generate a Personal Access Token from Figma:
|
|
649
|
+
- Go to Figma > Settings > Account > Personal access tokens
|
|
650
|
+
- Generate a new token
|
|
651
|
+
2. Set the FIGMA_ACCESS_TOKEN environment variable with your token
|
|
652
|
+
|
|
653
|
+
Example for your MCP config:
|
|
654
|
+
{
|
|
655
|
+
"env": {
|
|
656
|
+
"FIGMA_ACCESS_TOKEN": "your-personal-access-token"
|
|
657
|
+
}
|
|
658
|
+
}`,
|
|
659
|
+
},
|
|
660
|
+
],
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
// Parse Figma URL to extract fileKey and nodeId
|
|
664
|
+
// URL formats:
|
|
665
|
+
// https://www.figma.com/file/{fileKey}/{fileName}?node-id={nodeId}
|
|
666
|
+
// https://www.figma.com/design/{fileKey}/{fileName}?node-id={nodeId}
|
|
667
|
+
const urlPattern = /figma\.com\/(file|design)\/([a-zA-Z0-9]+)(?:\/[^?]*)?(?:\?.*node-id=([^&]+))?/;
|
|
668
|
+
const match = figmaNodeUrl.match(urlPattern);
|
|
669
|
+
if (!match) {
|
|
670
|
+
return {
|
|
671
|
+
content: [
|
|
672
|
+
{
|
|
673
|
+
type: 'text',
|
|
674
|
+
text: `Error: Invalid Figma URL format.
|
|
675
|
+
|
|
676
|
+
Expected formats:
|
|
677
|
+
- https://www.figma.com/file/{fileKey}/{fileName}?node-id={nodeId}
|
|
678
|
+
- https://www.figma.com/design/{fileKey}/{fileName}?node-id={nodeId}
|
|
679
|
+
|
|
680
|
+
Provided URL: ${figmaNodeUrl}`,
|
|
681
|
+
},
|
|
682
|
+
],
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
const fileKey = match[2];
|
|
686
|
+
const nodeId = match[3] ? decodeURIComponent(match[3]) : null;
|
|
687
|
+
if (!nodeId) {
|
|
688
|
+
return {
|
|
689
|
+
content: [
|
|
690
|
+
{
|
|
691
|
+
type: 'text',
|
|
692
|
+
text: `Error: No node-id found in the Figma URL.
|
|
693
|
+
|
|
694
|
+
Please make sure your URL includes a node-id parameter.
|
|
695
|
+
Example: https://www.figma.com/design/${fileKey}/FileName?node-id=123-456
|
|
696
|
+
|
|
697
|
+
Provided URL: ${figmaNodeUrl}`,
|
|
698
|
+
},
|
|
699
|
+
],
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
// API headers
|
|
703
|
+
const headers = {
|
|
704
|
+
'X-Figma-Token': figmaAccessToken,
|
|
705
|
+
};
|
|
706
|
+
// Fetch node data
|
|
707
|
+
const nodeApiUrl = `https://api.figma.com/v1/files/${fileKey}/nodes?ids=${encodeURIComponent(nodeId)}`;
|
|
708
|
+
const nodeResponse = await fetch(nodeApiUrl, { headers });
|
|
709
|
+
if (!nodeResponse.ok) {
|
|
710
|
+
const errorText = await nodeResponse.text();
|
|
711
|
+
return {
|
|
712
|
+
content: [
|
|
713
|
+
{
|
|
714
|
+
type: 'text',
|
|
715
|
+
text: `Error fetching Figma node data:
|
|
716
|
+
Status: ${nodeResponse.status} ${nodeResponse.statusText}
|
|
717
|
+
Response: ${errorText}
|
|
718
|
+
|
|
719
|
+
API URL: ${nodeApiUrl}`,
|
|
720
|
+
},
|
|
721
|
+
],
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
const nodeData = await nodeResponse.json();
|
|
725
|
+
// Fetch node image
|
|
726
|
+
const imageApiUrl = `https://api.figma.com/v1/images/${fileKey}?ids=${encodeURIComponent(nodeId)}&scale=2`;
|
|
727
|
+
const imageResponse = await fetch(imageApiUrl, { headers });
|
|
728
|
+
if (!imageResponse.ok) {
|
|
729
|
+
const errorText = await imageResponse.text();
|
|
730
|
+
return {
|
|
731
|
+
content: [
|
|
732
|
+
{
|
|
733
|
+
type: 'text',
|
|
734
|
+
text: `Error fetching Figma node image:
|
|
735
|
+
Status: ${imageResponse.status} ${imageResponse.statusText}
|
|
736
|
+
Response: ${errorText}
|
|
737
|
+
|
|
738
|
+
API URL: ${imageApiUrl}
|
|
739
|
+
Node data was retrieved successfully.`,
|
|
740
|
+
},
|
|
741
|
+
],
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
const imageData = await imageResponse.json();
|
|
745
|
+
// Extract the image URL from the response
|
|
746
|
+
const imageUrl = imageData.images?.[nodeId] || imageData.images?.[Object.keys(imageData.images)[0]] || null;
|
|
747
|
+
// Return combined result with AI instructions
|
|
622
748
|
return {
|
|
623
749
|
content: [
|
|
624
750
|
{
|
|
625
751
|
type: 'text',
|
|
626
|
-
text:
|
|
752
|
+
text: `# Figma to Code Conversion Task
|
|
753
|
+
|
|
754
|
+
## Instructions for AI
|
|
755
|
+
|
|
756
|
+
You have received a Figma design that needs to be converted to code. Follow these steps:
|
|
757
|
+
|
|
758
|
+
### Step 1: Analyze the Design
|
|
759
|
+
Look at the rendered image below and the node structure data to understand:
|
|
760
|
+
- The layout and component hierarchy
|
|
761
|
+
- Colors, typography, and spacing used
|
|
762
|
+
- Interactive elements (buttons, inputs, links, etc.)
|
|
763
|
+
- Component patterns that match Flowbite components
|
|
764
|
+
|
|
765
|
+
### Step 2: Use Flowbite MCP Resources
|
|
766
|
+
Before writing code, fetch the relevant Flowbite component documentation using the MCP resources. Based on the design, you may need:
|
|
767
|
+
|
|
768
|
+
**Common Components to Check:**
|
|
769
|
+
- \`flowbite://components/buttons\` - For button styles
|
|
770
|
+
- \`flowbite://components/card\` - For card layouts
|
|
771
|
+
- \`flowbite://components/navbar\` - For navigation bars
|
|
772
|
+
- \`flowbite://components/modal\` - For modal dialogs
|
|
773
|
+
- \`flowbite://components/forms\` - For form layouts
|
|
774
|
+
- \`flowbite://forms/input-field\` - For input fields
|
|
775
|
+
- \`flowbite://components/avatar\` - For user avatars
|
|
776
|
+
- \`flowbite://components/badge\` - For badges/tags
|
|
777
|
+
- \`flowbite://components/tables\` - For data tables
|
|
778
|
+
- \`flowbite://components/tabs\` - For tab navigation
|
|
779
|
+
- \`flowbite://components/dropdowns\` - For dropdown menus
|
|
780
|
+
- \`flowbite://components/sidebar\` - For sidebar navigation
|
|
781
|
+
- \`flowbite://components/footer\` - For footer sections
|
|
782
|
+
- \`flowbite://typography/headings\` - For heading styles
|
|
783
|
+
- \`flowbite://typography/text\` - For text styles
|
|
784
|
+
|
|
785
|
+
### Step 3: Write the Code
|
|
786
|
+
Generate clean, semantic HTML with Tailwind CSS classes following these guidelines:
|
|
787
|
+
|
|
788
|
+
1. **Use Flowbite Components**: Match the Figma design to Flowbite components whenever possible
|
|
789
|
+
2. **Tailwind CSS Classes**: Use Tailwind utility classes for styling
|
|
790
|
+
3. **Responsive Design**: Include responsive breakpoints (sm:, md:, lg:, xl:)
|
|
791
|
+
4. **Semantic HTML**: Use proper HTML5 semantic elements
|
|
792
|
+
5. **Accessibility**: Include ARIA attributes and proper alt texts
|
|
793
|
+
6. **Match Colors**: Use Flowbite variables and secondly Tailwind color classes that best match the Figma design colors
|
|
794
|
+
7. **Match Spacing**: Use Tailwind spacing utilities (p-*, m-*, gap-*) to match the design
|
|
795
|
+
|
|
796
|
+
### Step 4: Output Format - IMPORTANT
|
|
797
|
+
|
|
798
|
+
**⚠️ ONLY output the component code block - DO NOT include:**
|
|
799
|
+
- \`<!DOCTYPE html>\`
|
|
800
|
+
- \`<html>\`, \`</html>\` tags
|
|
801
|
+
- \`<head>\`, \`</head>\` tags
|
|
802
|
+
- \`<body>\`, \`</body>\` tags
|
|
803
|
+
- \`<link>\` tags (CSS imports)
|
|
804
|
+
- \`<script>\` tags (JS imports)
|
|
805
|
+
- Any meta tags or document structure
|
|
806
|
+
- ':dark' variant classes unless explicitly requested
|
|
807
|
+
|
|
808
|
+
**✅ DO output:**
|
|
809
|
+
- Only the component HTML markup itself
|
|
810
|
+
- The actual UI component code that would go inside a \`<body>\` tag
|
|
811
|
+
- Clean, well-formatted code block with proper indentation
|
|
812
|
+
- Just the reusable component/section code
|
|
813
|
+
- When possible use the "brand" variables from Flowbite instead of hardcoded colors from Tailwind CSS
|
|
814
|
+
|
|
815
|
+
**Example of what to output:**
|
|
816
|
+
\`\`\`html
|
|
817
|
+
<div class="bg-neutral-primary-soft block max-w-sm p-6 border border-default rounded-base shadow-xs">
|
|
818
|
+
<h5 class="mb-3 text-2xl font-semibold tracking-tight text-heading leading-8">Noteworthy technology acquisitions 2021</h5>
|
|
819
|
+
<p class="text-body mb-6">Here are the biggest technology acquisitions of 2025 so far, in reverse chronological order.</p>
|
|
820
|
+
<a href="#" class="inline-flex items-center text-white bg-brand box-border border border-transparent hover:bg-brand-strong focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-4 py-2.5 focus:outline-none">
|
|
821
|
+
Read more
|
|
822
|
+
<svg class="w-4 h-4 ms-1.5 rtl:rotate-180 -me-0.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
|
|
823
|
+
</a>
|
|
824
|
+
</div>
|
|
825
|
+
\`\`\`
|
|
826
|
+
|
|
827
|
+
---
|
|
828
|
+
|
|
829
|
+
## Figma Design Data
|
|
830
|
+
|
|
831
|
+
### File Information
|
|
832
|
+
- **File Key**: ${fileKey}
|
|
833
|
+
- **Node ID**: ${nodeId}
|
|
834
|
+
- **Source URL**: ${figmaNodeUrl}
|
|
835
|
+
|
|
836
|
+
### Rendered Design Image
|
|
837
|
+
${imageUrl ? `
|
|
838
|
+
|
|
839
|
+
**Direct Image URL**: ${imageUrl}` : '⚠️ No image URL available - analyze the node data structure below'}
|
|
840
|
+
|
|
841
|
+
### Node Structure Data
|
|
842
|
+
The following JSON contains the Figma node structure with layers, styles, and properties:
|
|
843
|
+
|
|
844
|
+
\`\`\`json
|
|
845
|
+
${JSON.stringify(nodeData, null, 2)}
|
|
846
|
+
\`\`\`
|
|
847
|
+
|
|
848
|
+
---
|
|
849
|
+
|
|
850
|
+
## Now Convert This Design
|
|
851
|
+
|
|
852
|
+
Based on the image and node data above:
|
|
853
|
+
1. Identify the UI components visible in the design
|
|
854
|
+
2. Fetch the relevant Flowbite component documentation from the MCP resources
|
|
855
|
+
3. Generate ONLY the component HTML/Tailwind CSS code (no document wrapper, no \`<html>\`, \`<head>\`, \`<body>\`, \`<link>\`, or \`<script>\` tags)
|
|
856
|
+
4. Ensure the code is production-ready with proper responsiveness and accessibility`,
|
|
627
857
|
},
|
|
628
858
|
],
|
|
629
859
|
};
|
|
630
860
|
}
|
|
631
861
|
catch (error) {
|
|
632
|
-
console.error(`Error
|
|
862
|
+
console.error(`Error fetching Figma node: ${error}`);
|
|
633
863
|
return {
|
|
634
864
|
content: [
|
|
635
865
|
{
|
|
636
866
|
type: 'text',
|
|
637
|
-
text: `Error
|
|
867
|
+
text: `Error fetching Figma node: ${error instanceof Error ? error.message : String(error)}
|
|
868
|
+
|
|
869
|
+
Please check:
|
|
870
|
+
1. Your FIGMA_ACCESS_TOKEN is valid
|
|
871
|
+
2. The Figma URL is correct
|
|
872
|
+
3. You have access to the Figma file`,
|
|
638
873
|
},
|
|
639
874
|
],
|
|
640
875
|
};
|
|
641
876
|
}
|
|
642
877
|
});
|
|
643
|
-
server.tool('get_session', 'gets the session id and context', {}, async ({}) => {
|
|
644
|
-
return {
|
|
645
|
-
content: [
|
|
646
|
-
{
|
|
647
|
-
type: 'text',
|
|
648
|
-
text: `session`,
|
|
649
|
-
},
|
|
650
|
-
],
|
|
651
|
-
};
|
|
652
|
-
});
|
|
653
878
|
server.tool('generate-theme', 'Generates a custom Flowbite theme CSS file based on a brand color (hex format) and user instructions. The AI will intelligently analyze the instructions and customize ALL theme variables (border radius, spacing, colors, typography, etc.) to match the desired aesthetic. This tool creates color shades and variations, adapting the entire theme system to match your brand identity.', {
|
|
654
879
|
brandColor: z.string().describe('The primary brand color in hex format (e.g., #3B82F6, #FF5733). This will be used as the base for generating all brand color variations.'),
|
|
655
880
|
instructions: z.string().describe('Natural language instructions describing the desired theme aesthetic and customizations. The AI will interpret these instructions to modify all relevant theme variables. Examples: "Make it modern and minimalist with soft rounded corners", "Create a luxury feel with gold accents and elegant spacing", "Design for a playful children\'s app with bright colors", "Professional corporate style with subtle borders", etc.'),
|
package/data/overview.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Flowbite MCP Server Overview
|
|
2
|
+
|
|
3
|
+
This MCP server provides access to Flowbite's extensive library of Tailwind CSS components and theme generation capabilities.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- resources that have access to the full Flowbite component library including the open source components, plugins, and typography
|
|
8
|
+
- tools to allow the generation of UI components, layouts and the theme file that allow customization
|
|
9
|
+
|
|
10
|
+
## Supporting Flowbite
|
|
11
|
+
|
|
12
|
+
To support the open-source development of Flowbite please consider purchasing the [Pro version of Flowbite](https://flowbite.com/pro/#pricing) to get access to hundreds of premium building blocks, a Figma design system, and other templates like dashboard layouts and marketing websites.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Model Context Protocol server providing AI assistants with access to Flowbite UI components and an intelligent theme generator for Tailwind CSS",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
"build",
|
|
12
12
|
"data",
|
|
13
13
|
"README.md",
|
|
14
|
-
"LICENSE"
|
|
15
|
-
"CHANGELOG.md"
|
|
14
|
+
"LICENSE"
|
|
16
15
|
],
|
|
17
16
|
"publishConfig": {
|
|
18
17
|
"access": "public"
|