wellness-nourish 0.1.0
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/LICENSE +21 -0
- package/README.md +146 -0
- package/SECURITY.md +9 -0
- package/dist/cli/commands.d.ts +3 -0
- package/dist/cli/commands.js +467 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/constants.d.ts +8 -0
- package/dist/constants.js +9 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +153 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/nourish-prompts.d.ts +2 -0
- package/dist/prompts/nourish-prompts.js +17 -0
- package/dist/prompts/nourish-prompts.js.map +1 -0
- package/dist/providers/open-food-facts.d.ts +5 -0
- package/dist/providers/open-food-facts.js +141 -0
- package/dist/providers/open-food-facts.js.map +1 -0
- package/dist/providers/usda.d.ts +6 -0
- package/dist/providers/usda.js +157 -0
- package/dist/providers/usda.js.map +1 -0
- package/dist/resources/nourish-resources.d.ts +2 -0
- package/dist/resources/nourish-resources.js +26 -0
- package/dist/resources/nourish-resources.js.map +1 -0
- package/dist/schemas/common.d.ts +224 -0
- package/dist/schemas/common.js +224 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/services/agent-manifest.d.ts +27 -0
- package/dist/services/agent-manifest.js +80 -0
- package/dist/services/agent-manifest.js.map +1 -0
- package/dist/services/capabilities.d.ts +12 -0
- package/dist/services/capabilities.js +27 -0
- package/dist/services/capabilities.js.map +1 -0
- package/dist/services/config.d.ts +3 -0
- package/dist/services/config.js +32 -0
- package/dist/services/config.js.map +1 -0
- package/dist/services/connection-status.d.ts +13 -0
- package/dist/services/connection-status.js +34 -0
- package/dist/services/connection-status.js.map +1 -0
- package/dist/services/food-normalization.d.ts +3 -0
- package/dist/services/food-normalization.js +14 -0
- package/dist/services/food-normalization.js.map +1 -0
- package/dist/services/format.d.ts +13 -0
- package/dist/services/format.js +58 -0
- package/dist/services/format.js.map +1 -0
- package/dist/services/goals-store.d.ts +7 -0
- package/dist/services/goals-store.js +87 -0
- package/dist/services/goals-store.js.map +1 -0
- package/dist/services/hydration-store.d.ts +12 -0
- package/dist/services/hydration-store.js +96 -0
- package/dist/services/hydration-store.js.map +1 -0
- package/dist/services/intake-store.d.ts +15 -0
- package/dist/services/intake-store.js +170 -0
- package/dist/services/intake-store.js.map +1 -0
- package/dist/services/meal-estimator.d.ts +22 -0
- package/dist/services/meal-estimator.js +178 -0
- package/dist/services/meal-estimator.js.map +1 -0
- package/dist/services/nutrients.d.ts +4 -0
- package/dist/services/nutrients.js +31 -0
- package/dist/services/nutrients.js.map +1 -0
- package/dist/services/portion-engine.d.ts +4 -0
- package/dist/services/portion-engine.js +50 -0
- package/dist/services/portion-engine.js.map +1 -0
- package/dist/services/privacy-audit.d.ts +12 -0
- package/dist/services/privacy-audit.js +19 -0
- package/dist/services/privacy-audit.js.map +1 -0
- package/dist/services/summary.d.ts +28 -0
- package/dist/services/summary.js +84 -0
- package/dist/services/summary.js.map +1 -0
- package/dist/services/usage-guide.d.ts +12 -0
- package/dist/services/usage-guide.js +57 -0
- package/dist/services/usage-guide.js.map +1 -0
- package/dist/tools/nourish-tools.d.ts +2 -0
- package/dist/tools/nourish-tools.js +603 -0
- package/dist/tools/nourish-tools.js.map +1 -0
- package/dist/types.d.ts +97 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/examples/claude-desktop.json +13 -0
- package/examples/codex.json +13 -0
- package/examples/cursor.json +13 -0
- package/examples/hermes.md +18 -0
- package/examples/openclaw.md +18 -0
- package/examples/windsurf.json +13 -0
- package/fixtures/open-food-facts/barcode-peanut-butter.json +23 -0
- package/fixtures/usda/food-banana.json +16 -0
- package/fixtures/usda/search-banana.json +17 -0
- package/package.json +52 -0
- package/server.json +16 -0
- package/tsconfig.json +21 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export type ResponseFormat = "json" | "markdown";
|
|
2
|
+
export type ProviderSource = "usda" | "open_food_facts" | "manual" | "estimate";
|
|
3
|
+
export type MealType = "breakfast" | "lunch" | "dinner" | "snack" | "other";
|
|
4
|
+
export interface NutrientMap {
|
|
5
|
+
calories_kcal?: number;
|
|
6
|
+
protein_g?: number;
|
|
7
|
+
carbohydrates_g?: number;
|
|
8
|
+
fat_g?: number;
|
|
9
|
+
fiber_g?: number;
|
|
10
|
+
sugar_g?: number;
|
|
11
|
+
saturated_fat_g?: number;
|
|
12
|
+
sodium_mg?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface SourceLicense {
|
|
15
|
+
name: string;
|
|
16
|
+
attribution: string;
|
|
17
|
+
share_alike: boolean;
|
|
18
|
+
url?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface FoodItem {
|
|
21
|
+
id: string;
|
|
22
|
+
source: ProviderSource;
|
|
23
|
+
source_id: string;
|
|
24
|
+
source_url?: string;
|
|
25
|
+
name: string;
|
|
26
|
+
brand?: string;
|
|
27
|
+
barcode?: string;
|
|
28
|
+
locale?: string;
|
|
29
|
+
serving?: {
|
|
30
|
+
quantity: number;
|
|
31
|
+
unit: string;
|
|
32
|
+
grams?: number;
|
|
33
|
+
};
|
|
34
|
+
available_portions: Array<{
|
|
35
|
+
label: string;
|
|
36
|
+
quantity: number;
|
|
37
|
+
unit: string;
|
|
38
|
+
grams?: number;
|
|
39
|
+
}>;
|
|
40
|
+
nutrients_per_100g: NutrientMap;
|
|
41
|
+
nutrients_per_serving?: NutrientMap;
|
|
42
|
+
data_quality: {
|
|
43
|
+
completeness: "low" | "medium" | "high";
|
|
44
|
+
confidence: number;
|
|
45
|
+
warnings: string[];
|
|
46
|
+
};
|
|
47
|
+
license: SourceLicense;
|
|
48
|
+
}
|
|
49
|
+
export interface IntakeEntry {
|
|
50
|
+
id: string;
|
|
51
|
+
timestamp: string;
|
|
52
|
+
date: string;
|
|
53
|
+
meal_type: MealType;
|
|
54
|
+
food_ref?: {
|
|
55
|
+
source: ProviderSource;
|
|
56
|
+
source_id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
};
|
|
59
|
+
custom_food?: FoodItem;
|
|
60
|
+
quantity: number;
|
|
61
|
+
unit: string;
|
|
62
|
+
grams_estimate?: number;
|
|
63
|
+
nutrients: NutrientMap;
|
|
64
|
+
confidence: number;
|
|
65
|
+
source_trace: "exact_food" | "barcode" | "estimate" | "manual" | "agent_inference";
|
|
66
|
+
notes?: string;
|
|
67
|
+
tags: string[];
|
|
68
|
+
wellness_context_refs: string[];
|
|
69
|
+
}
|
|
70
|
+
export interface HydrationEntry {
|
|
71
|
+
id: string;
|
|
72
|
+
timestamp: string;
|
|
73
|
+
date: string;
|
|
74
|
+
amount_ml: number;
|
|
75
|
+
source: "manual" | "agent";
|
|
76
|
+
notes?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface HydrationSummary {
|
|
79
|
+
date: string;
|
|
80
|
+
total_ml: number;
|
|
81
|
+
goal_ml?: number;
|
|
82
|
+
progress_percent?: number;
|
|
83
|
+
entries: HydrationEntry[];
|
|
84
|
+
}
|
|
85
|
+
export interface NourishGoals {
|
|
86
|
+
daily: NutrientMap;
|
|
87
|
+
hydration_ml?: number;
|
|
88
|
+
updated_at?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface NourishConfig {
|
|
91
|
+
local_dir: string;
|
|
92
|
+
fixture_mode: boolean;
|
|
93
|
+
usda_api_key?: string;
|
|
94
|
+
off_enabled: boolean;
|
|
95
|
+
cache_ttl_seconds: number;
|
|
96
|
+
max_results: number;
|
|
97
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Hermes
|
|
2
|
+
|
|
3
|
+
Use the package command as the MCP server command:
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"name": "nourish",
|
|
8
|
+
"command": "npx",
|
|
9
|
+
"args": ["-y", "wellness-nourish"],
|
|
10
|
+
"env": {
|
|
11
|
+
"FDC_API_KEY": "${FDC_API_KEY}",
|
|
12
|
+
"NOURISH_OFF_ENABLED": "1",
|
|
13
|
+
"NOURISH_LOCAL_DIR": "~/.wellness-nourish"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
After config changes, reload MCP and call `nourish_connection_status`, `nourish_capabilities`, and `nourish_agent_manifest`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# OpenClaw
|
|
2
|
+
|
|
3
|
+
Register `nourish` as a stdio MCP server:
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"name": "nourish",
|
|
8
|
+
"command": "npx",
|
|
9
|
+
"args": ["-y", "wellness-nourish"],
|
|
10
|
+
"env": {
|
|
11
|
+
"FDC_API_KEY": "${FDC_API_KEY}",
|
|
12
|
+
"NOURISH_OFF_ENABLED": "1",
|
|
13
|
+
"NOURISH_LOCAL_DIR": "~/.wellness-nourish"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Use direct MCP tools for reads and mutations. Agents should preview or summarize before logging, and only mutate intake, hydration, or goals after explicit user intent.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"code": "737628064502",
|
|
3
|
+
"status": 1,
|
|
4
|
+
"product": {
|
|
5
|
+
"code": "737628064502",
|
|
6
|
+
"product_name": "Peanut Butter",
|
|
7
|
+
"brands": "Fixture Foods",
|
|
8
|
+
"url": "https://world.openfoodfacts.org/product/737628064502",
|
|
9
|
+
"quantity": "454 g",
|
|
10
|
+
"serving_size": "2 tbsp (32 g)",
|
|
11
|
+
"serving_quantity": 32,
|
|
12
|
+
"nutriments": {
|
|
13
|
+
"energy-kcal_100g": 588,
|
|
14
|
+
"proteins_100g": 25,
|
|
15
|
+
"carbohydrates_100g": 20,
|
|
16
|
+
"fat_100g": 50,
|
|
17
|
+
"fiber_100g": 6,
|
|
18
|
+
"sugars_100g": 9,
|
|
19
|
+
"saturated-fat_100g": 10,
|
|
20
|
+
"sodium_100g": 0.4
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"fdcId": 173944,
|
|
3
|
+
"description": "Bananas, raw",
|
|
4
|
+
"dataType": "SR Legacy",
|
|
5
|
+
"foodNutrients": [
|
|
6
|
+
{ "nutrient": { "id": 1008 }, "amount": 89 },
|
|
7
|
+
{ "nutrient": { "id": 1003 }, "amount": 1.09 },
|
|
8
|
+
{ "nutrient": { "id": 1005 }, "amount": 22.84 },
|
|
9
|
+
{ "nutrient": { "id": 1004 }, "amount": 0.33 },
|
|
10
|
+
{ "nutrient": { "id": 1079 }, "amount": 2.6 },
|
|
11
|
+
{ "nutrient": { "id": 1063 }, "amount": 12.23 }
|
|
12
|
+
],
|
|
13
|
+
"foodPortions": [
|
|
14
|
+
{ "gramWeight": 118, "modifier": "1 medium" }
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"foods": [
|
|
3
|
+
{
|
|
4
|
+
"fdcId": 173944,
|
|
5
|
+
"description": "Bananas, raw",
|
|
6
|
+
"dataType": "SR Legacy",
|
|
7
|
+
"foodNutrients": [
|
|
8
|
+
{ "nutrientId": 1008, "value": 89 },
|
|
9
|
+
{ "nutrientId": 1003, "value": 1.09 },
|
|
10
|
+
{ "nutrientId": 1005, "value": 22.84 },
|
|
11
|
+
{ "nutrientId": 1004, "value": 0.33 },
|
|
12
|
+
{ "nutrientId": 1079, "value": 2.6 },
|
|
13
|
+
{ "nutrientId": 1063, "value": 12.23 }
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "wellness-nourish",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Standalone MCP server for nutrition search, intake, and meal summaries.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"wellness-nourish": "dist/index.js",
|
|
9
|
+
"nourish-mcp": "dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc -p tsconfig.json",
|
|
13
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
14
|
+
"prepack": "npm run build && node -e \"require('node:fs').accessSync('dist/index.js')\"",
|
|
15
|
+
"start": "node dist/index.js",
|
|
16
|
+
"dev": "tsx src/index.ts",
|
|
17
|
+
"smoke": "node scripts/smoke-tools.mjs",
|
|
18
|
+
"smoke:http": "node scripts/smoke-http.mjs",
|
|
19
|
+
"test:normalization": "node scripts/test-normalization.mjs",
|
|
20
|
+
"test:providers": "node scripts/test-providers.mjs",
|
|
21
|
+
"test:intake-store": "node scripts/test-intake-store.mjs",
|
|
22
|
+
"test:hydration-goals": "node scripts/test-hydration-goals.mjs",
|
|
23
|
+
"test:meal-estimator": "node scripts/test-meal-estimator.mjs",
|
|
24
|
+
"test:summary": "node scripts/test-summary.mjs",
|
|
25
|
+
"test:cli-ux": "node scripts/cli-ux-test.mjs",
|
|
26
|
+
"test:agent-readiness": "node scripts/agent-readiness-test.mjs",
|
|
27
|
+
"test:hermes-agent": "node scripts/hermes-agent-manifest-test.mjs",
|
|
28
|
+
"test:privacy": "node scripts/privacy-redaction-test.mjs",
|
|
29
|
+
"test": "npm run typecheck && npm run build && npm run test:normalization && npm run test:providers && npm run test:intake-store && npm run test:hydration-goals && npm run test:meal-estimator && npm run test:summary && npm run test:privacy && npm run smoke && npm run smoke:http && npm run test:cli-ux && npm run test:agent-readiness && npm run test:hermes-agent && npm run prepack"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=20"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://wellness.delx.ai/connectors/nourish",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/davidmosiah/wellness-nourish.git"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@modelcontextprotocol/sdk": "^1.21.0",
|
|
41
|
+
"cors": "^2.8.6",
|
|
42
|
+
"express": "^5.2.1",
|
|
43
|
+
"zod": "^4.4.3"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/cors": "^2.8.19",
|
|
47
|
+
"@types/express": "^5.0.6",
|
|
48
|
+
"@types/node": "^25.6.0",
|
|
49
|
+
"tsx": "^4.20.6",
|
|
50
|
+
"typescript": "^6.0.3"
|
|
51
|
+
}
|
|
52
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "io.github.davidmosiah/wellness-nourish",
|
|
3
|
+
"package": "wellness-nourish",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "Local MCP server for nutrition search, barcode lookup, intake logging, hydration, goals, exports, and meal summaries.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/davidmosiah/wellness-nourish"
|
|
9
|
+
},
|
|
10
|
+
"command": "npx",
|
|
11
|
+
"args": [
|
|
12
|
+
"-y",
|
|
13
|
+
"wellness-nourish"
|
|
14
|
+
],
|
|
15
|
+
"status": "active"
|
|
16
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"lib": ["ES2022"],
|
|
7
|
+
"rootDir": "src",
|
|
8
|
+
"outDir": "dist",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"noUncheckedIndexedAccess": true,
|
|
17
|
+
"exactOptionalPropertyTypes": true
|
|
18
|
+
},
|
|
19
|
+
"include": ["src/**/*.ts"],
|
|
20
|
+
"exclude": ["dist", "node_modules"]
|
|
21
|
+
}
|