formlab-mcp 0.6.92 → 0.6.93
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 +2 -2
- package/package.json +1 -1
- package/server.json +2 -2
- package/tools/ingredients.js +11 -0
package/README.md
CHANGED
|
@@ -36,11 +36,11 @@ Ask Claude (or another MCP client) things like:
|
|
|
36
36
|
| `compare_formulations` | Pairwise side-by-side composition diff |
|
|
37
37
|
| `list_ingredients` | Filtered list of raw materials. Filters: `family`, `supplier`, `name_contains`, `lot_number` (the ingredient a lot belongs to), `in_stock_only`, `ingredient_class` (small-molecule / surfactant / polymer / extract / fragrance / pigment / sequence / mixture), `sequence_contains` (e.g. `KTTKS` → Matrixyl), `taxon_contains` (e.g. `Centella`) |
|
|
38
38
|
| `get_ingredient` | Full record + supplier / **cost ($/kg)** / stock / chemical name / molecular weight / storage / formulations using it, plus **GHS safety** (pictograms, H/P codes, signal word), **per-jurisdiction regulatory status**, **approved sources** (the suppliers / manufacturers qualified to supply this material — ASL/AML), and **inventory lots** (balances + expiry + the source each was received from). Returns every class-specific sub-object when present: `sequence` (peptide / oligo), `taxon` (NCBI ID + scientific name), `ingredientClass`, `extractDetails`, `sequenceDetails`, `polymerDetails`, `surfactantDetails`, `pigmentDetails`, `fragranceDetails`, and its **custom fields** with units (`customFields`: protein / carb / fat in g/100g, solids %… — what theoretical parameters read), and its **reactive groups** (EEW, AHEW, OH number, NCO %, acid / amine value: as entered, in the datasheet's terms and meq/g, with any row the app ignores and why) |
|
|
39
|
-
| `list_lots` | Inventory lots across ingredients (each a received batch with its own remaining balance, supplier, expiry, **unit cost**, **status** — `active` / `hold` / `quarantine` / `rejected`; held lots are blocked from consumption, with a `holdReason` — and the **approved source** it was received from: `source.supplier` + `source.manufacturer`, where recalls hinge on the manufacturer). Each lot also reports its **Certificate of Analysis** (`coa`: linked, or matched by lot number) and `coaMissing` for an in-stock lot without one. Filters: `ingredient_id`, `lot_number`, `expiring_within_days`, `status` (e.g. `hold` to find lots held for a recall), `missing_coa` |
|
|
39
|
+
| `list_lots` | Inventory lots across ingredients (each a received batch with its own remaining balance, supplier, expiry, **unit cost**, **status** — `active` / `hold` / `quarantine` / `rejected`; held lots are blocked from consumption, with a `holdReason` and `holdAt` — and the **approved source** it was received from: `source.supplier` + `source.manufacturer`, where recalls hinge on the manufacturer). Each lot also reports its **Certificate of Analysis** (`coa`: linked, or matched by lot number) and `coaMissing` for an in-stock lot without one. Filters: `ingredient_id`, `lot_number`, `expiring_within_days`, `status` (e.g. `hold` to find lots held for a recall), `missing_coa` |
|
|
40
40
|
| `list_suppliers` | Supplier / manufacturer records with roll-ups — ingredients approved, lots received / on hand (+ value at paid cost), qualified / trial / disqualified source counts, last receipt; lots count by supplier **and** by manufacturer |
|
|
41
41
|
| `get_supplier` | One supplier in full: record, every ingredient it's an approved source for, every lot from it, and the **recall trace** (batches that consumed those lots → products, shipments, samples, sub-batches; lots on hold flagged) |
|
|
42
42
|
| `list_documents` | The document register (same as the app's Documents page): ingredient SDS / PDS / CoA / other with lot, version, source and expiry; test and notebook attachments; per-record uploads and links (formulas, batches, samples, suppliers, equipment…). File **metadata** only, never the text inside a file, with who added each file (`addedBy`) and when. Filters: `type`, `record`, `linked`, `query`, `lot`, `format`, `expiry`, `expiring_within_days`, `without_expiry`, `uploaded_within_days`, `added_by`. A `summary` block carries the page's tile counts: expired, expiring in 30 days, SDS/CoA without expiry, ingredients missing an SDS (+ coverage %), lots in stock without a CoA, added last 7 days |
|
|
43
|
-
| `list_inventory` | Portfolio stock rollup — one row per ingredient with on-hand qty, summed lot balance, nearest expiry,
|
|
43
|
+
| `list_inventory` | Portfolio stock rollup — one row per ingredient with on-hand qty, summed lot balance, nearest expiry, a low-stock flag (on-hand ≤ `reorderThreshold`, or zero), and stock on hold (`heldQty` plus `lotsOnHold`: lot number, quantity, reason, since; a held lot with stock left). Filters: `low_stock_only`, `expiring_within_days`, `on_hold_only`, `family` |
|
|
44
44
|
| `list_batches` | Filtered list of production / lab-prep events; each row has **`bestBy`**; filter by `best_by_before` (past best-by = today) or `lots_expire_first`, `on_hold`, `made_with_lot` (batches that drew from a recalled lot), `held_lot` (drew from any lot now on hold) |
|
|
45
45
|
| `get_batch` | Full record + **`lotsUsed`** (raw lots drawn, with each lot's status and hold reason now) + actual composition, measured/derived **actual volume** (mass ÷ density, never a sum of per-ingredient volumes) and **actual mass** (yield, else summed as-prepared inputs — mL rows through that ingredient's density — else measured volume × density), **estimatedVolume** (mass ÷ the formula's finished density when no actual exists, flagged `estimate: true`), **plannedMass** for volume-target batches (target × finished density) and **formulaFinishedDensity**, the **process** method + any **process-factor values** (DOE inputs), samples + blend lineage, and — as a finished-goods lot — its **`bestBy`** (the adjusted date with its change, reason, note and retest report, else prepared date + shelf life; `lotsExpiringFirst` = lots it drew from that expire sooner), its storage **`location`** + finished-goods **`stockLedger`** (shipments out + adjustments; `shippedQty` total), and its **theoretical parameters computed on the batch as made** (actual composition when logged — `basis: "actual"` — else the recipe; the batch's own parameter list when it overrides the formula's) |
|
|
46
46
|
| `list_samples` | Filtered list of physical specimens |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "formlab-mcp",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.93",
|
|
4
4
|
"mcpName": "io.github.juliu1980/formlab-mcp",
|
|
5
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
6
|
"homepage": "https://formvix.com/mcp",
|
package/server.json
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "io.github.juliu1980/formlab-mcp",
|
|
4
4
|
"description": "Read-only MCP server for FormLab formulation data: a local export file or your live cloud workspace.",
|
|
5
|
-
"version": "0.6.
|
|
5
|
+
"version": "0.6.93",
|
|
6
6
|
"websiteUrl": "https://formvix.com/mcp",
|
|
7
7
|
"packages": [
|
|
8
8
|
{
|
|
9
9
|
"registryType": "npm",
|
|
10
10
|
"identifier": "formlab-mcp",
|
|
11
|
-
"version": "0.6.
|
|
11
|
+
"version": "0.6.93",
|
|
12
12
|
"runtimeHint": "npx",
|
|
13
13
|
"transport": {
|
|
14
14
|
"type": "stdio"
|
package/tools/ingredients.js
CHANGED
|
@@ -220,6 +220,8 @@ const get_ingredient = {
|
|
|
220
220
|
qtyRemaining: l.qtyRemaining, qtyReceived: l.qtyReceived, unit: l.unit || '',
|
|
221
221
|
receivedDate: l.receivedDate || null, expiryDate: l.expiryDate || null,
|
|
222
222
|
supplier: l.supplier || '', supplierId: l.supplierId || null, status: l.status || 'active',
|
|
223
|
+
// 0.6.93: why and since when a lot is on hold (QC / recall).
|
|
224
|
+
hold: l.status === 'hold' ? { reason: l.holdReason || '', since: l.holdAt || null } : null,
|
|
223
225
|
sourceId: l.sourceId || null, source: _lotSourceInfo(l),
|
|
224
226
|
..._lotCoaInfo(l, ing),
|
|
225
227
|
}));
|
|
@@ -398,6 +400,7 @@ const list_lots = {
|
|
|
398
400
|
// 'hold' / 'quarantine' / 'rejected' lots are blocked from auto-consumption;
|
|
399
401
|
// holdReason explains a manual hold (QC / recall).
|
|
400
402
|
holdReason: l.holdReason || '',
|
|
403
|
+
holdAt: l.status === 'hold' ? (l.holdAt || null) : null, // 0.6.93: since when it is held
|
|
401
404
|
// A disposed lot: when, why, how much was written off (status is then "disposed").
|
|
402
405
|
disposal: l.status === 'disposed' ? { date: l.disposedAt || null, by: l.disposedBy || '', reason: l.disposeReason || '', note: l.disposeNote || '', qty: l.disposedQty ?? null } : null,
|
|
403
406
|
unitCost: (l.unitCost != null && l.unitCost !== '') ? l.unitCost : null,
|
|
@@ -424,6 +427,7 @@ const list_inventory = {
|
|
|
424
427
|
properties: {
|
|
425
428
|
low_stock_only: { type: 'boolean', description: 'Only ingredients flagged low (on-hand ≤ reorderThreshold, or on-hand is 0).' },
|
|
426
429
|
expiring_within_days: { type: 'number', description: 'Only ingredients with a lot expiring within this many days from now (already-expired lots always qualify).' },
|
|
430
|
+
on_hold_only: { type: 'boolean', description: 'Only ingredients with a lot on hold that still has stock (the app\'s Inventory "On hold" tile). heldQty says how much of the on-hand is held.' },
|
|
427
431
|
family: { type: 'string', description: 'Filter by ingredient family. Case-insensitive substring.' },
|
|
428
432
|
limit: { type: 'number', description: 'Max rows (default 200, max 1000).' },
|
|
429
433
|
},
|
|
@@ -453,6 +457,9 @@ const list_inventory = {
|
|
|
453
457
|
const expiries = lots.map(l => Date.parse(l.expiryDate)).filter(isFinite);
|
|
454
458
|
const nearestExpiryMs = expiries.length ? Math.min(...expiries) : null;
|
|
455
459
|
const lowStock = (onHand === 0) || (onHand != null && reorder != null && onHand <= reorder);
|
|
460
|
+
// 0.6.93: lots on hold with stock left. Held stock still counts in on-hand but can't be used until released.
|
|
461
|
+
const heldLots = lots.filter(l => l.status === 'hold' && Number(l.qtyRemaining) > 0);
|
|
462
|
+
const heldQty = heldLots.reduce((s, l) => s + Number(l.qtyRemaining), 0);
|
|
456
463
|
return {
|
|
457
464
|
id: i.id, uid: i.uid, name: i.name || '', family: i.family || '',
|
|
458
465
|
stockOnHand: onHand, stockUnit: i.stockUnit || null,
|
|
@@ -462,9 +469,12 @@ const list_inventory = {
|
|
|
462
469
|
nearestExpiry: nearestExpiryMs != null ? new Date(nearestExpiryMs).toISOString().slice(0, 10) : null,
|
|
463
470
|
daysToNearestExpiry: nearestExpiryMs != null ? Math.floor((nearestExpiryMs - nowMs) / 86400000) : null,
|
|
464
471
|
lowStock,
|
|
472
|
+
heldQty: heldLots.length ? +heldQty.toFixed(6) : 0,
|
|
473
|
+
lotsOnHold: heldLots.map(l => ({ lotNumber: l.lotNumber || l.uid || '', qty: Number(l.qtyRemaining), unit: l.unit || '', reason: l.holdReason || '', since: l.holdAt || null })),
|
|
465
474
|
};
|
|
466
475
|
}).filter(r => {
|
|
467
476
|
if (args.low_stock_only && !r.lowStock) return false;
|
|
477
|
+
if (args.on_hold_only && !(r.heldQty > 0)) return false;
|
|
468
478
|
if (args.expiring_within_days != null) {
|
|
469
479
|
if (r.daysToNearestExpiry == null) return false;
|
|
470
480
|
if (r.daysToNearestExpiry > args.expiring_within_days) return false;
|
|
@@ -480,6 +490,7 @@ const list_inventory = {
|
|
|
480
490
|
totalMatching: rows.length,
|
|
481
491
|
returned: Math.min(rows.length, limit),
|
|
482
492
|
lowStockCount: rows.filter(r => r.lowStock).length,
|
|
493
|
+
onHoldCount: rows.filter(r => r.heldQty > 0).length,
|
|
483
494
|
inventory: rows.slice(0, limit),
|
|
484
495
|
};
|
|
485
496
|
},
|