@primeuicom/mcp 0.1.6 → 0.1.8

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 CHANGED
@@ -1,22 +1,84 @@
1
- # @primeui/mcp
1
+ # @primeuicom/mcp
2
2
 
3
- PrimeUI MCP server package.
3
+ PrimeUI MCP connects AI agents to PrimeUI so they can discover project pages, create exports, download export artifacts, and automate PrimeUI-powered workflows directly from your coding environment.
4
4
 
5
- ## Runtime
5
+ ## Purpose and goals
6
6
 
7
- The package uses Studio API v1 with bearer authentication.
7
+ PrimeUI MCP is the integration layer between PrimeUI and MCP-compatible agents.
8
8
 
9
- Required env:
10
- - `PRIMEUI_API_KEY`
9
+ Core goals:
11
10
 
12
- Optional env:
13
- - `PRIMEUI_API_BASE_URL`
14
- - if set: MCP calls this base URL,
15
- - if not set: MCP defaults to `https://app.primeui.com/`.
11
+ - Give agents a reliable way to read PrimeUI project metadata and page inventory.
12
+ - Let agents trigger and monitor PrimeUI exports.
13
+ - Let agents download export bundles into a local workspace for code-level operations.
14
+ - Provide a stable MCP tool contract for PrimeUI workflows.
16
15
 
17
- The API root is normalized to `/api/v1`.
16
+ ## Requirements
18
17
 
19
- Example `.mcp.json`:
18
+ - An MCP client that supports `stdio` servers.
19
+ - A working Node.js runtime (the server is launched via `npx`).
20
+ - A valid PrimeUI API key (`PRIMEUI_API_KEY`).
21
+
22
+ ## PrimeUI API KEY
23
+
24
+ - PrimeUI provides this key together with the exported project.
25
+ - In practice, it is preconfigured in the exported project's `.mcp.json` for the `primeui` server entry.
26
+
27
+ ## Getting started
28
+
29
+ The setup below works in any MCP client that supports `.mcp.json` with `stdio` command servers (for example: Codex CLI, Cursor, Cline, and other compatible clients).
30
+
31
+ Create or update `.mcp.json`:
32
+
33
+ ```json
34
+ {
35
+ "mcpServers": {
36
+ "primeui": {
37
+ "type": "stdio",
38
+ "command": "npx",
39
+ "args": ["-y", "@primeuicom/mcp@latest"],
40
+ "env": {
41
+ "PRIMEUI_API_KEY": "your-primeui-api-key"
42
+ }
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ ## Install in common MCP clients
49
+
50
+ If your CLI command syntax differs by client version, use the JSON config from Getting started with the same `primeui` server block.
51
+
52
+ <details>
53
+ <summary>Codex CLI</summary>
54
+
55
+ Use the Codex MCP add command:
56
+
57
+ ```bash
58
+ codex mcp add primeui -- npx -y @primeuicom/mcp@latest
59
+ ```
60
+
61
+ Then set `PRIMEUI_API_KEY` in the MCP server env for `primeui`.
62
+
63
+ </details>
64
+
65
+ <details>
66
+ <summary>Claude Code</summary>
67
+
68
+ Add the server:
69
+
70
+ ```bash
71
+ claude mcp add primeui -- npx -y @primeuicom/mcp@latest
72
+ ```
73
+
74
+ Then configure server environment variables (at minimum `PRIMEUI_API_KEY`).
75
+
76
+ </details>
77
+
78
+ <details>
79
+ <summary>Cursor</summary>
80
+
81
+ Add the same server config to your Cursor MCP configuration:
20
82
 
21
83
  ```json
22
84
  {
@@ -26,24 +88,102 @@ Example `.mcp.json`:
26
88
  "command": "npx",
27
89
  "args": ["-y", "@primeuicom/mcp@latest"],
28
90
  "env": {
29
- "PRIMEUI_API_KEY": "<issued-api-key>"
91
+ "PRIMEUI_API_KEY": "your-primeui-api-key"
30
92
  }
31
93
  }
32
94
  }
33
95
  }
34
96
  ```
35
97
 
36
- ## Token revocation note
98
+ </details>
37
99
 
38
- API keys embed `ver` (token version). Future revocation/rotation is implemented by incrementing `project_api_access.token_version`.
100
+ <details>
101
+ <summary>VS Code MCP-compatible setup</summary>
39
102
 
40
- ## Local dev
103
+ If your setup supports VS Code MCP server registration via CLI:
41
104
 
42
105
  ```bash
43
- pnpm --filter @primeui/mcp dev
106
+ code --add-mcp '{"name":"primeui","command":"npx","args":["-y","@primeuicom/mcp@latest"],"env":{"PRIMEUI_API_KEY":"your-primeui-api-key"}}'
44
107
  ```
45
108
 
109
+ If your setup uses JSON config instead, use the same `.mcp.json` example from Getting started.
110
+
111
+ </details>
112
+
113
+ <details>
114
+ <summary>Cline / other JSON-config clients</summary>
115
+
116
+ Use the same `.mcp.json` server block from Getting started and provide `PRIMEUI_API_KEY`.
117
+
118
+ </details>
119
+
120
+ <details>
121
+ <summary>Gemini CLI</summary>
122
+
123
+ Add PrimeUI MCP:
124
+
46
125
  ```bash
