mcp-grocy 2.2.0 β†’ 2.6.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +125 -32
  3. package/build/resources/CHANGELOG.md +47 -0
  4. package/build/resources/DOCS.md +8 -3
  5. package/build/resources/README.md +125 -32
  6. package/build/resources/api-reference.md +88 -88
  7. package/build/resources/config.md +45 -17
  8. package/build/resources/examples.md +120 -221
  9. package/build/resources/installation.md +9 -14
  10. package/build/resources/response-format.md +29 -20
  11. package/build/version.js +2 -2
  12. package/package.json +50 -24
  13. package/build/api/client.js +0 -121
  14. package/build/config/index.js +0 -205
  15. package/build/main.js +0 -44
  16. package/build/server/http-server.js +0 -218
  17. package/build/server/mcp-server.js +0 -163
  18. package/build/server/resources.js +0 -60
  19. package/build/tools/base.js +0 -141
  20. package/build/tools/household/definitions.js +0 -157
  21. package/build/tools/household/handlers.js +0 -109
  22. package/build/tools/household/index.js +0 -25
  23. package/build/tools/index.js +0 -2
  24. package/build/tools/inventory/definitions.js +0 -379
  25. package/build/tools/inventory/handlers.js +0 -430
  26. package/build/tools/inventory/index.js +0 -32
  27. package/build/tools/module-loader.js +0 -151
  28. package/build/tools/recipes/definitions.js +0 -261
  29. package/build/tools/recipes/handlers.js +0 -471
  30. package/build/tools/recipes/index.js +0 -33
  31. package/build/tools/recipes/validations.js +0 -23
  32. package/build/tools/shopping/definitions.js +0 -71
  33. package/build/tools/shopping/handlers.js +0 -43
  34. package/build/tools/shopping/index.js +0 -14
  35. package/build/tools/system/definitions.js +0 -86
  36. package/build/tools/system/handlers.js +0 -94
  37. package/build/tools/system/index.js +0 -16
  38. package/build/tools/types.js +0 -1
  39. package/build/tools/validation-helpers.js +0 -36
  40. package/build/types/index.js +0 -62
  41. package/build/utils/errors.js +0 -138
  42. package/build/utils/logger.js +0 -141
@@ -1,40 +1,56 @@
1
- # MCP Grocy Configuration Guide
1
+ # mcp-grocy configuration guide
2
2
 
3
- Advanced configuration reference for the MCP Grocy server. For basic setup, see the [README](../../README.md).
3
+ Advanced configuration reference for the **mcp-grocy** npm package (this MCP server). It connects to your **Grocy** instance via `GROCY_BASE_URL` / `GROCY_API_KEY`. For basic setup, see the [README](../../README.md).
4
4
 
5
5
  ## πŸ”§ Configuration Variables
6
6
 
7
7
  ### Core Variables
8
8
 
9
- | Variable | Description | Default | Required |
10
- |----------|-------------|---------|----------|
11
- | `GROCY_BASE_URL` | Your Grocy instance URL | `http://localhost:9283` | βœ… |
12
- | `GROCY_API_KEY` | Your Grocy API key | - | βœ… |
9
+ | Variable | Description | Default | Required |
10
+ | ---------------- | ----------------------- | ----------------------- | -------- |
11
+ | `GROCY_BASE_URL` | Your Grocy instance URL | `http://localhost:9283` | βœ… |
12
+ | `GROCY_API_KEY` | Your Grocy API key | - | βœ… |
13
13
 
14
14
  ### Optional Variables
15
15
 
