formlab-mcp 0.6.56 → 0.6.57

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,14 +1,14 @@
1
1
  # formlab-mcp
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/formlab-mcp.svg)](https://www.npmjs.com/package/formlab-mcp)
4
- [![license](https://img.shields.io/npm/l/formlab-mcp.svg)](https://github.com/juliu1980/FormLab/blob/main/LICENSE)
4
+ [![license](https://img.shields.io/npm/l/formlab-mcp.svg)](https://www.npmjs.com/package/formlab-mcp)
5
5
  [![FormLab](https://img.shields.io/badge/site-formvix.com-2563eb.svg)](https://formvix.com)
6
6
 
7
- A **read-only Model Context Protocol server** for [FormLab](https://formvix.com). Lets Claude (or any MCP-compatible AI assistant) read and analyze your local FormLab database — your formulations, ingredients, batches, samples and test reports — **without your data ever leaving your machine**.
7
+ A **read-only Model Context Protocol server** for [FormLab](https://formvix.com). Lets Claude (or any MCP-compatible AI assistant) read and analyze your FormLab data: formulations, ingredients, batches, samples and test reports, from a local export file or your live cloud workspace.
8
8
 
9
- > Local-first + AI-native. Your proprietary recipes stay on your laptop; only the LLM's answer to your question travels.
9
+ > In file mode the server makes no network calls of its own. What a tool returns goes to the model your MCP client uses (for Claude Desktop, Anthropic), so only connect data you're comfortable sending to that provider. See [Privacy and data flow](#privacy-and-data-flow).
10
10
 
11
- Listed in the official MCP Registry as `io.github.juliu1980/formlab-mcp`.
11
+ Listed in the official MCP Registry as `io.github.juliu1980/formlab-mcp`. The source ships in the npm package (MIT).
12
12
 
13
13
  ## What it does
14
14
 
@@ -82,24 +82,34 @@ npm install -g formlab-mcp
82
82
  formlab-mcp /path/to/formlab-export.json
83
83
  ```
84
84
 
85
- For local development from this repo:
85
+ To read or run the source, unpack it from npm (it ships in the package, MIT):
86
86
 
87
87
  ```bash
88
- cd mcp
89
- npm install
88
+ npm pack formlab-mcp && tar xzf formlab-mcp-*.tgz
89
+ cd package && npm install
90
90
  node index.js /path/to/formlab-export.json
91
91
  ```
92
92
 
93
93
  Requires **Node 18+**.
94
94
 
95
+ ## Try it with sample data
96
+
97
+ No FormLab account needed: a sample export (the app's Showcase demo) is published on formvix.com.
98
+
99
+ ```bash
100
+ curl -O https://formvix.com/downloads/formlab-demo-export.json
101
+ npx formlab-mcp ./formlab-demo-export.json
102
+ ```
103
+
104
+ Point your MCP client at that file the same way as your own export (see below).
105
+
95
106
  ## Get your FormLab export
96
107
 
97
108
  1. Open FormLab
98
- 2. Sidebar → **⇅ Import / Export**
99
- 3. Click **Export** — saves `formlab-export-YYYY-MM-DD.json` to your downloads folder
100
- 4. Point this MCP at the downloaded file
109
+ 2. **Settings → Data → Export JSON**. This saves `formlab-export-YYYY-MM-DD.json` to your downloads folder.
110
+ 3. Point this MCP at the downloaded file
101
111
 
102
- The MCP server watches the file — re-export from FormLab and the next tool call sees the fresh data without restarting the server.
112
+ The MCP server watches the file: re-export from FormLab and the next tool call sees the fresh data without restarting the server.
103
113
 
104
114
  ## Or: LIVE cloud mode (no export needed)
105
115
 
@@ -138,7 +148,7 @@ Add this to your `claude_desktop_config.json` (on macOS: `~/Library/Application
138
148
  }
139
149
  ```
140
150
 
141
- Or for local-dev (from the repo):
151
+ Or from the unpacked package:
142
152
 
143
153
  ```json
144
154
  {
@@ -146,7 +156,7 @@ Or for local-dev (from the repo):
146
156
  "formlab": {
147
157
  "command": "node",
148
158
  "args": [
149
- "/Users/you/formlab/mcp/index.js",
159
+ "/Users/you/package/index.js",
150
160
  "/Users/you/Downloads/formlab-export-2026-05-30.json"
151
161
  ]
152
162
  }
@@ -154,7 +164,7 @@ Or for local-dev (from the repo):
154
164
  }
155
165
  ```
156
166
 
157
- Restart Claude Desktop. You should see a hammer icon indicating tools are available, and FormLab's 40 tools become callable in any conversation.
167
+ Restart Claude Desktop. You should see a hammer icon indicating tools are available, and FormLab's 41 tools become callable in any conversation.
158
168
 
159
169
  ## Wire it up to Claude Code
160
170
 
@@ -169,12 +179,22 @@ export FORMLAB_EXPORT=/Users/you/Downloads/formlab-export-2026-05-30.json
169
179
  claude mcp add formlab npx formlab-mcp
170
180
  ```
171
181
 
172
- ## Privacy and architecture
182
+ ## Privacy and data flow
183
+
184
+ **In both modes, what a tool returns goes to your model.** The server answers your MCP client over stdio, and the client sends tool results (your formulations, test data and so on) to the model it uses: for Claude Desktop, Anthropic. Only connect data you're comfortable sending to that provider.
173
185
 
174
- - **No network calls.** The server runs on stdio between Claude and your local Node process. Your data file never leaves your disk.
175
- - **No FormLab cloud.** FormLab itself is a local-first app; the MCP follows the same model.
176
- - **Hot-reload on file change.** Re-export from FormLab while the server is running — the next tool call picks up fresh data.
177
- - **Read-only.** Tier 1 cannot mutate your FormLab data. (Write tools are planned for a future paid "Pro" tier — register / batch / log-test mutations with cascade-safe confirmation.)
186
+ **File mode** (an export file):
187
+
188
+ - **No network calls of its own.** The server reads the export from your disk and talks to your MCP client over stdio. It does not upload the file anywhere.
189
+ - **Hot-reload on file change.** Re-export from FormLab while the server is running and the next tool call picks up fresh data.
190
+
191
+ **Cloud mode** (`FORMLAB_MCP_TOKEN` set):
192
+
193
+ - The server sends your token to FormLab's `mcp-data` Edge Function and receives your workspace in return, re-read every 60 seconds (`FORMLAB_REFRESH_SECONDS`).
194
+ - The function reads through a dedicated `mcp_readonly` Postgres role with `SELECT`-only grants, and row-level security limits it to the workspace the token was made for.
195
+ - FormLab stores only a SHA-256 hash of the token. It holds no account session and you can revoke it at any time.
196
+
197
+ **Read-only, in both modes.** No tool can change your FormLab data.
178
198
 
179
199
  ## Data shape
180
200
 
@@ -185,12 +205,6 @@ The server accepts both FormLab export shapes:
185
205
 
186
206
  The wrapped form is the default since 2026; the legacy form is supported for older exports.
187
207
 
188
- ## Tier 2 (planned, paid)
189
-
190
- Live file-sync with write tools: `create_formulation`, `update_formulation`, `log_test_result`, `create_batch`, etc. Mutations from Claude write back to the same JSON FormLab reads. Conflict detection, cascade-safe deletes, schema versioning.
191
-
192
- Not yet shipped — see the FormLab roadmap.
193
-
194
208
  ## License
195
209
 
196
210
  MIT
package/index.js CHANGED
@@ -7,7 +7,7 @@
7
7
  // FORMLAB_EXPORT=/path/to/export.json node index.js
8
8
  // formlab-mcp /path/to/export.json (when installed via npm)
9
9
  //
10
- // Exposes 40 tools (see ./tools/) over stdio. The MCP host (Claude
10
+ // Exposes 41 tools (see ./tools/) over stdio. The MCP host (Claude
11
11
  // Desktop, Claude Code, etc.) handles tool discovery, invocation
12
12
  // and response formatting. We just register handlers and stay out
13
13
  // of the way.
@@ -72,7 +72,7 @@ if (CLOUD) {
72
72
  'Usage: formlab-mcp <path-to-export.json> (file mode)',
73
73
  ' or: set FORMLAB_MCP_TOKEN (LIVE cloud mode)',
74
74
  '',
75
- 'File mode: export via Settings → Import / Export → Export.',
75
+ 'File mode: export via Settings → Data → Export JSON.',
76
76
  'Cloud mode: mint a read-only token in FormLab → Settings → Account →',
77
77
  ' AI tools (MCP) → Connect, and set it as FORMLAB_MCP_TOKEN.',
78
78
  '',
package/package.json CHANGED
@@ -1,13 +1,26 @@
1
1
  {
2
2
  "name": "formlab-mcp",
3
- "version": "0.6.56",
3
+ "version": "0.6.57",
4
4
  "mcpName": "io.github.juliu1980/formlab-mcp",
5
- "description": "Read-only Model Context Protocol server for FormLab \u2014 lets Claude (and other MCP clients) read and analyze your FormLab data, from a local export file OR your live cloud workspace.",
5
+ "description": "Read-only Model Context Protocol server for FormLab. Lets Claude and other MCP clients read and analyze your FormLab data, from a local export file or your live cloud workspace.",
6
+ "homepage": "https://formvix.com/mcp",
6
7
  "type": "module",
7
8
  "bin": {
8
9
  "formlab-mcp": "./index.js"
9
10
  },
10
11
  "main": "index.js",
12
+ "files": [
13
+ "index.js",
14
+ "data.js",
15
+ "cloud.js",
16
+ "calibration.js",
17
+ "peptide.js",
18
+ "theoretical.js",
19
+ "tools/",
20
+ "vendor/",
21
+ "server.json",
22
+ "README.md"
23
+ ],
11
24
  "scripts": {
12
25
  "start": "node index.js",
13
26
  "dev": "node --watch index.js"
@@ -32,10 +45,5 @@
32
45
  "design-of-experiments",
33
46
  "claude"
34
47
  ],
35
- "license": "MIT",
36
- "repository": {
37
- "type": "git",
38
- "url": "https://github.com/juliu1980/FormLab",
39
- "directory": "mcp"
40
- }
48
+ "license": "MIT"
41
49
  }
package/server.json CHANGED
@@ -1,19 +1,14 @@
1
1
  {
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
3
  "name": "io.github.juliu1980/formlab-mcp",
4
- "description": "Read-only MCP for FormLab — let Claude query your formulation lab. Free reads a local export; Pro connects to your live cloud workspace with a dedicated read-only token.",
5
- "version": "0.6.56",
4
+ "description": "Read-only MCP server for FormLab formulation data: a local export file or your live cloud workspace.",
5
+ "version": "0.6.57",
6
6
  "websiteUrl": "https://formvix.com/mcp",
7
- "repository": {
8
- "url": "https://github.com/juliu1980/FormLab",
9
- "source": "github",
10
- "subfolder": "mcp"
11
- },
12
7
  "packages": [
13
8
  {
14
9
  "registryType": "npm",
15
10
  "identifier": "formlab-mcp",
16
- "version": "0.6.56",
11
+ "version": "0.6.57",
17
12
  "runtimeHint": "npx",
18
13
  "transport": {
19
14
  "type": "stdio"
@@ -22,7 +17,7 @@
22
17
  {
23
18
  "type": "positional",
24
19
  "name": "exportPath",
25
- "description": "File mode: absolute path to a FormLab export JSON (Data → Export JSON). Omit when using cloud mode (set FORMLAB_MCP_TOKEN instead).",
20
+ "description": "File mode: absolute path to a FormLab export JSON (Settings → Data → Export JSON). Omit when using cloud mode (set FORMLAB_MCP_TOKEN instead).",
26
21
  "isRequired": false,
27
22
  "format": "filepath",
28
23
  "value": "/path/to/formlab-export.json"
package/vendor/cost.js CHANGED
@@ -1867,7 +1867,7 @@ function _weighoutDensityLineHtml(w) {
1867
1867
  let src = d.how === 'measured' ? 'measured' : (d.how === 'spec' ? 'from spec' : 'entered');
1868
1868
  if (d.batchId && typeof db !== 'undefined') {
1869
1869
  const b = (db.batches || []).find(x => x.id === d.batchId);
1870
- if (b) src += ` on <a href="#" onclick="navigate('batch-detail','${esc(b.id)}');return false" style="color:var(--dk-blue-fg, #2563eb)">${esc(b.uid)}</a>`;
1870
+ if (b) src += ` on <a href="#" onclick="navigate('batch-detail','${escJsAttr(b.id)}');return false" style="color:var(--dk-blue-fg, #2563eb)">${esc(b.uid)}</a>`;
1871
1871
  }
1872
1872
  const parts = (w.partsSum != null && isFinite(w.partsSum) && Math.abs(w.partsSum - w.qty) > 1e-6)
1873
1873
  ? ` Pure-ingredient volumes sum to ${+w.partsSum.toFixed(2)} ${esc(w.unit)} — volumes aren't additive on mixing; the masses are what to weigh.` : '';
package/SUBMISSION.md DELETED
@@ -1,132 +0,0 @@
1
- # MCP submission — ready-to-paste materials
2
-
3
- Both directory paths are prepped. Path B is fastest; Path A is the canonical
4
- registry placement. Recommended order: B first (immediate discoverability),
5
- then A (long-term legitimacy).
6
-
7
- ---
8
-
9
- ## Path B — `awesome-mcp-servers` PR
10
-
11
- Three lists worth submitting to, in rough order of reach:
12
-
13
- 1. **[punkpeye/awesome-mcp-servers](https://github.com/punkpeye/awesome-mcp-servers)** (~50k stars, primary)
14
- 2. **[appcypher/awesome-mcp-servers](https://github.com/appcypher/awesome-mcp-servers)**
15
- 3. **[wong2/awesome-mcp-servers](https://github.com/wong2/awesome-mcp-servers)**
16
-
17
- ### Entry markdown (drop into the right category section)
18
-
19
- ```markdown
20
- - [**formlab-mcp**](https://github.com/juliu1980/FormLab/tree/main/mcp) - Local-first read access to your [FormLab](https://formvix.com) lab notebook — formulations, ingredients, batches, samples, test results, DOE matrices. Data stays on your machine; only the LLM's answer travels. [Listed in the official MCP Registry.](https://registry.modelcontextprotocol.io/?search=formlab) [![npm](https://img.shields.io/npm/v/formlab-mcp.svg)](https://www.npmjs.com/package/formlab-mcp)
21
- ```
22
-
23
- ### Suggested category
24
-
25
- Best fit on `punkpeye/awesome-mcp-servers`: **"📊 Data Science Tools"** or
26
- **"🔬 Knowledge & Memory"** depending on how the list is structured. Skim the
27
- TOC and pick whichever section already has domain-specific lab/research
28
- servers. If neither fits, **"🛠️ Other Tools and Integrations"** is the safe
29
- catch-all.
30
-
31
- ### PR title
32
-
33
- ```
34
- Add formlab-mcp — local-first lab-notebook server for chem/cosmetic R&D
35
- ```
36
-
37
- ### PR body
38
-
39
- ```markdown
40
- Adds **formlab-mcp**, a read-only MCP server that exposes a [FormLab](https://formvix.com)
41
- lab notebook export to Claude (or any MCP client). FormLab is a browser-based
42
- local-first ELN for formulation R&D — paints, coatings, cosmetics, polymers.
43
-
44
- The server lets users ask Claude things like _"which of my formulations use
45
- silicone fluid at 5%+?"_, _"compare FORM-001 and FORM-004 side by side"_,
46
- _"what parameters fail acceptance most often?"_, or _"show me the DOE matrix
47
- at sample grain for Anti-Aging Serum family"_ — all against a JSON export
48
- that stays on the user's laptop.
49
-
50
- **37 read-only tools** covering formulations, ingredients, batches, samples,
51
- test results, DOE matrices + saved designs, similarity, failure analysis,
52
- test-coverage AND composition design-space mapping (varying ingredients,
53
- untested gaps, PCA), equipment, test methods, panels, projects and ELN notes.
54
-
55
- - Repo: https://github.com/juliu1980/FormLab/tree/main/mcp
56
- - npm: https://www.npmjs.com/package/formlab-mcp
57
- - Listed in the official MCP Registry: `io.github.juliu1980/formlab-mcp`
58
- - Node 18+; runs via `npx formlab-mcp /path/to/export.json`
59
- - License: MIT
60
-
61
- Happy to move the entry to a different category if there's a better fit.
62
- ```
63
-
64
- ### Submission workflow
65
-
66
- For each fork target above:
67
-
68
- 1. Visit https://github.com/punkpeye/awesome-mcp-servers (or the alt)
69
- 2. Open `README.md` → click ✏ (Edit) → GitHub will fork on your behalf
70
- 3. Find the appropriate `###` category section
71
- 4. Paste the **Entry markdown** in alphabetical order within the section
72
- 5. Commit message: `Add formlab-mcp`
73
- 6. Open PR with the **PR title** and **PR body** above
74
-
75
- Total time for all three: ~15 minutes.
76
-
77
- ---
78
-
79
- ## Path A — Official MCP Registry
80
-
81
- This places `formlab-mcp` in `https://registry.modelcontextprotocol.io`,
82
- which is what future MCP-aware tools will query first.
83
-
84
- ### Prereqs
85
-
86
- ```bash
87
- # Go 1.24+ — needed to build mcp-publisher
88
- brew install go
89
-
90
- # Build the publisher CLI
91
- git clone https://github.com/modelcontextprotocol/registry
92
- cd registry
93
- make publisher # produces ./bin/mcp-publisher
94
- sudo mv bin/mcp-publisher /usr/local/bin/ # or add to PATH
95
- ```
96
-
97
- ### Manifest
98
-
99
- Already written to `mcp/server.json` in this repo. Uses:
100
- - Namespace: `io.github.juliu1980/formlab-mcp` (GitHub OAuth proves ownership)
101
- - Status: `active`
102
- - Repository: `https://github.com/juliu1980/FormLab` with subfolder `mcp`
103
- - Version: pulled from `package.json` (currently `0.6.12`)
104
- - Package: npm `formlab-mcp` with stdio transport + positional `exportPath` arg
105
-
106
- ### Publish (the OAuth step is interactive)
107
-
108
- ```bash
109
- cd ~/GitHub/formlab/mcp
110
- mcp-publisher login # opens GitHub OAuth in your browser as juliu1980
111
- mcp-publisher publish # reads server.json and submits
112
- ```
113
-
114
- ### Verify
115
-
116
- After publish, the server appears at:
117
- - `https://registry.modelcontextprotocol.io/v0/servers?search=formlab`
118
-
119
- ### Versioning future updates
120
-
121
- Bump `package.json` `version` AND `mcp/server.json`'s `version` + the package
122
- version, then re-run `mcp-publisher publish`. The CLI rejects duplicate
123
- version submissions.
124
-
125
- ---
126
-
127
- ## After both paths land
128
-
129
- - Post to X / LinkedIn announcing it (memory file has a draft)
130
- - Cross-post to r/cosmeticchemistry, r/paint, r/Chemistry — any lab-adjacent
131
- subreddits where local-first + AI lands well
132
- - Add a section to the formvix.com landing page linking to the registry entry
@@ -1 +0,0 @@
1
- {"ref":"ufizhypibwqqpavhxdwt","name":"FormLab","organization_id":"pbplgvokbayhflgrvygl","organization_slug":"pbplgvokbayhflgrvygl"}