47
- pnpm inspect
126
+ gemini mcp add primeui npx -y @primeuicom/mcp@latest
127
+ ```
128
+
129
+ Then configure `PRIMEUI_API_KEY` for that server entry.
130
+
131
+ </details>
132
+
133
+ <details>
134
+ <summary>Windsurf</summary>
135
+
136
+ Use the same JSON server configuration shown in Getting started:
137
+
138
+ ```json
139
+ {
140
+ "mcpServers": {
141
+ "primeui": {
142
+ "type": "stdio",
143
+ "command": "npx",
144
+ "args": ["-y", "@primeuicom/mcp@latest"],
145
+ "env": {
146
+ "PRIMEUI_API_KEY": "your-primeui-api-key"
147
+ }
148
+ }
149
+ }
150
+ }
151
+ ```
152
+
153
+ </details>
154
+
155
+ ## Tools
156
+
157
+ Available tools:
158
+
159
+ | Tool | What it does | Input |
160
+ | -------------------------- | ------------------------------------------------------------------------------------ | ---------------- |
161
+ | `primeui_get_project_info` | Returns project metadata and page list, including export readiness and source paths. | none |
162
+ | `primeui_list_exports` | Lists existing exports with ID, status, and creation time. | none |
163
+ | `primeui_create_export` | Starts a new export and returns created export info plus page snapshot. | none |
164
+ | `primeui_download_export` | Downloads and extracts a completed export into `.primeui/temp/exports/<exportId>/`. | `id` (export ID) |
165
+ | `primeui_clear_temp` | Clears `.primeui/temp/` and recreates baseline temp layout. | none |
48
166
 
167
+ ## Your first prompt
168
+
169
+ Try this in your MCP-enabled agent:
170
+
171
+ ```text
172
+ Use PrimeUI MCP to get my project info, list pages that are ready to export.
173
+ ```
174
+
175
+ Next step:
176
+
177
+ ```text
178
+ Export [missing pages | XXX page] with PrimeUI MCP and add them to my project.
49
179
  ```
180
+
181
+ ## Runtime behavior
182
+
183
+ - PrimeUI MCP uses bearer authentication with `PRIMEUI_API_KEY`.
184
+ - Downloaded archives are validated as ZIP payloads before extraction.
185
+ - Temporary export files are written under `.primeui/temp/` in user project folder
186
+
187
+ ## Credits
188
+
189
+ PrimeUI 2026
package/dist/lib/fs.js CHANGED
@@ -1,8 +1,6 @@
1
- import { execFile } from "node:child_process";
2
1
  import { mkdir, rm, writeFile } from "node:fs/promises";
3
2
  import path from "node:path";
4
- import { promisify } from "node:util";
5
- const execFileAsync = promisify(execFile);
3
+ import extractZipArchive from "extract-zip";
6
4
  export async function ensureDir(dirPath) {
7
5
  await mkdir(dirPath, { recursive: true });
8
6
  }
@@ -17,11 +15,11 @@ export async function writeUtf8(filePath, content) {
17
15
  export async function extractZip(zipPath, targetDir) {
18
16
  await ensureDir(targetDir);
19
17
  try {
20
- await execFileAsync("unzip", ["-o", zipPath, "-d", targetDir]);
18
+ await extractZipArchive(zipPath, { dir: targetDir });
21
19
  }
22
20
  catch (error) {
23
21
  const details = error instanceof Error ? error.message : String(error);
24
- throw new Error(`Failed to extract zip at "${zipPath}". Ensure "unzip" is installed. ${details}`);
22
+ throw new Error(`Failed to extract zip at "${zipPath}". ${details}`);
25
23
  }
26
24
  }
27
25
  //# sourceMappingURL=fs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/lib/fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;AAEzC,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAe;IAC7C,MAAM,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;AAC3C,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MAAM,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;AAC3C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAAe;IAC5C,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IACnD,MAAM,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;AAC3C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,QAAgB,EAAE,OAAe;IAC/D,MAAM,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAA;IACvC,MAAM,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;AAC7C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAe,EAAE,SAAiB;IACjE,MAAM,SAAS,CAAC,SAAS,CAAC,CAAA;IAE1B,IAAI,CAAC;QACH,MAAM,iBAAiB,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAA;IACtD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QACtE,MAAM,IAAI,KAAK,CAAC,6BAA6B,OAAO,MAAM,OAAO,EAAE,CAAC,CAAA;IACtE,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,33 @@
1
1
  {
2
2
  "name": "@primeuicom/mcp",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
+ "description": "MCP server that connects AI agents with PrimeUI project",
5
+ "keywords": [
6
+ "mcp",
7
+ "model-context-protocol",
8
+ "primeui",
9
+ "ai-agent",
10
+ "agent-tools",
11
+ "developer-tools",
12
+ "nextjs",
13
+ "export",
14
+ "website ai generation",
15
+ "next.js ai generation",
16
+ "ai sitebuilder",
17
+ "primeui components",
18
+ "primeui pages"
19
+ ],
20
+ "author": {
21
+ "name": "Oleg",
22
+ "email": "oleg@primeui.com",
23
+ "url": "https://pixelpoint.io/"
24
+ },
25
+ "homepage": "https://primeui.com/",
26
+ "repository": "https://primeui.com/",
27
+ "bugs": {
28
+ "url": "https://primeui.com/",
29
+ "email": "oleg@primeui.com"
30
+ },
4
31
  "type": "module",
5
32
  "main": "dist/service.js",
6
33
  "bin": {
@@ -20,6 +47,7 @@
20
47
  },
21
48
  "dependencies": {
22
49
  "@modelcontextprotocol/sdk": "^1.25.3",
50
+ "extract-zip": "^2.0.1",
23
51
  "zod": "^3.25.76"
24
52
  },
25
53
  "devDependencies": {