@zeplin/mcp-server 1.0.0 → 1.0.2
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 +66 -58
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
# Zeplin MCP
|
|
1
|
+
# Zeplin MCP server: AI-assisted UI development
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Connect AI agents like Cursor, Windsurf, and VS Code (w/ Copilot) to Zeplin. Using the MCP server, AI agents can tap into:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- **Component and screen specs:** Detailed specs and assets for both components and entire screens — helping agents generate UI code that closely matches the designs.
|
|
6
|
+
- **Documentation:** Annotations added to screens that provide extra context, like how things should behave or tips for implementation — letting the agent go beyond static visuals and build real interactions.
|
|
7
|
+
- **Design tokens:** Colors, typography, spacing, and other design variables used across the project, so your agent can reuse existing tokens where possible.
|
|
8
|
+
|
|
9
|
+
## Table of contents
|
|
6
10
|
|
|
7
|
-
- [Features](#features)
|
|
8
11
|
- [Prerequisites](#prerequisites)
|
|
9
12
|
- [Installation](#installation)
|
|
10
13
|
- [Configuration](#configuration)
|
|
@@ -14,32 +17,36 @@ This project is a Model Context Protocol server designed to assist developers in
|
|
|
14
17
|
- [Example Prompt 1: Minor Changes/Additions](#example-prompt-1-minor-changesadditions)
|
|
15
18
|
- [Example Prompt 2: Complex Implementations (Component-First)](#example-prompt-2-complex-implementations-component-first)
|
|
16
19
|
|
|
17
|
-
##
|
|
20
|
+
## Prerequisites
|
|
21
|
+
|
|
22
|
+
- [Node.js](https://nodejs.org/) (v20 or later)
|
|
23
|
+
- A Zeplin account.
|
|
24
|
+
- A Zeplin personal access token. You can generate one from your Zeplin profile, under "Developer" > "Personal access tokens".
|
|
18
25
|
|
|
19
|
-
|
|
20
|
-
* **Code Generation Ready**: Provides AI models with structured data for conciseness and relevance.
|
|
21
|
-
* **Asset Handling**: Automatically identifies and provides information for assets within designs. AI agents can then decide to download these assets (SVG, PNG, PDF, JPG) as needed for implementation.
|
|
22
|
-
* **Targeted Implementation**: Facilitates implementation of entire screens or individual components, including their variants, layers, and annotations, directly from Zeplin specifications.
|
|
26
|
+
## Installation
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
### Cursor one-click installation
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
* A Zeplin account.
|
|
28
|
-
* A Zeplin Personal Access Token (PAT). You can generate one from your Zeplin profile settings under "Developer" > "Personal access tokens". This token will need `read` permissions for the projects/styleguides you want to access.
|
|
30
|
+
[](https://cursor.com/install-mcp?name=zeplin&config=eyJjb21tYW5kIjoibnB4IC15IEB6ZXBsaW4vbWNwLXNlcnZlckBsYXRlc3QiLCJlbnYiOnsiWkVQTElOX0FDQ0VTU19UT0tFTiI6IiJ9fQ%3D%3D)
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
### Manual installation
|
|
33
|
+
|
|
34
|
+
To start using the MCP server, you first need to configure your client (e.g. Cursor, VS Code, Windsurf, Claude Code). Most clients have an option to add a new MCP server. When prompted, enter the following command:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx @zeplin/mcp-server@latest
|
|
38
|
+
```
|
|
31
39
|
|
|
32
|
-
|
|
40
|
+
In addition, you also need to provide your Zeplin access token using the `ZEPLIN_ACCESS_TOKEN` environment variable.
|
|
41
|
+
|
|
42
|
+
For example, if you’re using Cursor, here’s how your MCP settings should look like:
|
|
33
43
|
|
|
34
44
|
```jsonc
|
|
35
|
-
// In your MCP client's configuration (e.g., Cursor's settings.json)
|
|
36
45
|
{
|
|
37
46
|
"mcpServers": {
|
|
38
|
-
"zeplin
|
|
47
|
+
"zeplin": {
|
|
39
48
|
"command": "npx",
|
|
40
|
-
"args": [
|
|
41
|
-
"@zeplin/mcp-server@latest"
|
|
42
|
-
],
|
|
49
|
+
"args": ["@zeplin/mcp-server@latest"],
|
|
43
50
|
"env": {
|
|
44
51
|
"ZEPLIN_ACCESS_TOKEN": "<YOUR_ZEPLIN_PERSONAL_ACCESS_TOKEN>" // Replace with your actual token
|
|
45
52
|
}
|
|
@@ -50,7 +57,7 @@ To integrate this server with an MCP client like Cursor, you need to configure t
|
|
|
50
57
|
|
|
51
58
|
## Development
|
|
52
59
|
|
|
53
|
-
|
|
60
|
+
The project includes several npm scripts to help with development:
|
|
54
61
|
|
|
55
62
|
```bash
|
|
56
63
|
# Run TypeScript compiler in watch mode for development
|
|
@@ -69,15 +76,13 @@ npm run lint:fix
|
|
|
69
76
|
npm run inspect
|
|
70
77
|
```
|
|
71
78
|
|
|
72
|
-
|
|
79
|
+
To run `npm run inspect`, create an `.env` file first in the root directory:
|
|
73
80
|
|
|
74
81
|
```bash
|
|
75
|
-
ZEPLIN_ACCESS_TOKEN
|
|
82
|
+
ZEPLIN_ACCESS_TOKEN=<YOUR_ZEPLIN_PERSONAL_ACCESS_TOKEN>
|
|
76
83
|
```
|
|
77
84
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
### Code Style and Linting
|
|
85
|
+
### Code style and linting
|
|
81
86
|
|
|
82
87
|
This project uses ESLint to enforce code quality and consistency. The configuration is in `eslint.config.js`. Key style guidelines include:
|
|
83
88
|
|
|
@@ -89,11 +94,11 @@ This project uses ESLint to enforce code quality and consistency. The configurat
|
|
|
89
94
|
|
|
90
95
|
When contributing to this project, please ensure your code follows these guidelines by running `npm run lint:fix` before submitting changes.
|
|
91
96
|
|
|
92
|
-
## Crafting
|
|
97
|
+
## Crafting effective prompts
|
|
93
98
|
|
|
94
|
-
The quality and specificity of your prompts significantly impact the AI
|
|
99
|
+
The quality and specificity of your prompts significantly impact the AI’s ability to generate accurate and useful code. These are not mandatory but will definitely increase the output quality.
|
|
95
100
|
|
|
96
|
-
### Example
|
|
101
|
+
### Example prompt 1: Minor changes/additions
|
|
97
102
|
|
|
98
103
|
When you need to implement a small update or addition to an existing screen or component based on a new Zeplin design version.
|
|
99
104
|
|
|
@@ -106,15 +111,16 @@ The MenuItem component, which needs to be modified, is located at path/to/your/m
|
|
|
106
111
|
Please implement this new addition.
|
|
107
112
|
```
|
|
108
113
|
|
|
109
|
-
|
|
110
|
-
* **Contextualizes the change:** Clearly states what's new.
|
|
111
|
-
* **Provides the Zeplin link:** Allows the MCP server to fetch the latest design data.
|
|
112
|
-
* **Gives file paths:** Helps the AI locate existing code to modify.
|
|
113
|
-
* **Specifies components involved:** Narrows down the scope of work.
|
|
114
|
+
Why this is effective:
|
|
114
115
|
|
|
115
|
-
|
|
116
|
+
- **Contextualizes the change:** Clearly states what’s new.
|
|
117
|
+
- **Provides the Zeplin link:** Allows the MCP server to fetch the latest design data.
|
|
118
|
+
- **Gives file paths:** Helps the AI locate existing code to modify.
|
|
119
|
+
- **Specifies components involved:** Narrows down the scope of work.
|
|
116
120
|
|
|
117
|
-
|
|
121
|
+
### Example prompt 2: Larger designs (Component-first)
|
|
122
|
+
|
|
123
|
+
For implementing larger screens or features, it’s often best to build individual components first and then assemble them.
|
|
118
124
|
|
|
119
125
|
```
|
|
120
126
|
Implement this component: <zeplin short url of the first component, e.g., https://zpl.io/def456Y>. Use Zeplin for design specifications.
|
|
@@ -130,31 +136,33 @@ Implement this other component: <zeplin short url of the second component, e.g.,
|
|
|
130
136
|
Now, using the components you just implemented (and any other existing components), implement the following screen: <zeplin short url of the screen, e.g., https://zpl.io/jkl012A>. Use Zeplin for the screen layout and any direct elements.
|
|
131
137
|
```
|
|
132
138
|
|
|
133
|
-
|
|
139
|
+
Why this is effective:
|
|
134
140
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
141
|
+
- **Breaks down complexity:** Tackles smaller, manageable pieces first.
|
|
142
|
+
- **Iterative approach:** Allows for review and correction at each step.
|
|
143
|
+
- **Builds on previous work:** The AI can use the components it just created.
|
|
144
|
+
- **Clear Zeplin references:** Ensures each piece is based on the correct design.
|
|
139
145
|
|
|
140
146
|
### Strategies to deal with context window limitations
|
|
141
147
|
|
|
142
148
|
When dealing with complex Zeplin screens or components with many variants and layers, the amount of design data fetched can sometimes be extensive. This can potentially exceed the context window limitations of the AI model you are using, leading to truncated information or less effective code generation. Here are several strategies to manage the amount of information sent to the model:
|
|
143
149
|
|
|
144
|
-
1. **Limit
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
150
|
+
1. **Limit screen variants (`includeVariants: false`):**
|
|
151
|
+
|
|
152
|
+
- **How it works:** When using the `get_screen` tool, the model can be instructed to fetch only the specific screen version linked in the URL, rather than all its variants (e.g., different states, sizes, themes). This is done by setting the `includeVariants` parameter to `false` during the tool call.
|
|
153
|
+
- **When to use:** If your prompt is focused on a single specific version of a screen, or if the variants are not immediately relevant to the task at hand. This significantly reduces the amount of data related to variant properties and their respective layer structures.
|
|
154
|
+
- **Example prompt:** “Implement the login form from this screen: `https://zpl.io/abc123X`. I only need the specific version linked, not all its variants.”
|
|
155
|
+
_The AI agent, when calling `get_screen`, should then ideally use `includeVariants: false`._
|
|
156
|
+
|
|
157
|
+
2. **Focus on specific layers/components (`targetLayerName` or targeted prompts):**
|
|
158
|
+
|
|
159
|
+
- **How it works (using `targetLayerName`):** The `get_screen` tool has a `targetLayerName` parameter. If the model can identify a specific layer name from your prompt (e.g., "the 'Submit Button'"), it can use this parameter. The server will then return data primarily for that layer and its children, rather than the entire screen's layer tree.
|
|
160
|
+
- **How it works (targeted prompts):** Even without explicitly using `targetLayerName` in the tool call, very specific prompts can guide the model to internally prioritize or summarize information related to the mentioned element.
|
|
161
|
+
- **When to use:** When your task involves a specific part of a larger screen, like a single button, an icon, or a text block.
|
|
162
|
+
- **Example prompt:** “Focus on the 'UserProfileHeader' component within this screen: `https://zpl.io/screenXYZ`. I need to implement its layout and text styles.”
|
|
163
|
+
_If the AI uses `get_screen`, it could populate `targetLayerName: "UserProfileHeader"`._
|
|
164
|
+
|
|
165
|
+
3. **Iterative, component-first implementation:**
|
|
166
|
+
- **How it works:** As detailed in [Example prompt 2: Larger designs (Component-first)](#example-prompt-2-larger-designs-component-first), break down the implementation of a complex screen into smaller, component-sized tasks.
|
|
167
|
+
- **When to use:** For any non-trivial screen. This approach naturally limits the scope of each `get_component` or `get_screen` call to a manageable size.
|
|
168
|
+
- **Benefit:** Each request to the Zeplin MCP server will fetch a smaller, more focused dataset, making it easier to stay within context limits and allowing the model to concentrate on one piece at a time.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeplin/mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Zeplin’s official MCP server for AI-assisted UI development",
|
|
5
5
|
"author": "Zeplin",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|