figma-mcp-server 0.1.1 → 0.1.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/.env.example +1 -0
- package/Dockerfile +21 -2
- package/mcpServer.js +10 -4
- package/package.json +3 -2
- package/smithery.yaml +39 -0
package/.env.example
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
FIGMA_API_KEY=
|
package/Dockerfile
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
FROM node:22.12-alpine AS builder
|
|
2
2
|
|
|
3
|
+
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
4
|
+
|
|
3
5
|
WORKDIR /app
|
|
4
|
-
COPY package.json
|
|
5
|
-
RUN
|
|
6
|
+
COPY package.json pnpm-lock.yaml ./
|
|
7
|
+
RUN pnpm install --frozen-lockfile
|
|
6
8
|
|
|
7
9
|
COPY . .
|
|
8
10
|
|
|
11
|
+
# Production stage
|
|
12
|
+
FROM node:22.12-alpine
|
|
13
|
+
|
|
14
|
+
WORKDIR /app
|
|
15
|
+
|
|
16
|
+
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
17
|
+
|
|
18
|
+
COPY package.json pnpm-lock.yaml ./
|
|
19
|
+
RUN pnpm install --prod --frozen-lockfile
|
|
20
|
+
|
|
21
|
+
COPY --from=builder /app/mcpServer.js ./
|
|
22
|
+
|
|
23
|
+
ENV NODE_ENV=production
|
|
24
|
+
|
|
25
|
+
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
|
|
26
|
+
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1
|
|
27
|
+
|
|
9
28
|
ENTRYPOINT ["node", "mcpServer.js"]
|
package/mcpServer.js
CHANGED
|
@@ -19,9 +19,13 @@ import { fileURLToPath } from "url";
|
|
|
19
19
|
const __filename = fileURLToPath(import.meta.url);
|
|
20
20
|
const __dirname = path.dirname(__filename);
|
|
21
21
|
|
|
22
|
+
// Load environment variables
|
|
22
23
|
dotenv.config({ path: path.resolve(__dirname, ".env") });
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
// Server configuration
|
|
26
|
+
const SERVER_NAME = process.env.SERVER_NAME || "figma-mcp-server";
|
|
27
|
+
const SERVER_VERSION = process.env.SERVER_VERSION || "0.1.2";
|
|
28
|
+
const DEFAULT_PORT = 3001;
|
|
25
29
|
|
|
26
30
|
async function transformTools(tools) {
|
|
27
31
|
return tools
|
|
@@ -94,7 +98,7 @@ async function run() {
|
|
|
94
98
|
const server = new Server(
|
|
95
99
|
{
|
|
96
100
|
name: SERVER_NAME,
|
|
97
|
-
version:
|
|
101
|
+
version: SERVER_VERSION,
|
|
98
102
|
},
|
|
99
103
|
{
|
|
100
104
|
capabilities: {
|
|
@@ -130,16 +134,18 @@ async function run() {
|
|
|
130
134
|
}
|
|
131
135
|
});
|
|
132
136
|
|
|
133
|
-
const port = process.env.PORT ||
|
|
137
|
+
const port = process.env.PORT || DEFAULT_PORT;
|
|
134
138
|
app.listen(port, () => {
|
|
135
139
|
console.log(`[SSE Server] running on port ${port}`);
|
|
140
|
+
console.log(`[Server] Name: ${SERVER_NAME}`);
|
|
141
|
+
console.log(`[Server] Version: ${SERVER_VERSION}`);
|
|
136
142
|
});
|
|
137
143
|
} else {
|
|
138
144
|
// stdio mode: single server instance
|
|
139
145
|
const server = new Server(
|
|
140
146
|
{
|
|
141
147
|
name: SERVER_NAME,
|
|
142
|
-
version:
|
|
148
|
+
version: SERVER_VERSION,
|
|
143
149
|
},
|
|
144
150
|
{
|
|
145
151
|
capabilities: {
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "figma-mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A simple MCP server for Figma",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"list-tools": "node index.js tools"
|
|
8
|
+
"list-tools": "node index.js tools",
|
|
9
|
+
"start": "node mcpServer.js --sse"
|
|
9
10
|
},
|
|
10
11
|
"dependencies": {
|
|
11
12
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
package/smithery.yaml
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
startCommand:
|
|
2
|
+
type: http
|
|
3
|
+
command: node mcpServer.js --sse
|
|
4
|
+
configSchema:
|
|
5
|
+
type: object
|
|
6
|
+
required: ["port"]
|
|
7
|
+
properties:
|
|
8
|
+
port:
|
|
9
|
+
type: number
|
|
10
|
+
title: "Server Port"
|
|
11
|
+
description: "Port number for the MCP server"
|
|
12
|
+
default: 3001
|
|
13
|
+
mode:
|
|
14
|
+
type: string
|
|
15
|
+
title: "Server Mode"
|
|
16
|
+
description: "Choose between SSE (Server-Sent Events) or stdio mode"
|
|
17
|
+
enum: ["sse", "stdio"]
|
|
18
|
+
default: "sse"
|
|
19
|
+
serverName:
|
|
20
|
+
type: string
|
|
21
|
+
title: "Server Name"
|
|
22
|
+
description: "Name of the MCP server instance"
|
|
23
|
+
default: "generated-mcp-server"
|
|
24
|
+
version:
|
|
25
|
+
type: string
|
|
26
|
+
title: "Server Version"
|
|
27
|
+
description: "Version of the MCP server"
|
|
28
|
+
default: "0.1.2"
|
|
29
|
+
|
|
30
|
+
connection:
|
|
31
|
+
type: sse
|
|
32
|
+
configSchema:
|
|
33
|
+
type: object
|
|
34
|
+
properties:
|
|
35
|
+
baseUrl:
|
|
36
|
+
type: string
|
|
37
|
+
title: "Base URL"
|
|
38
|
+
description: "Base URL for the MCP server"
|
|
39
|
+
default: "http://localhost:3001"
|