mcp-grocy 2.2.0 β†’ 2.5.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 (40) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +112 -32
  3. package/build/api/client.js +11 -13
  4. package/build/config/index.js +74 -20
  5. package/build/resources/CHANGELOG.md +31 -0
  6. package/build/resources/DOCS.md +8 -3
  7. package/build/resources/README.md +112 -32
  8. package/build/resources/api-reference.md +88 -88
  9. package/build/resources/config.md +30 -17
  10. package/build/resources/examples.md +120 -221
  11. package/build/resources/installation.md +9 -14
  12. package/build/resources/response-format.md +18 -13
  13. package/build/server/http-server.js +154 -42
  14. package/build/server/mcp-server.js +143 -96
  15. package/build/server/resources.js +37 -24
  16. package/build/server/tool-input-zod.js +86 -0
  17. package/build/tools/base.js +19 -15
  18. package/build/tools/household/definitions.js +47 -43
  19. package/build/tools/household/handlers.js +2 -2
  20. package/build/tools/household/index.js +2 -2
  21. package/build/tools/inventory/definitions.js +150 -113
  22. package/build/tools/inventory/handlers.js +55 -42
  23. package/build/tools/inventory/index.js +2 -2
  24. package/build/tools/module-loader.js +15 -12
  25. package/build/tools/recipes/definitions.js +103 -86
  26. package/build/tools/recipes/handlers.js +44 -38
  27. package/build/tools/recipes/index.js +3 -3
  28. package/build/tools/recipes/validations.js +8 -2
  29. package/build/tools/shopping/definitions.js +22 -20
  30. package/build/tools/shopping/handlers.js +1 -1
  31. package/build/tools/shopping/index.js +2 -2
  32. package/build/tools/system/definitions.js +25 -22
  33. package/build/tools/system/handlers.js +74 -12
  34. package/build/tools/system/index.js +2 -2
  35. package/build/tools/validation-helpers.js +10 -7
  36. package/build/types/index.js +12 -10
  37. package/build/utils/errors.js +10 -5
  38. package/build/utils/logger.js +16 -15
  39. package/build/version.js +2 -2
  40. package/package.json +38 -23
@@ -1,40 +1,41 @@
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
29
 
30
30
  ### Transport Modes
31
+
31
32
  - **stdio** (default) - Standard MCP protocol for CLI/desktop clients
32
33
  - **HTTP** - Streamable HTTP for web applications (`POST /mcp`)
33
34
  - **SSE** - Server-Sent Events for real-time web clients (`GET /mcp/sse`)
34
35
 
35
36
  ## πŸ› οΈ Tool Configuration
36
37
 
37
- Tools are configured using the YAML configuration file `mcp-grocy.yaml`.
38
+ Tools are configured using the YAML configuration file `mcp-grocy.yaml`.
38
39
 
39
40
  Copy `mcp-grocy.yaml.example` to `mcp-grocy.yaml` and customize the `tools` section to enable/disable specific functionality.
40
41
 
@@ -57,16 +58,19 @@ Configuration examples for common use cases are provided in `mcp-grocy.yaml.exam
57
58
  ## πŸ”’ Security Considerations
58
59
 
59
60
  ### API Key Security
61
+
60
62
  - Never commit API keys to version control
61
63
  - Use `.env` files for local development
62
64
  - Use secure environment variable management in production
63
65
 
64
66
  ### Tool Access Control
67
+
65
68
  - Disable unused tools to reduce attack surface
66
69
  - Use read-only mode for information-gathering use cases
67
70
  - Be cautious with tools that modify data (`inventory_transactions_purchase`, `inventory_stock_entry_consume`, etc.)
68
71
 
69
72
  ### Network Security
73
+
70
74
  - Use HTTPS for production Grocy instances
71
75
  - Consider SSL verification settings carefully
72
76
  - Limit response sizes to prevent memory issues
@@ -74,6 +78,7 @@ Configuration examples for common use cases are provided in `mcp-grocy.yaml.exam
74
78
  ## πŸ“ Environment File Examples
75
79
 
76
80
  ### Development Configuration
81
+
77
82
  ```bash
78
83
  # .env for development
79
84
  GROCY_BASE_URL=http://localhost:9283
@@ -87,6 +92,7 @@ HTTP_SERVER_PORT=8080
87
92
  ```
88
93
 
89
94
  ### Production Configuration
95
+
90
96
  ```bash
91
97
  # .env for production
92
98
  GROCY_BASE_URL=https://grocy.yourdomain.com
@@ -100,16 +106,19 @@ Tool configuration should be done via `mcp-grocy.yaml` file.
100
106
  ## πŸ”„ Configuration Management
101
107
 
102
108
  ### Loading Order
109
+
103
110
  1. Default values
104
111
  2. Environment variables
105
112
  3. `.env` file (if present)
106
113
 
107
114
  ### Validation
115
+
108
116
  - Server validates all tool names at startup
109
117
  - Invalid configuration prevents server start
110
118
  - Error messages show valid options
111
119
 
112
120
  ### Runtime Changes
121
+
113
122
  - Configuration changes require server restart
114
123
  - Use process managers (PM2, systemd) for production restarts
115
124
  - Docker containers need to be recreated with new environment
@@ -119,28 +128,32 @@ Tool configuration should be done via `mcp-grocy.yaml` file.
119
128
  ### Common Issues
120
129
 
121
130
  **Tool configuration not working**
131
+
122
132
  - Check YAML syntax and indentation
123
133
  - Verify tool names match current naming convention
124
134
  - Ensure `mcp-grocy.yaml` file is in the correct location
125
135
 
126
136
  **SSL/TLS connection errors**
137
+
127
138
  - Set `GROCY_ENABLE_SSL_VERIFY=false` for self-signed certificates
128
139
  - Verify Grocy URL is accessible
129
140
  - Check firewall and network settings
130
141
 
131
142
  **Large response errors**
143
+
132
144
  - Increase `REST_RESPONSE_SIZE_LIMIT`
133
145
  - Consider disabling unused tools to reduce response size
134
146
  - Check Grocy instance has reasonable data volumes
135
147
 
136
148
  ### Debugging Configuration
149
+
137
150
  ```bash
138
151
  # Use mock mode to test configuration
139
152
  npm run dev
140
153
 
141
- # Enable MCP inspector for protocol debugging
154
+ # Enable MCP inspector for protocol debugging
142
155
  npm run inspector
143
156
 
144
157
  # Check configuration loading
145
158
  # (Server logs show loaded configuration at startup)
146
- ```
159
+ ```
@@ -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.