figma-mcp-server 0.0.0-alpha.1
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 +163 -0
- package/index.js +9 -0
- package/package.json +30 -0
package/README.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Figma MCP Server
|
|
2
|
+
|
|
3
|
+
### 📥 Installation & Setup
|
|
4
|
+
|
|
5
|
+
**1. Install dependencies**
|
|
6
|
+
|
|
7
|
+
Run from your project's root directory:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### 🔐 Set tool environment variables
|
|
14
|
+
|
|
15
|
+
In the `.env` file, you'll see environment variable placeholders, one for each workspace that the selected tools are from. For example, if you selected requests from 2 workspaces, e.g. Acme and Widgets, you'll see two placeholders:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
ACME_API_KEY=
|
|
19
|
+
WIDGETS_API_KEY=
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Update the values with actual API keys for each API. These environment variables are used inside of the generated tools to set the API key for each request. You can inspect a file in the `tools` directory to see how it works.
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
25
|
+
// environment variables are used inside of each tool file
|
|
26
|
+
const apiKey = process.env.ACME_API_KEY;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Caveat:** This may not be correct for every API. The generation logic is relatively simple - for each workspace, we create an environment variable with the same name as the workspace slug, and then use that environment variable in each tool file that belongs to that workspace. If this isn't the right behavior for your chosen API, no problem! You can manually update anything in the `.env` file or tool files to accurately reflect the API's method of authentication.
|
|
30
|
+
|
|
31
|
+
### 🛠️ List Available Tools
|
|
32
|
+
|
|
33
|
+
List descriptions and parameters from all generated tools with:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
node index.js tools
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Example:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
Available Tools:
|
|
43
|
+
|
|
44
|
+
Workspace: acme-workspace
|
|
45
|
+
Collection: useful-api
|
|
46
|
+
list_all_customers
|
|
47
|
+
Description: Retrieve a list of useful things.
|
|
48
|
+
Parameters:
|
|
49
|
+
- magic: The required magic power
|
|
50
|
+
- limit: Number of results returned
|
|
51
|
+
[...additional parameters...]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 🌐 Running the MCP Server
|
|
55
|
+
|
|
56
|
+
The MCP Server (`mcpServer.js`) exposes your automated API tools to MCP-compatible clients, such as Claude Desktop or the Postman Desktop Application.
|
|
57
|
+
|
|
58
|
+
### A) 🖥️ Run with Postman
|
|
59
|
+
|
|
60
|
+
The Postman Desktop Application is the easiest way to run and test MCP servers.
|
|
61
|
+
|
|
62
|
+
Step 1: Download the latest Postman Desktop Application from [https://www.postman.com/downloads/](https://www.postman.com/downloads/).
|
|
63
|
+
|
|
64
|
+
Step 2: Read out the documentation article [here](https://learning.postman.com/docs/postman-ai-agent-builder/mcp-requests/overview/) for the next steps.
|
|
65
|
+
|
|
66
|
+
### B) 👩💻 Run with Claude Desktop
|
|
67
|
+
|
|
68
|
+
To integrate with Claude Desktop:
|
|
69
|
+
|
|
70
|
+
1. Find node path:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
which node
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
2. Find `mcpServer.js` path:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
realpath mcpServer.js
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
3. Open Claude Desktop → **Settings** → **Developers** → **Edit Config** and add your server:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"mcpServers": {
|
|
87
|
+
"<server_name>": {
|
|
88
|
+
"command": "<absolute_path_to_node>",
|
|
89
|
+
"args": ["<absolute_path_to_mcpServer.js>"]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Restart Claude Desktop to activate this change.
|
|
96
|
+
|
|
97
|
+
### Additional Options
|
|
98
|
+
|
|
99
|
+
#### 🐳 Docker Deployment (Production)
|
|
100
|
+
|
|
101
|
+
For production deployments, you can use Docker:
|
|
102
|
+
|
|
103
|
+
**1. Build Docker image**
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
docker build -t <your_server_name> .
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**2. Claude Desktop Integration**
|
|
110
|
+
|
|
111
|
+
Add Docker server configuration to Claude Desktop (Settings → Developers → Edit Config):
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"mcpServers": {
|
|
116
|
+
"<your_server_name>": {
|
|
117
|
+
"command": "docker",
|
|
118
|
+
"args": ["run", "-i", "--rm", "--env-file=.env", "<your_server_name>"]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
> Add your environment variables (API keys, etc.) inside the `.env` file.
|
|
125
|
+
|
|
126
|
+
#### 🌐 Server-Sent Events (SSE)
|
|
127
|
+
|
|
128
|
+
To run the server with Server-Sent Events (SSE) support, use the `--sse` flag:
|
|
129
|
+
|
|
130
|
+
```sh
|
|
131
|
+
node mcpServer.js --sse
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## 🐳 Dockerfile (Included)
|
|
135
|
+
|
|
136
|
+
The project comes bundled with the following minimal Docker setup:
|
|
137
|
+
|
|
138
|
+
```dockerfile
|
|
139
|
+
FROM node:22.12-alpine AS builder
|
|
140
|
+
|
|
141
|
+
WORKDIR /app
|
|
142
|
+
COPY package.json package-lock.json ./
|
|
143
|
+
RUN npm install
|
|
144
|
+
|
|
145
|
+
COPY . .
|
|
146
|
+
|
|
147
|
+
ENTRYPOINT ["node", "mcpServer.js"]
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## ➕ Adding New Tools
|
|
151
|
+
|
|
152
|
+
Extend your agent with more tools easily:
|
|
153
|
+
|
|
154
|
+
1. Visit [Postman Agent Generator](https://postman.com/explore/agent-generator).
|
|
155
|
+
2. Pick new API request(s), generate a new agent, and download it.
|
|
156
|
+
3. Copy new generated tool(s) into your existing project's `tools/` folder.
|
|
157
|
+
4. Update your `tools/paths.js` file to include new tool references.
|
|
158
|
+
|
|
159
|
+
## 💬 Questions & Support
|
|
160
|
+
|
|
161
|
+
Visit the [Postman Agent Generator](https://postman.com/explore/agent-generator) page for updates and new capabilities.
|
|
162
|
+
|
|
163
|
+
Visit the [Postman Community](https://community.postman.com/) to share what you've built, ask questions and get help.
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "figma-mcp-server",
|
|
3
|
+
"version": "0.0.0-alpha.1",
|
|
4
|
+
"description": "MCP server for Figma",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"list-tools": "node index.js tools"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
12
|
+
"commander": "^14.0.0",
|
|
13
|
+
"dotenv": "^16.5.0",
|
|
14
|
+
"express": "^5.1.0"
|
|
15
|
+
},
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=16.0.0"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"figma",
|
|
21
|
+
"mcp",
|
|
22
|
+
"model-context-protocol",
|
|
23
|
+
"server"
|
|
24
|
+
],
|
|
25
|
+
"author": "@planetabhi",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"files": [
|
|
28
|
+
"README.md"
|
|
29
|
+
]
|
|
30
|
+
}
|