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.
- package/CHANGELOG.md +45 -0
- package/README.md +125 -32
- package/build/resources/CHANGELOG.md +47 -0
- package/build/resources/DOCS.md +8 -3
- package/build/resources/README.md +125 -32
- package/build/resources/api-reference.md +88 -88
- package/build/resources/config.md +45 -17
- package/build/resources/examples.md +120 -221
- package/build/resources/installation.md +9 -14
- package/build/resources/response-format.md +29 -20
- package/build/version.js +2 -2
- package/package.json +50 -24
- package/build/api/client.js +0 -121
- package/build/config/index.js +0 -205
- package/build/main.js +0 -44
- package/build/server/http-server.js +0 -218
- package/build/server/mcp-server.js +0 -163
- package/build/server/resources.js +0 -60
- package/build/tools/base.js +0 -141
- package/build/tools/household/definitions.js +0 -157
- package/build/tools/household/handlers.js +0 -109
- package/build/tools/household/index.js +0 -25
- package/build/tools/index.js +0 -2
- package/build/tools/inventory/definitions.js +0 -379
- package/build/tools/inventory/handlers.js +0 -430
- package/build/tools/inventory/index.js +0 -32
- package/build/tools/module-loader.js +0 -151
- package/build/tools/recipes/definitions.js +0 -261
- package/build/tools/recipes/handlers.js +0 -471
- package/build/tools/recipes/index.js +0 -33
- package/build/tools/recipes/validations.js +0 -23
- package/build/tools/shopping/definitions.js +0 -71
- package/build/tools/shopping/handlers.js +0 -43
- package/build/tools/shopping/index.js +0 -14
- package/build/tools/system/definitions.js +0 -86
- package/build/tools/system/handlers.js +0 -94
- package/build/tools/system/index.js +0 -16
- package/build/tools/types.js +0 -1
- package/build/tools/validation-helpers.js +0 -36
- package/build/types/index.js +0 -62
- package/build/utils/errors.js +0 -138
- package/build/utils/logger.js +0 -141
|
@@ -1,40 +1,56 @@
|
|
|
1
|
-
#
|
|
1
|
+
# mcp-grocy configuration guide
|
|
2
2
|
|
|
3
|
-
Advanced configuration reference for the MCP
|
|
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
|
|
10
|
-
|
|
11
|
-
| `GROCY_BASE_URL` | Your Grocy instance URL | `http://localhost:9283` | β
|
|
12
|
-
| `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
|
|
17
|
-
|
|
18
|
-
| `GROCY_ENABLE_SSL_VERIFY`
|
|
19
|
-
| `REST_RESPONSE_SIZE_LIMIT` | Response size limit (bytes)
|
|
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
|
|
26
|
-
|
|
27
|
-
| `ENABLE_HTTP_SERVER`
|
|
28
|
-
| `HTTP_SERVER_PORT`
|
|
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
|
|
1
|
+
# Grocy MCP usage examples
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
5
|
+
## Setting up a private Grocy demo
|
|
6
6
|
|
|
7
7
|
1. Visit [https://demo.grocy.info](https://demo.grocy.info).
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
20
|
+
### All stock entries
|
|
23
21
|
|
|
24
|
-
### Get Current Stock
|
|
25
22
|
```typescript
|
|
26
|
-
use_mcp_tool('grocy
|
|
23
|
+
use_mcp_tool('mcp-grocy', 'inventory_stock_get_all', {});
|
|
27
24
|
```
|
|
28
25
|
|
|
29
|
-
###
|
|
26
|
+
### Volatile stock (due / overdue / missing)
|
|
27
|
+
|
|
30
28
|
```typescript
|
|
31
|
-
use_mcp_tool('grocy
|
|
32
|
-
|
|
29
|
+
use_mcp_tool('mcp-grocy', 'inventory_stock_get_volatile', {
|
|
30
|
+
includeDetails: true,
|
|
33
31
|
});
|
|
34
32
|
```
|
|
35
33
|
|
|
36
|
-
###
|
|
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
|
|
37
|
+
use_mcp_tool('mcp-grocy', 'inventory_products_get', {
|
|
38
|
+
fields: ['id', 'name', 'description'],
|
|
39
|
+
});
|
|
44
40
|
```
|
|
45
41
|
|
|
46
|
-
###
|
|
42
|
+
### Shopping list
|
|
43
|
+
|
|
47
44
|
```typescript
|
|
48
|
-
use_mcp_tool('grocy
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
55
|
+
### Purchase (product-level)
|
|
56
|
+
|
|
57
57
|
```typescript
|
|
58
|
-
use_mcp_tool('grocy
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
|
67
|
+
### Consume one stock row (`stockId` from `inventory_stock_get_by_product`)
|
|
68
|
+
|
|
68
69
|
```typescript
|
|
69
|
-
use_mcp_tool('grocy
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
##
|
|
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
|
|
83
|
+
use_mcp_tool('mcp-grocy', 'recipes_management_get', {
|
|
84
|
+
fields: ['id', 'name', 'description', 'base_servings'],
|
|
85
|
+
});
|
|
81
86
|
```
|
|
82
87
|
|
|
83
|
-
###
|
|
88
|
+
### Fulfillment for one recipe
|
|
89
|
+
|
|
84
90
|
```typescript
|
|
85
|
-
use_mcp_tool('grocy
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
use_mcp_tool('mcp-grocy', 'recipes_fulfillment_get', {
|
|
92
|
+
recipeId: 1,
|
|
93
|
+
onlyMissing: false,
|
|
88
94
|
});
|
|
89
95
|
```
|
|
90
96
|
|
|
91
|
-
###
|
|
97
|
+
### Meal plan for a date
|
|
98
|
+
|
|
92
99
|
```typescript
|
|
93
|
-
use_mcp_tool('grocy
|
|
94
|
-
|
|
100
|
+
use_mcp_tool('mcp-grocy', 'recipes_mealplan_get', {
|
|
101
|
+
date: '2024-07-01',
|
|
102
|
+
weekly: false,
|
|
95
103
|
});
|
|
96
104
|
```
|
|
97
105
|
|
|
98
|
-
###
|
|
106
|
+
### Meal plan sections (Breakfast / Dinner / β¦)
|
|
107
|
+
|
|
99
108
|
```typescript
|
|
100
|
-
use_mcp_tool('grocy
|
|
109
|
+
use_mcp_tool('mcp-grocy', 'recipes_mealplan_get_sections', {});
|
|
101
110
|
```
|
|
102
111
|
|
|
103
|
-
### Add
|
|
112
|
+
### Add recipe to meal plan
|
|
113
|
+
|
|
104
114
|
```typescript
|
|
105
|
-
use_mcp_tool('grocy
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
|
|
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
|
|
118
|
-
|
|
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
|
-
|
|
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
|
|
128
|
-
|
|
129
|
-
|
|
138
|
+
use_mcp_tool('mcp-grocy', 'recipes_cooking_consume', {
|
|
139
|
+
recipeId: 1,
|
|
140
|
+
servings: 2,
|
|
130
141
|
});
|
|
131
142
|
```
|
|
132
143
|
|
|
133
|
-
## Chores
|
|
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
|
|
149
|
+
use_mcp_tool('mcp-grocy', 'household_chores_get', {});
|
|
150
|
+
use_mcp_tool('mcp-grocy', 'household_tasks_get', {});
|
|
138
151
|
```
|
|
139
152
|
|
|
140
|
-
### Track
|
|
153
|
+
### Track chore execution
|
|
154
|
+
|
|
141
155
|
```typescript
|
|
142
|
-
use_mcp_tool('grocy
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
###
|
|
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
|
|
157
|
-
|
|
158
|
-
|
|
166
|
+
use_mcp_tool('mcp-grocy', 'household_tasks_complete', {
|
|
167
|
+
taskId: 1,
|
|
168
|
+
note: 'Task completed successfully',
|
|
159
169
|
});
|
|
160
170
|
```
|
|
161
171
|
|
|
162
|
-
|
|
172
|
+
### Storage locations vs shopping (store) locations
|
|
163
173
|
|
|
164
|
-
### Get All Locations
|
|
165
174
|
```typescript
|
|
166
|
-
use_mcp_tool('grocy
|
|
175
|
+
use_mcp_tool('mcp-grocy', 'system_locations_get', {});
|
|
176
|
+
use_mcp_tool('mcp-grocy', 'shopping_locations_get', {});
|
|
167
177
|
```
|
|
168
178
|
|
|
169
|
-
###
|
|
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
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
|
|
191
|
+
For moving by product without a `stockId`, use **`inventory_transactions_transfer`**.
|
|
192
|
+
|
|
193
|
+
## Advanced / escape hatches
|
|
186
194
|
|
|
187
|
-
###
|
|
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
|
|
192
|
-
|
|
193
|
-
|
|
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
|
|
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
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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.
|