16
- | Variable | Description | Default | Example |
17
- |----------|-------------|---------|---------|
18
- | `GROCY_ENABLE_SSL_VERIFY` | SSL certificate verification | `true` | `false` |
19
- | `REST_RESPONSE_SIZE_LIMIT` | Response size limit (bytes) | `10000` | `50000` |
16
+ | Variable | Description | Default | Example |
17
+ | -------------------------- | ---------------------------- | ------- | ------- |
18
+ | `GROCY_ENABLE_SSL_VERIFY` | SSL certificate verification | `true` | `false` |
19
+ | `REST_RESPONSE_SIZE_LIMIT` | Response size limit (bytes) | `10000` | `50000` |
20
20
 
21
21
  ## 🌐 HTTP Server Configuration
22
22
 
23
23
  Enable HTTP/SSE transport for web-based access:
24
24
 
25
- | Variable | Description | Default | Example |
26
- |----------|-------------|---------|---------|
27
- | `ENABLE_HTTP_SERVER` | Enable HTTP/SSE transport | `false` | `true` |
28
- | `HTTP_SERVER_PORT` | HTTP server port | `8080` | `3000` |
25
+ | Variable | Description | Default | Example |
26
+ | ------------------------------- | ---------------------------------------------------- | -------- | -------- |
27
+ | `ENABLE_HTTP_SERVER` | Enable HTTP/SSE transport | `false` | `true` |
28
+ | `HTTP_SERVER_PORT` | HTTP server port | `8080` | `3000` |
29
+ | `MCP_SESSION_IDLE_TIMEOUT_MS` | Reap an idle MCP session after this many ms | `300000` | `600000` |
30
+ | `MCP_SESSION_SWEEP_INTERVAL_MS` | How often, in ms, to sweep for idle sessions to reap | `60000` | `30000` |
31
+
32
+ The matching YAML keys are `server.session_idle_timeout_ms` and `server.session_sweep_interval_ms`.
29
33
 
30
34
  ### Transport Modes
35
+
31
36
  - **stdio** (default) - Standard MCP protocol for CLI/desktop clients
32
37
  - **HTTP** - Streamable HTTP for web applications (`POST /mcp`)
33
38
  - **SSE** - Server-Sent Events for real-time web clients (`GET /mcp/sse`)
34
39
 
40
+ ### Session Reaping (HTTP mode)
41
+
42
+ In HTTP mode the server keeps a transport and per-session MCP server instance for
43
+ each session. Clients that disconnect without sending `DELETE /mcp`, or that
44
+ reconnect with a new session id, would otherwise leave those instances in memory.
45
+ The server reaps any session with no requests for `MCP_SESSION_IDLE_TIMEOUT_MS`,
46
+ freeing its resources. A reaped client transparently re-initializes on its next
47
+ request, so the default of 5 minutes is safe for normal use; lower it on
48
+ memory-constrained hosts or raise it if a client legitimately idles for long
49
+ periods between calls.
50
+
35
51
  ## πŸ› οΈ Tool Configuration
36
52
 
37
- Tools are configured using the YAML configuration file `mcp-grocy.yaml`.
53
+ Tools are configured using the YAML configuration file `mcp-grocy.yaml`.
38
54
 
39
55
  Copy `mcp-grocy.yaml.example` to `mcp-grocy.yaml` and customize the `tools` section to enable/disable specific functionality.
40
56
 
@@ -57,16 +73,19 @@ Configuration examples for common use cases are provided in `mcp-grocy.yaml.exam
57
73
  ## πŸ”’ Security Considerations
58
74
 
59
75
  ### API Key Security
76
+
60
77
  - Never commit API keys to version control
61
78
  - Use `.env` files for local development
62
79
  - Use secure environment variable management in production
63
80
 
64
81
  ### Tool Access Control
82
+
65
83
  - Disable unused tools to reduce attack surface
66
84
  - Use read-only mode for information-gathering use cases
67
85
  - Be cautious with tools that modify data (`inventory_transactions_purchase`, `inventory_stock_entry_consume`, etc.)
68
86
 
69
87
  ### Network Security
88
+
70
89
  - Use HTTPS for production Grocy instances
71
90
  - Consider SSL verification settings carefully
72
91
  - Limit response sizes to prevent memory issues
@@ -74,6 +93,7 @@ Configuration examples for common use cases are provided in `mcp-grocy.yaml.exam
74
93
  ## πŸ“ Environment File Examples
