@primeuicom/mcp 0.1.10 → 0.1.12

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
@@ -18,37 +18,44 @@ Core goals:
18
18
  - An MCP client that supports `stdio` servers.
19
19
  - A working Node.js runtime (the server is launched via `npx`).
20
20
  - A valid PrimeUI API key (`PRIMEUI_API_KEY`).
21
+ - API key format: `pui_<22-char-base64url>`.
21
22
 
22
23
  ## PrimeUI API KEY
23
24
 
24
25
  - 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
+ - In linked/exported projects, the key is stored in `.primeui/project.json` under `apiKey`.
27
+ - PrimeUI MCP loads `PRIMEUI_API_KEY` from env first, then falls back to `.primeui/project.json`.
28
+ - `.primeui/project.json` must include:
29
+ - `projectId`
30
+ - `apiKey`
31
+ - `targetProjectPath` (required, relative path such as `"./"` or `"./apps/web"`)
26
32
 
27
33
  ## Your first prompts
28
34
 
29
35
  Try this in your MCP-enabled agent:
30
36
 
31
37
  ```text
32
- Use PrimeUI MCP to get my project info, list pages that are ready to export.
38
+ Use PrimeUI MCP to get my project info, list pages that are ready to export. Compare them with my current pages
33
39
  ```
34
40
 
35
41
  Next step:
36
42
 
37
43
  ```text
38
- Export [missing pages | XXX page] with PrimeUI MCP and add them to my project.
44
+ Export [X page | XX pages] from PrimeUI and add them to my project.
39
45
  ```
40
46
 
41
47
  ## Tools
42
48
 
43
49
  Available tools:
44
50
 
45
- | Tool | What it does | Input |
46
- | -------------------------- | ------------------------------------------------------------------------------------ | ---------------- |
47
- | `primeui_get_project_info` | Returns project metadata and page list, including export readiness and source paths. | none |
48
- | `primeui_list_exports` | Lists existing exports with ID, status, and creation time. | none |
49
- | `primeui_create_export` | Starts a new export and returns created export info plus page snapshot. | none |
50
- | `primeui_download_export` | Downloads and extracts a completed export into `.primeui/temp/exports/<exportId>/`. | `id` (export ID) |
51
- | `primeui_clear_temp` | Clears `.primeui/temp/` and recreates baseline temp layout. | none |
51
+ | Tool | What it does | Input |
52
+ | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
53
+ | `primeui_get_project_info` | Returns project metadata and page list, including export readiness and source paths. | none |
54
+ | `primeui_list_exports` | Lists existing exports with ID, status, and creation time. | none |
55
+ | `primeui_create_export` | Starts a new export and returns created export info plus page snapshot. | none |
56
+ | `primeui_download_export` | Downloads and extracts a completed export into `.primeui/temp/exports/<exportId>/` and writes sidecar manifest `.primeui/temp/exports/<exportId>.manifest.json`. | `id` (export ID) |
57
+ | `primeui_copy_page` | Safely copies one page from downloaded export into user project (new files only, conflicts as diff, add-only missing deps). | `originPageSlug`, `actualPageSlug?` |
58
+ | `primeui_clear_temp` | Clears `.primeui/temp/` and recreates baseline temp layout. | none |
52
59
 
53
60
  ## Getting started
54
61
 
@@ -181,6 +188,11 @@ Use the same JSON server configuration shown in Getting started:
181
188
  ## Runtime behavior
182
189
 
183
190
  - PrimeUI MCP uses bearer authentication with `PRIMEUI_API_KEY`.
191
+ - If `PRIMEUI_API_KEY` env is missing, PrimeUI MCP reads `.primeui/project.json` (`apiKey`).
192
+ - Config lookup:
193
+ - if `PRIMEUI_PROJECT_ROOT` is set, MCP reads `${PRIMEUI_PROJECT_ROOT}/.primeui/project.json`;
194
+ - otherwise MCP searches `.primeui/project.json` upward from current working directory.
195
+ - Missing or invalid `targetProjectPath` is treated as a configuration error.
184
196
  - Downloaded archives are validated as ZIP payloads before extraction.
185
197
  - Temporary export files are written under `.primeui/temp/` in user project folder
186
198
 
@@ -189,7 +201,7 @@ Use the same JSON server configuration shown in Getting started:
189
201
  Configure these environment variables for local development:
190
202
 
191
203
  - `PRIMEUI_API_BASE_URL`: PrimeUI API base URL (for example `http://localhost:3020` when testing against local Studio API).
192
- - `PRIMEUI_PROJECT_ROOT`: local project root where PrimeUI temp files are created (defaults to the current working directory if not set).
204
+ - `PRIMEUI_PROJECT_ROOT`: explicit project root override for `.primeui/project.json` and `.primeui/temp/` location.
193
205
 
194
206
  Run MCP Inspector:
195
207