75
94
 
76
95
  ### Development Configuration
96
+
77
97
  ```bash
78
98
  # .env for development
79
99
  GROCY_BASE_URL=http://localhost:9283
@@ -87,6 +107,7 @@ HTTP_SERVER_PORT=8080
87
107
  ```
88
108
 
89
109
  ### Production Configuration
110
+
90
111
  ```bash
91
112
  # .env for production
92
113
  GROCY_BASE_URL=https://grocy.yourdomain.com
@@ -100,16 +121,19 @@ Tool configuration should be done via `mcp-grocy.yaml` file.
100
121
  ## πŸ”„ Configuration Management
101
122
 
102
123
  ### Loading Order
124
+
103
125
  1. Default values
104
126
  2. Environment variables
105
127
  3. `.env` file (if present)
106
128
 
107
129
  ### Validation
130
+
108
131
  - Server validates all tool names at startup
109
132
  - Invalid configuration prevents server start
110
133
  - Error messages show valid options
111
134
 
112
135
  ### Runtime Changes
136
+
113
137
  - Configuration changes require server restart
114
138
  - Use process managers (PM2, systemd) for production restarts
115
139
  - Docker containers need to be recreated with new environment
@@ -119,28 +143,32 @@ Tool configuration should be done via `mcp-grocy.yaml` file.
119
143
  ### Common Issues
120
144
 
121
145
  **Tool configuration not working**
146
+
122
147
  - Check YAML syntax and indentation
123
148
  - Verify tool names match current naming convention
124
149
  - Ensure `mcp-grocy.yaml` file is in the correct location
125
150
 
126
151
  **SSL/TLS connection errors**
152
+
127
153
  - Set `GROCY_ENABLE_SSL_VERIFY=false` for self-signed certificates
128
154
  - Verify Grocy URL is accessible
129
155
  - Check firewall and network settings
130
156
 
131
157
  **Large response errors**
158
+
132
159
  - Increase `REST_RESPONSE_SIZE_LIMIT`
133
160
  - Consider disabling unused tools to reduce response size
134
161
  - Check Grocy instance has reasonable data volumes
135
162
 
136
163
  ### Debugging Configuration
164
+
137
165
  ```bash
138
166
  # Use mock mode to test configuration
139
167
  npm run dev
140
168
 
141
- # Enable MCP inspector for protocol debugging
169
+ # Enable MCP inspector for protocol debugging
142
170
  npm run inspector
143
171
 
144
172
  # Check configuration loading
145
173
  # (Server logs show loaded configuration at startup)
146
- ```
174
+ ```
@@ -1,319 +1,218 @@
1
- # Grocy API Testing Examples
1
+ # Grocy MCP usage examples
2
2
 
3
- ## Setting Up Your Private Demo Instance
3
+ > **MCP server name:** Your client names this server in its config (`mcp-grocy`, `grocy`, etc.). The first argument to helpers like `use_mcp_tool` must match **your** setup. Examples below use `mcp-grocy`.
4
4
 
5
- Before testing the API, you can create your own private Grocy demo instance:
5
+ ## Setting up a private Grocy demo
6
6
 
7
7
  1. Visit [https://demo.grocy.info](https://demo.grocy.info).
8
- 2. Look for "Create a private demo instance" section
9
- 3. Create your personal instance which will remain available for testing
10
- 4. Use the provided API key and URL in your `.env` file:
8
+ 2. Use **Create a private demo instance**.
9
+ 3. Put URL and API key in `.env`:
10
+
11
11
  ```
12
12
  GROCY_BASE_URL=https://your-name-xxxxx.demo.grocy.info
13
13
  GROCY_API_KEY=your-private-api-key
14
14
  ```
15
15
 
16
- ⚠️ IMPORTANT: Only provide the endpoint path - do not include full URLs. Your path will be automatically resolved to the full URL.
16
+ For **`system_dev_call_api`** / **`system_dev_test_request`**, pass endpoint **paths** only (no full URL), e.g. `objects/products` or `/api/stock`β€”the client resolves them against `GROCY_BASE_URL`.
17
17
 
18
- For example, if the base URL is `https://your-own-demo.grocy.info`:
19
- βœ… Correct: `"/api/objects/products"` β†’ Resolves to: `https://your-own-demo.grocy.info/api/objects/products`
20
- ❌ Incorrect: `"https://your-own-demo.grocy.info/api/objects/products"` or `"www.grocy.example.com/api/objects/products"`
18
+ ## Inventory and shopping
21
19
 
22
- ## Basic API Tools
20
+ ### All stock entries
23
21
 
24
- ### Get Current Stock
25
22
  ```typescript
26
- use_mcp_tool('grocy-api', 'get_stock', {});
23
+ use_mcp_tool('mcp-grocy', 'inventory_stock_get_all', {});
27
24
  ```
28
25
 
29
- ### Get Volatile Stock Information
26
+ ### Volatile stock (due / overdue / missing)
27
+
30
28
  ```typescript
31
- use_mcp_tool('grocy-api', 'get_stock_volatile', {
32
- "includeDetails": true
29
+ use_mcp_tool('mcp-grocy', 'inventory_stock_get_volatile', {
30
+ includeDetails: true,
33
31
  });
34
32
  ```
35
33
 
36
- ### Get All Products
37
- ```typescript
38
- use_mcp_tool('grocy-api', 'get_products', {});
39
- ```
34
+ ### Products (pick fields)
40
35
 
41
- ### Get All Shopping List Items
42
36
  ```typescript
43
- use_mcp_tool('grocy-api', 'get_shopping_list', {});
37
+ use_mcp_tool('mcp-grocy', 'inventory_products_get', {
38
+ fields: ['id', 'name', 'description'],
39
+ });
44
40
  ```
45
41
 
46
- ### Add Item to Shopping List
42
+ ### Shopping list
43
+
47
44
  ```typescript
48
- use_mcp_tool('grocy-api', 'add_shopping_list_item', {
49
- "productId": 1,
50
- "amount": 2,
51
- "shoppingListId": 1,
52
- "note": "Get the organic variety"
45
+ use_mcp_tool('mcp-grocy', 'shopping_list_get', {});
46
+
47
+ use_mcp_tool('mcp-grocy', 'shopping_list_add_item', {
48
+ productId: 1,
49
+ amount: 2,
50
+ shoppingListId: 1,
51
+ note: 'Get the organic variety',
53
52
  });
54
53
  ```
55
54
 
56
- ### Purchase a Product
55
+ ### Purchase (product-level)
56
+
57
57
  ```typescript
58
- use_mcp_tool('grocy-api', 'inventory_transactions_purchase', {
59
- "productId": 1,
60
- "amount": 2,
61
- "bestBeforeDate": "2024-12-31",
62
- "price": 3.99,
63
- "storeId": 1
58
+ use_mcp_tool('mcp-grocy', 'inventory_transactions_purchase', {
59
+ productId: 1,
60
+ amount: 2,
61
+ bestBeforeDate: '2024-12-31',
62
+ price: 3.99,
63
+ locationId: 1,
64
64
  });
65
65
  ```
66
66
 
67
- ### Consume a Product
67
+ ### Consume one stock row (`stockId` from `inventory_stock_get_by_product`)
68
+
68
69
  ```typescript
69
- use_mcp_tool('grocy-api', 'inventory_stock_entry_consume', {
70
- "productId": 1,
71
- "amount": 1,
72
- "spoiled": false
70
+ use_mcp_tool('mcp-grocy', 'inventory_stock_entry_consume', {
71
+ stockId: 10,
72
+ productId: 1,
73
+ amount: 1,
74
+ spoiled: false,
73
75
  });
74
76
  ```
75
77
 
76
- ## Recipe and Meal Planning
78
+ ## Recipes and meal plan
79
+
80
+ ### List recipes (selected fields)
77
81
 
78
- ### Get All Recipes
79
82
  ```typescript
80
- use_mcp_tool('grocy-api', 'get_recipes', {});
83
+ use_mcp_tool('mcp-grocy', 'recipes_management_get', {
84
+ fields: ['id', 'name', 'description', 'base_servings'],
85
+ });
81
86
  ```
82
87
 
83
- ### Check Recipe Fulfillment
88
+ ### Fulfillment for one recipe
89
+
84
90
  ```typescript
85
- use_mcp_tool('grocy-api', 'get_recipe_fulfillment', {
86
- "recipeId": 1,
87
- "servings": 2
91
+ use_mcp_tool('mcp-grocy', 'recipes_fulfillment_get', {
92
+ recipeId: 1,
93
+ onlyMissing: false,
88
94
  });
89
95
  ```
90
96
 
91
- ### Get Meal Plan for a Date
97
+ ### Meal plan for a date
98
+
92
99
  ```typescript
93
- use_mcp_tool('grocy-api', 'get_meal_plan', {
94
- "date": "2024-07-01"
100
+ use_mcp_tool('mcp-grocy', 'recipes_mealplan_get', {
101
+ date: '2024-07-01',
102
+ weekly: false,
95
103
  });
96
104
  ```
97
105
 
98
- ### Get Meal Plan Sections
106
+ ### Meal plan sections (Breakfast / Dinner / …)
107
+
99
108
  ```typescript
100
- use_mcp_tool('grocy-api', 'get_meal_plan_sections', {});
109
+ use_mcp_tool('mcp-grocy', 'recipes_mealplan_get_sections', {});
101
110
  ```
102
111
 
103
- ### Add Recipe to Meal Plan
112
+ ### Add recipe to meal plan
113
+
104
114
  ```typescript
105
- use_mcp_tool('grocy-api', 'add_recipe_to_meal_plan', {
106
- "recipeId": 1,
107
- "day": "2024-07-01",
108
- "servings": 2,
109
- "section_id": 3
115
+ use_mcp_tool('mcp-grocy', 'recipes_mealplan_add_recipe', {
116
+ recipeId: 1,
117
+ day: '2024-07-01',
118
+ servings: 2,
119
+ sectionId: 3,
110
120
  });
111
121
  ```
112
122
 
113
- Note: Use get_meal_plan_sections to find valid section IDs for your Grocy instance.
123
+ Use **`recipes_mealplan_get_sections`** for valid `sectionId` values.
124
+
125
+ ### Remove a meal plan entry
114
126
 
115
- ### Delete Recipe from Meal Plan
116
127
  ```typescript
117
- use_mcp_tool('grocy-api', 'delete_recipe_from_meal_plan', {
118
- "date": "2024-07-01",
119
- "meal_plan_entry_id": 123
128
+ use_mcp_tool('mcp-grocy', 'recipes_mealplan_delete_entry', {
129
+ mealPlanEntryId: 123,
120
130
  });
121
131
  ```
122
132
 
123
- Note: Use get_meal_plan to find the meal_plan_entry_id of the entry you want to remove.
133
+ Use **`recipes_mealplan_get`** to find `mealPlanEntryId`.
134
+
135
+ ### Cook / consume recipe ingredients
124
136
 
125
- ### Consume Recipe Ingredients
126
137
  ```typescript
127
- use_mcp_tool('grocy-api', 'consume_recipe', {
128
- "recipeId": 1,
129
- "servings": 2
138
+ use_mcp_tool('mcp-grocy', 'recipes_cooking_consume', {
139
+ recipeId: 1,
140
+ servings: 2,
130
141
  });
131
142
  ```
132
143
 
133
- ## Chores and Tasks
144
+ ## Chores, tasks, locations
145
+
146
+ ### Chores (recurring) vs tasks (to-dos)
134
147
 
135
- ### Get All Chores
136
148
  ```typescript
137
- use_mcp_tool('grocy-api', 'get_chores', {});
149
+ use_mcp_tool('mcp-grocy', 'household_chores_get', {});
150
+ use_mcp_tool('mcp-grocy', 'household_tasks_get', {});
138
151
  ```
139
152
 
140
- ### Track Chore Execution
153
+ ### Track chore execution
154
+
141
155
  ```typescript
142
- use_mcp_tool('grocy-api', 'track_chore_execution', {
143
- "choreId": 1,
144
- "executedBy": 1,
145
- "tracked_time": "2024-06-30 15:30:00"
156
+ use_mcp_tool('mcp-grocy', 'household_chores_execute', {
157
+ choreId: 1,
158
+ executedBy: 1,
159
+ trackedTime: '2024-06-30 15:30:00',
146
160
  });
147
161
  ```
148
162
 
149
- ### Get All Tasks
150
- ```typescript
151
- use_mcp_tool('grocy-api', 'get_tasks', {});
152
- ```
163
+ ### Complete a task
153
164
 
154
- ### Complete a Task
155
165
  ```typescript
156
- use_mcp_tool('grocy-api', 'complete_task', {
157
- "taskId": 1,
158
- "note": "Task completed successfully"
166
+ use_mcp_tool('mcp-grocy', 'household_tasks_complete', {
167
+ taskId: 1,
168
+ note: 'Task completed successfully',
159
169
  });
160
170
  ```
161
171
 
162
- ## Locations and Organization
172
+ ### Storage locations vs shopping (store) locations
163
173
 
164
- ### Get All Locations
165
174
  ```typescript
166
- use_mcp_tool('grocy-api', 'get_locations', {});
175
+ use_mcp_tool('mcp-grocy', 'system_locations_get', {});
176
+ use_mcp_tool('mcp-grocy', 'shopping_locations_get', {});
167
177
  ```
168
178
 
169
- ### Get All Shopping Locations (Stores)
170
- ```typescript
171
- use_mcp_tool('grocy-api', 'get_shopping_locations', {});
172
- ```
179
+ ### Transfer one stock row to another location
173
180
 
174
- ### Transfer Product Between Locations
175
181
  ```typescript
176
- use_mcp_tool('grocy-api', 'inventory_stock_entry_transfer', {
177
- "productId": 1,
178
- "amount": 1,
179
- "locationIdFrom": 1,
180
- "locationIdTo": 2,
181
- "note": "Moving to kitchen"
182
+ use_mcp_tool('mcp-grocy', 'inventory_stock_entry_transfer', {
183
+ stockId: 10,
184
+ productId: 1,
185
+ amount: 1,
186
+ locationIdTo: 2,
187
+ note: 'Moving to kitchen',
182
188
  });
183
189
  ```
184
190
 
185
- ## Advanced API Usage
191
+ For moving by product without a `stockId`, use **`inventory_transactions_transfer`**.
192
+
193
+ ## Advanced / escape hatches
186
194
 
187
- ### Custom API Call
188
- If you need to access a Grocy API endpoint not covered by the specialized tools:
195
+ ### Arbitrary Grocy API object path
189
196
 
190
197
  ```typescript
191
- use_mcp_tool('grocy-api', 'call_grocy_api', {
192
- "endpoint": "objects/product_barcodes",
193
- "method": "GET"
198
+ use_mcp_tool('mcp-grocy', 'system_dev_call_api', {
199
+ endpoint: 'objects/product_barcodes',
200
+ method: 'GET',
194
201
  });
195
202
  ```
196
203
 
197
- ### Raw API Testing
198
- For detailed testing with full control over the request:
204
+ ### Raw request with full diagnostics
199
205
 
200
206
  ```typescript
201
- use_mcp_tool('grocy-api', 'test_request', {
202
- "method": "GET",
203
- "endpoint": "/api/stock/products/by-barcode/1234567890",
204
- "headers": {
205
- "Accept-Language": "en-US"
206
- }
207
+ use_mcp_tool('mcp-grocy', 'system_dev_test_request', {
208
+ method: 'GET',
209
+ endpoint: '/api/stock/products/by-barcode/1234567890',
210
+ headers: {
211
+ 'Accept-Language': 'en-US',
212
+ },
207
213
  });
208
214
  ```
209
215
 
210
- # MCP Grocy API - Endpoint Reference
211
-
212
- This document provides a comprehensive reference of all available endpoints in the MCP Grocy API.
213
-
214
- ## Recipes
215
-
216
- ### GET `/api/grocy/recipes`
217
- Retrieves a list of all recipes.
218
-
219
- **Response:**
220
- ```json
221
- [
222
- {
223
- "id": 1,
224
- "name": "Pizza",
225
- "description": "Homemade pizza recipe"
226
- }
227
- ]
228
- ```
216
+ ## Tool reference
229
217
 
230
- ### GET `/api/grocy/recipes/:recipeId`
231
- Retrieves details of a specific recipe by ID.
232
-
233
- **Parameters:**
234
- - `recipeId`: ID of the recipe to retrieve
235
-
236
- **Response:**
237
- ```json
238
- {
239
- "id": 1,
240
- "name": "Pizza",
241
- "description": "Homemade pizza recipe",
242
- "base_servings": 4,
243
- "desired_servings": 4,
244
- "preparation": "Mix ingredients and bake at 450Β°F"
245
- }
246
-
247
- ### Get Recipe Fulfillment
248
- - **GET** `/api/grocy/recipes/:recipeId/fulfillment`
249
- - Returns fulfillment information for a specific recipe including:
250
- - Whether ingredients are in stock
251
- - Missing products count
252
- - Costs
253
- - Calories
254
- - Due score
255
-
256
- ### Get All Recipes Fulfillment
257
- - **GET** `/api/grocy/recipes-fulfillment`
258
- - Returns fulfillment information for all recipes including:
259
- - Recipe ID
260
- - Fulfillment status
261
- - Missing products count
262
- - Costs
263
-
264
- ### Add Not Fulfilled Products to Shopping List
265
- - **POST** `/api/grocy/recipes/:recipeId/add-not-fulfilled-products-to-shoppinglist`
266
- - Adds all missing ingredients for a recipe to the shopping list
267
- - Returns the result of the operation
268
-
269
- ## Stock
270
-
271
- ### Get All Stock
272
- - **GET** `/api/grocy/stock`
273
- - Returns a list of all stock items
274
-
275
- ### Get Stock Item by ID
276
- - **GET** `/api/grocy/stock/:stockId`
277
- - Returns details of a specific stock item
278
-
279
- ## Chores
280
-
281
- ### Get All Chores
282
- - **GET** `/api/grocy/chores`
283
- - Returns a list of all chores
284
-
285
- ### Undo Chore Execution
286
- - **POST** `/api/grocy/chores/executions/:executionId/undo`
287
- - Undoes a chore execution
288
- - Returns the result of the operation
289
-
290
- ## Batteries
291
-
292
- ### Get All Batteries
293
- - **GET** `/api/grocy/batteries`
294
- - Returns a list of all batteries
295
-
296
- ### Undo Battery Charge Cycle
297
- - **POST** `/api/grocy/batteries/charge-cycles/:chargeCycleId/undo`
298
- - Undoes a battery charge cycle
299
- - Returns the result of the operation
300
-
301
- ## Tasks
302
-
303
- ### Get All Tasks
304
- - **GET** `/api/grocy/tasks`
305
- - Returns a list of all tasks
306
-
307
- ### Undo Task Completion
308
- - **POST** `/api/grocy/tasks/:taskId/undo`
309
- - Undoes a task completion
310
- - Returns the result of the operation
311
-
312
- ## Generic Undo Endpoint
313
-
314
- ### Undo Action
315
- - **POST** `/api/grocy/undo/:entityType/:id`
316
- - Unified endpoint for undoing various actions
317
- - `entityType` can be 'chores', 'batteries', or 'tasks'
318
- - `id` is the ID of the execution, charge cycle, or task
319
- - Returns the result of the undo operation
218
+ Authoritative names and parameters live in **`src/tools/*/definitions.ts`** in this repository. Grocy’s own HTTP API is documented at [Grocy API](https://github.com/grocy/grocy#api).
@@ -11,10 +11,7 @@ Edit `claude_desktop_config.json`(for Claude Desktop) or `.cursor/mcp.json`(for
11
11
  "mcpServers": {
12
12
  "mcp-grocy": {
13
13
  "command": "npx",
14
- "args": [
15
- "-y",
16
- "miguelangel-nubla/mcp-grocy"
17
- ],
14
+ "args": ["-y", "miguelangel-nubla/mcp-grocy"],
18
15
  "env": {
19
16
  "GROCY_BASE_URL": "",
20
17
  "GROCY_API_KEY": "",
@@ -25,20 +22,15 @@ Edit `claude_desktop_config.json`(for Claude Desktop) or `.cursor/mcp.json`(for
25
22
  }
26
23
  }
27
24
  ```
25
+
28
26
  Or you can use Docker:
27
+
29
28
  ```json
30
29
  {
31
30
  "mcpServers": {
32
31
  "mcp-grocy": {
33
32
  "command": "docker",
34
- "args": [
35
- "run",
36
- "ghcr.io/miguelangel-nubla/mcp-grocy",
37
- "tini",
38
- "--",
39
- "node",
40
- "build/main.js"
41
- ],
33
+ "args": ["run", "ghcr.io/miguelangel-nubla/mcp-grocy", "tini", "--", "node", "build/main.js"],
42
34
  "env": {
43
35
  "GROCY_BASE_URL": "",
44
36
  "GROCY_API_KEY": "",
@@ -55,12 +47,14 @@ Or you can use Docker:
55
47
  To install using Node.js, you will need to have Node.js and npm (or yarn) installed.
56
48
 
57
49
  Clone the repository:
50
+
58
51
  ```bash
59
52
  git clone -b main https://github.com/miguelangel-nubla/mcp-grocy.git
60
53
  cd mcp-grocy
61
54
  ```
62
55
 
63
56
  Install dependencies:
57
+
64
58
  ```bash
65
59
  npm install
66
60
  # or
@@ -68,6 +62,7 @@ yarn install
68
62
  ```
69
63
 
70
64
  Then you can run the server:
65
+
71
66
  ```bash
72
67
  npm start
73
68
  # or
@@ -76,7 +71,7 @@ yarn start
76
71
 
77
72
  ## npx
78
73
 
79
- You can also run the server directly using npx (Node.js 12.x or newer):
74
+ You can also run the server directly using npx (Node.js 22 or newer; see `package.json` `engines`):
80
75
 
81
76
  ```bash
82
77
  npx -y mcp-grocy
@@ -114,4 +109,4 @@ HTTP_SERVER_PORT=8080 # (optional, default: 8080)
114
109
  - POST requests to `/mcp` for streamable HTTP (NDJSON or JSON)
115
110
  - GET requests to `/mcp/sse` for SSE (Server-Sent Events)
116
111
 
117
- All transports use the same MCP protocol and core logic.
112
+ All transports use the same MCP protocol and core logic.