mcp-grocy 1.9.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 +23 -0
- package/README.md +285 -0
- package/build/api/client.js +154 -0
- package/build/config/environment.js +142 -0
- package/build/main.js +29 -0
- package/build/resources/CHANGELOG.md +352 -0
- package/build/resources/DOCS.md +62 -0
- package/build/resources/README.md +285 -0
- package/build/resources/api-reference.md +92 -0
- package/build/resources/config.md +282 -0
- package/build/resources/examples.md +319 -0
- package/build/resources/installation.md +117 -0
- package/build/resources/response-format.md +165 -0
- package/build/server/http-server.js +214 -0
- package/build/server/mcp-server.js +173 -0
- package/build/server/resources.js +60 -0
- package/build/tools/base.js +56 -0
- package/build/tools/index.js +494 -0
- package/build/tools/products/definitions.js +57 -0
- package/build/tools/products/handlers.js +78 -0
- package/build/tools/products/index.js +13 -0
- package/build/tools/recipes/definitions.js +191 -0
- package/build/tools/recipes/handlers.js +258 -0
- package/build/tools/recipes/index.js +18 -0
- package/build/tools/shopping/index.js +107 -0
- package/build/tools/stock/definitions.js +234 -0
- package/build/tools/stock/handlers.js +391 -0
- package/build/tools/stock/index.js +19 -0
- package/build/tools/system/index.js +230 -0
- package/build/tools/types.js +1 -0
- package/build/version.js +4 -0
- package/package.json +87 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# MCP Grocy
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/mcp-grocy)
|
|
4
|
+
[](https://github.com/miguelangel-nubla/mcp-grocy/pkgs/container/mcp-grocy)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://github.com/miguelangel-nubla/mcp-grocy/actions/workflows/validate-config.yml)
|
|
7
|
+
[](https://github.com/miguelangel-nubla/mcp-grocy/actions/workflows/pipeline.yml)
|
|
8
|
+
[](https://modelcontextprotocol.io)
|
|
9
|
+
|
|
10
|
+
> **🍴 Opinionated Fork Notice**
|
|
11
|
+
>
|
|
12
|
+
> This is a heavily opinionated fork of [saya6k/mcp-grocy-api](https://github.com/saya6k/mcp-grocy-api) that has diverged significantly to warrant a separate identity. This MCP prioritizes **usability over features**.
|
|
13
|
+
>
|
|
14
|
+
> **Why This Fork Exists:**
|
|
15
|
+
> - The original wrapper exposes the entire Grocy API unprocessed, leading to context overload and LLM confusion
|
|
16
|
+
> - Grocy's API design choices and limitations cause error-prone interactions
|
|
17
|
+
> - Generic API exposure increases hallucination and near-miss results
|
|
18
|
+
>
|
|
19
|
+
> **This Fork's Philosophy:**
|
|
20
|
+
> - **Filters and augments data** with relevant context for better LLM comprehension
|
|
21
|
+
> - **Reduces API calls** by combining common operations to minimize error chains
|
|
22
|
+
> - **Optimizes for reliability and repeatability** over feature completeness
|
|
23
|
+
> - **Opinionated workflows** that may not match everyone's preferences
|
|
24
|
+
>
|
|
25
|
+
> If you need complete API access, use the [original fork](https://github.com/saya6k/mcp-grocy-api). This version trades flexibility for focused, dependable grocery management workflows.
|
|
26
|
+
|
|
27
|
+
## 🎯 What This MCP Does
|
|
28
|
+
|
|
29
|
+
Transform your LLM into an intelligent household management assistant with focused tools for:
|
|
30
|
+
|
|
31
|
+
### 📦 **Stock Management**
|
|
32
|
+
- Track inventory across multiple locations with precision
|
|
33
|
+
- Record purchases and consumption with automatic stock updates
|
|
34
|
+
- Monitor expiry dates and get volatile stock alerts
|
|
35
|
+
- Transfer products between storage locations
|
|
36
|
+
|
|
37
|
+
### 🛒 **Smart Shopping & Planning**
|
|
38
|
+
- Maintain shopping lists with intelligent quantity management
|
|
39
|
+
- Plan meals with recipe scheduling and fulfillment checking
|
|
40
|
+
- Automatically add missing ingredients to shopping lists
|
|
41
|
+
- Track shopping locations and optimize store visits
|
|
42
|
+
|
|
43
|
+
### 🍽️ **Recipe & Meal Workflows**
|
|
44
|
+
- Find recipes with fuzzy search capabilities
|
|
45
|
+
- Check if recipes can be made with current stock
|
|
46
|
+
- Complete cooking workflows with portion control
|
|
47
|
+
- Integrate meal planning with inventory consumption
|
|
48
|
+
|
|
49
|
+
### 🏠 **Household Management**
|
|
50
|
+
- Manage chores, tasks, and battery tracking
|
|
51
|
+
- Get product price history for budgeting
|
|
52
|
+
- Organize products by groups and categories
|
|
53
|
+
- Print labels for stock entries
|
|
54
|
+
|
|
55
|
+
## ⚡ Quick Start
|
|
56
|
+
|
|
57
|
+
1. **Get your Grocy API key** from your Grocy instance (User Settings → API Keys)
|
|
58
|
+
2. **Set up with Docker Compose:**
|
|
59
|
+
```bash
|
|
60
|
+
# Get the project
|
|
61
|
+
git clone https://github.com/miguelangel-nubla/mcp-grocy.git
|
|
62
|
+
cd mcp-grocy
|
|
63
|
+
|
|
64
|
+
# Configure
|
|
65
|
+
cp .env.example .env
|
|
66
|
+
# Edit .env with your GROCY_BASE_URL and GROCY_APIKEY_VALUE
|
|
67
|
+
|
|
68
|
+
# Run
|
|
69
|
+
docker compose up -d
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Try Without Grocy
|
|
73
|
+
Test with mock data (no real Grocy instance needed):
|
|
74
|
+
```bash
|
|
75
|
+
# In .env file, any values work for mock mode
|
|
76
|
+
GROCY_BASE_URL=http://mock
|
|
77
|
+
GROCY_APIKEY_VALUE=mock
|
|
78
|
+
|
|
79
|
+
npm install && npm run dev
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Installation
|
|
83
|
+
|
|
84
|
+
### NPM
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
git clone -b main https://github.com/miguelangel-nubla/mcp-grocy.git
|
|
88
|
+
cd mcp-grocy
|
|
89
|
+
npm install
|
|
90
|
+
npm run build
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Docker
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
docker run -e GROCY_APIKEY_VALUE=your_api_key -e GROCY_BASE_URL=http://your-grocy-instance ghcr.io/miguelangel-nubla/mcp-grocy:latest
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Docker Compose (Recommended)
|
|
100
|
+
|
|
101
|
+
Create a `docker-compose.yml`:
|
|
102
|
+
```yaml
|
|
103
|
+
services:
|
|
104
|
+
mcp-grocy:
|
|
105
|
+
image: ghcr.io/miguelangel-nubla/mcp-grocy:latest
|
|
106
|
+
env_file:
|
|
107
|
+
- .env
|
|
108
|
+
restart: unless-stopped
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Then:
|
|
112
|
+
```bash
|
|
113
|
+
cp .env.example .env
|
|
114
|
+
# Edit .env with your configuration
|
|
115
|
+
docker compose up -d
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## ⚙️ Configuration
|
|
119
|
+
|
|
120
|
+
### Quick Setup
|
|
121
|
+
|
|
122
|
+
1. **Get your Grocy API key:**
|
|
123
|
+
- Open your Grocy instance → **User Settings** → **API Keys**
|
|
124
|
+
- Create a new API key and copy it
|
|
125
|
+
|
|
126
|
+
2. **Configure the server:**
|
|
127
|
+
```bash
|
|
128
|
+
cp .env.example .env
|
|
129
|
+
# Edit .env with your GROCY_BASE_URL and GROCY_APIKEY_VALUE
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
3. **Essential variables:**
|
|
133
|
+
- `GROCY_BASE_URL` - Your Grocy instance URL
|
|
134
|
+
- `GROCY_APIKEY_VALUE` - Your Grocy API key
|
|
135
|
+
|
|
136
|
+
### Configuration Options
|
|
137
|
+
|
|
138
|
+
| Method | Use Case | Command |
|
|
139
|
+
|--------|----------|---------|
|
|
140
|
+
| **`.env` file** | Recommended for most users | `cp .env.example .env` |
|
|
141
|
+
| **Environment variables** | CI/CD, containers | `GROCY_BASE_URL=... GROCY_APIKEY_VALUE=... mcp-grocy` |
|
|
142
|
+
| **Tool toggles** | Customize functionality | Edit `TOOL__*` variables in `.env` |
|
|
143
|
+
|
|
144
|
+
📖 **For complete configuration reference:** See [Configuration Guide](src/resources/config.md)
|
|
145
|
+
|
|
146
|
+
## 🚀 Usage Modes
|
|
147
|
+
|
|
148
|
+
### Production Mode
|
|
149
|
+
Start with your real Grocy instance:
|
|
150
|
+
```bash
|
|
151
|
+
npm start
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Development/Testing Mode
|
|
155
|
+
Use mock data (no Grocy instance required):
|
|
156
|
+
```bash
|
|
157
|
+
npm run dev
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### HTTP Server Mode
|
|
161
|
+
Enable web-based access via HTTP/SSE:
|
|
162
|
+
```bash
|
|
163
|
+
# In .env: ENABLE_HTTP_SERVER=true
|
|
164
|
+
npm start
|
|
165
|
+
# Access via http://localhost:8080/mcp
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
## 📚 Documentation & Resources
|
|
170
|
+
|
|
171
|
+
| Resource | Purpose | When to Use |
|
|
172
|
+
|----------|---------|-------------|
|
|
173
|
+
| [📖 API Reference](src/resources/api-reference.md) | Complete tool documentation | Tool usage and examples |
|
|
174
|
+
| [⚙️ Configuration Guide](src/resources/config.md) | Advanced configuration reference | Detailed setup, presets, troubleshooting |
|
|
175
|
+
| [📋 .env.example](.env.example) | Configuration template with ALL tools | Copy and customize for your setup |
|
|
176
|
+
| [🧪 MCP Inspector](https://github.com/modelcontextprotocol/inspector) | Protocol debugging | Debug MCP interactions |
|
|
177
|
+
|
|
178
|
+
### 🆘 Troubleshooting
|
|
179
|
+
|
|
180
|
+
#### Common Issues
|
|
181
|
+
|
|
182
|
+
**"Connection refused" or "Cannot connect to Grocy"**
|
|
183
|
+
- Verify `GROCY_BASE_URL` is correct and accessible
|
|
184
|
+
- Check that your Grocy instance is running
|
|
185
|
+
- For HTTPS URLs, ensure SSL certificate is valid or disable verification with `GROCY_ENABLE_SSL_VERIFY=false`
|
|
186
|
+
|
|
187
|
+
**"Invalid API key" or "Authentication failed"**
|
|
188
|
+
- Verify your `GROCY_APIKEY_VALUE` is correct
|
|
189
|
+
- Check that the API key exists in your Grocy instance (User Settings → API Keys)
|
|
190
|
+
- Ensure the API key has proper permissions
|
|
191
|
+
|
|
192
|
+
**"Tool not found" errors**
|
|
193
|
+
- Check if the tool is enabled in your `.env` file (tool toggles)
|
|
194
|
+
- Verify you're using the correct tool names from the API reference
|
|
195
|
+
|
|
196
|
+
**Large response errors**
|
|
197
|
+
- Increase `REST_RESPONSE_SIZE_LIMIT` if you have many products/stock entries
|
|
198
|
+
- Consider using tool toggles to disable unused functionality
|
|
199
|
+
|
|
200
|
+
#### Debug Mode
|
|
201
|
+
|
|
202
|
+
Enable detailed logging and use the MCP inspector:
|
|
203
|
+
```bash
|
|
204
|
+
# Launch MCP inspector for protocol debugging
|
|
205
|
+
npm run inspector
|
|
206
|
+
|
|
207
|
+
# Run with mock data for testing
|
|
208
|
+
npm run dev
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## 🛠️ Development
|
|
212
|
+
|
|
213
|
+
### Prerequisites
|
|
214
|
+
|
|
215
|
+
- Node.js 18 or higher
|
|
216
|
+
- Grocy instance (optional with mock mode)
|
|
217
|
+
|
|
218
|
+
### Development Setup
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# Clone and install
|
|
222
|
+
git clone https://github.com/miguelangel-nubla/mcp-grocy.git
|
|
223
|
+
cd mcp-grocy
|
|
224
|
+
npm install
|
|
225
|
+
|
|
226
|
+
# Configure for development
|
|
227
|
+
cp .env.example .env
|
|
228
|
+
# Edit .env with your settings (or use mock values)
|
|
229
|
+
|
|
230
|
+
# Build and run
|
|
231
|
+
npm run build
|
|
232
|
+
npm start
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Development Commands
|
|
236
|
+
|
|
237
|
+
| Command | Description |
|
|
238
|
+
|---------|-------------|
|
|
239
|
+
| `npm run build` | Build TypeScript to JavaScript |
|
|
240
|
+
| `npm run watch` | Watch mode for development |
|
|
241
|
+
| `npm run dev` | Start with mock data (no Grocy needed) |
|
|
242
|
+
| `npm test` | Run test suite |
|
|
243
|
+
| `npm run test:watch` | Run tests in watch mode |
|
|
244
|
+
| `npm run inspector` | Launch MCP protocol inspector |
|
|
245
|
+
|
|
246
|
+
### Debugging
|
|
247
|
+
|
|
248
|
+
Use the MCP inspector to debug protocol interactions:
|
|
249
|
+
```bash
|
|
250
|
+
npm run inspector
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
This launches a web interface for testing MCP tools and viewing protocol messages.
|
|
254
|
+
|
|
255
|
+
## 🤝 Contributing
|
|
256
|
+
|
|
257
|
+
This is an **opinionated fork** focused on LLM usability and workflow reliability. Contributions are welcome but must align with the core philosophy:
|
|
258
|
+
|
|
259
|
+
### ✅ Welcome Contributions
|
|
260
|
+
- Bug fixes and reliability improvements
|
|
261
|
+
- Better error handling and validation
|
|
262
|
+
- Documentation improvements
|
|
263
|
+
- Test coverage enhancements
|
|
264
|
+
- Performance optimizations
|
|
265
|
+
|
|
266
|
+
### ❌ Contributions Requiring Discussion
|
|
267
|
+
- New tool additions (must demonstrate clear LLM workflow benefits)
|
|
268
|
+
- API design changes that increase complexity
|
|
269
|
+
- Features that expose raw Grocy API behavior
|
|
270
|
+
|
|
271
|
+
### Development Workflow
|
|
272
|
+
1. Fork the repository
|
|
273
|
+
2. Create a feature branch
|
|
274
|
+
3. Make your changes with tests
|
|
275
|
+
4. Run `npm test` and ensure all tests pass
|
|
276
|
+
5. Submit a pull request with clear description
|
|
277
|
+
|
|
278
|
+
## 📄 License
|
|
279
|
+
|
|
280
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
**🏠 Made for reliable household management with LLMs**
|
|
285
|
+
*Prioritizing workflow efficiency over feature completeness*
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Grocy API Reference
|
|
2
|
+
|
|
3
|
+
> Auto-generated from https://demo.grocy.info/api/openapi/specification on 2025-05-17T16:56:10.327Z
|
|
4
|
+
|
|
5
|
+
| Path | Method | Summary |
|
|
6
|
+
|------|--------|---------|
|
|
7
|
+
| /batteries | GET | Returns all batteries incl. the next estimated charge time per battery |
|
|
8
|
+
| /batteries/charge-cycles/{chargeCycleId}/undo | POST | Undoes a battery charge cycle |
|
|
9
|
+
| /batteries/{batteryId} | GET | Returns details of the given battery |
|
|
10
|
+
| /batteries/{batteryId}/charge | POST | Tracks a charge cycle of the given battery |
|
|
11
|
+
| /batteries/{batteryId}/printlabel | GET | Prints the Grocycode label of the given battery on the configured label printer |
|
|
12
|
+
| /calendar/ical | GET | Returns the calendar in iCal format |
|
|
13
|
+
| /calendar/ical/sharing-link | GET | Returns a (public) sharing link for the calendar in iCal format |
|
|
14
|
+
| /chores | GET | Returns all chores incl. the next estimated execution time per chore |
|
|
15
|
+
| /chores/executions/calculate-next-assignments | POST | (Re)calculates all next user assignments of all chores |
|
|
16
|
+
| /chores/executions/{executionId}/undo | POST | Undoes a chore execution |
|
|
17
|
+
| /chores/{choreIdToKeep}/merge/{choreIdToRemove} | POST | Merges two chores into one |
|
|
18
|
+
| /chores/{choreId} | GET | Returns details of the given chore |
|
|
19
|
+
| /chores/{choreId}/execute | POST | Tracks an execution of the given chore |
|
|
20
|
+
| /chores/{choreId}/printlabel | GET | Prints the Grocycode label of the given chore on the configured label printer |
|
|
21
|
+
| /files/{group}/{fileName} | GET | Serves the given file |
|
|
22
|
+
| /files/{group}/{fileName} | PUT | Uploads a single file |
|
|
23
|
+
| /files/{group}/{fileName} | DELETE | Deletes the given file |
|
|
24
|
+
| /objects/{entity} | GET | Returns all objects of the given entity |
|
|
25
|
+
| /objects/{entity} | POST | Adds a single object of the given entity |
|
|
26
|
+
| /objects/{entity}/{objectId} | GET | Returns a single object of the given entity |
|
|
27
|
+
| /objects/{entity}/{objectId} | PUT | Edits the given object of the given entity |
|
|
28
|
+
| /objects/{entity}/{objectId} | DELETE | Deletes a single object of the given entity |
|
|
29
|
+
| /print/shoppinglist/thermal | GET | Prints the shoppinglist with a thermal printer |
|
|
30
|
+
| /recipes/fulfillment | GET | Get stock fulfillment information for all recipe |
|
|
31
|
+
| /recipes/{recipeId}/add-not-fulfilled-products-to-shoppinglist | POST | Adds all missing products for the given recipe to the shopping list |
|
|
32
|
+
| /recipes/{recipeId}/consume | POST | Consumes all in stock ingredients of the given recipe (for ingredients that are only partially in stock, the in stock amount will be consumed) |
|
|
33
|
+
| /recipes/{recipeId}/copy | POST | Copies a recipe |
|
|
34
|
+
| /recipes/{recipeId}/fulfillment | GET | Get stock fulfillment information for the given recipe |
|
|
35
|
+
| /recipes/{recipeId}/printlabel | GET | Prints the Grocycode label of the given recipe on the configured label printer |
|
|
36
|
+
| /stock | GET | Returns all products which are currently in stock incl. the next due date per product |
|
|
37
|
+
| /stock/barcodes/external-lookup/{barcode} | GET | Executes an external barcode lookoup via the configured plugin with the given barcode |
|
|
38
|
+
| /stock/bookings/{bookingId} | GET | Returns the given stock booking |
|
|
39
|
+
| /stock/bookings/{bookingId}/undo | POST | Undoes a booking |
|
|
40
|
+
| /stock/entry/{entryId} | GET | Returns details of the given stock |
|
|
41
|
+
| /stock/entry/{entryId} | PUT | Edits the stock entry |
|
|
42
|
+
| /stock/entry/{entryId}/printlabel | GET | Prints the Grocycode / stock entry label of the given entry on the configured label printer |
|
|
43
|
+
| /stock/locations/{locationId}/entries | GET | Returns all stock entries of the given location |
|
|
44
|
+
| /stock/products/by-barcode/{barcode} | GET | Returns details of the given product by its barcode |
|
|
45
|
+
| /stock/products/by-barcode/{barcode}/add | POST | Adds the given amount of the by its barcode given product to stock |
|
|
46
|
+
| /stock/products/by-barcode/{barcode}/consume | POST | Removes the given amount of the by its barcode given product from stock |
|
|
47
|
+
| /stock/products/by-barcode/{barcode}/inventory | POST | Inventories the by its barcode given product (adds/removes based on the given new amount) |
|
|
48
|
+
| /stock/products/by-barcode/{barcode}/open | POST | Marks the given amount of the by its barcode given product as opened |
|
|
49
|
+
| /stock/products/by-barcode/{barcode}/transfer | POST | Transfers the given amount of the by its barcode given product from one location to another (this is currently not supported for tare weight handling enabled products) |
|
|
50
|
+
| /stock/products/{productIdToKeep}/merge/{productIdToRemove} | POST | Merges two products into one |
|
|
51
|
+
| /stock/products/{productId} | GET | Returns details of the given product |
|
|
52
|
+
| /stock/products/{productId}/add | POST | Adds the given amount of the given product to stock |
|
|
53
|
+
| /stock/products/{productId}/consume | POST | Removes the given amount of the given product from stock |
|
|
54
|
+
| /stock/products/{productId}/entries | GET | Returns all stock entries of the given product in order of next use (Opened first, then first due first, then first in first out) |
|
|
55
|
+
| /stock/products/{productId}/inventory | POST | Inventories the given product (adds/removes based on the given new amount) |
|
|
56
|
+
| /stock/products/{productId}/locations | GET | Returns all locations where the given product currently has stock |
|
|
57
|
+
| /stock/products/{productId}/open | POST | Marks the given amount of the given product as opened |
|
|
58
|
+
| /stock/products/{productId}/price-history | GET | Returns the price history of the given product |
|
|
59
|
+
| /stock/products/{productId}/printlabel | GET | Prints the Grocycode label of the given product on the configured label printer |
|
|
60
|
+
| /stock/products/{productId}/transfer | POST | Transfers the given amount of the given product from one location to another (this is currently not supported for tare weight handling enabled products) |
|
|
61
|
+
| /stock/shoppinglist/add-expired-products | POST | Adds expired products to the given shopping list |
|
|
62
|
+
| /stock/shoppinglist/add-missing-products | POST | Adds currently missing products (below defined min. stock amount) to the given shopping list |
|
|
63
|
+
| /stock/shoppinglist/add-overdue-products | POST | Adds overdue products to the given shopping list |
|
|
64
|
+
| /stock/shoppinglist/add-product | POST | Adds the given amount of the given product to the given shopping list |
|
|
65
|
+
| /stock/shoppinglist/clear | POST | Removes all items from the given shopping list |
|
|
66
|
+
| /stock/shoppinglist/remove-product | POST | Removes the given amount of the given product from the given shopping list, if it is on it |
|
|
67
|
+
| /stock/transactions/{transactionId} | GET | Returns all stock bookings of the given transaction id |
|
|
68
|
+
| /stock/transactions/{transactionId}/undo | POST | Undoes a transaction |
|
|
69
|
+
| /stock/volatile | GET | Returns all products which are due soon, overdue, expired or currently missing |
|
|
70
|
+
| /system/config | GET | Returns all config settings |
|
|
71
|
+
| /system/db-changed-time | GET | Returns the time when the database was last changed |
|
|
72
|
+
| /system/info | GET | Returns information about the installed Grocy version, PHP runtime and OS |
|
|
73
|
+
| /system/localization-strings | GET | Returns all localization strings (in the by the user desired language) |
|
|
74
|
+
| /system/log-missing-localization | POST | Logs a missing localization string |
|
|
75
|
+
| /system/time | GET | Returns the current server time |
|
|
76
|
+
| /tasks | GET | Returns all tasks which are not done yet |
|
|
77
|
+
| /tasks/{taskId}/complete | POST | Marks the given task as completed |
|
|
78
|
+
| /tasks/{taskId}/undo | POST | Marks the given task as not completed |
|
|
79
|
+
| /user | GET | Returns the currently authenticated user |
|
|
80
|
+
| /user/settings | GET | Returns all settings of the currently logged in user |
|
|
81
|
+
| /user/settings/{settingKey} | GET | Returns the given setting of the currently logged in user |
|
|
82
|
+
| /user/settings/{settingKey} | PUT | Sets the given setting of the currently logged in user |
|
|
83
|
+
| /user/settings/{settingKey} | DELETE | Deletes the given setting of the currently logged in user |
|
|
84
|
+
| /userfields/{entity}/{objectId} | GET | Returns all userfields with their values of the given object of the given entity |
|
|
85
|
+
| /userfields/{entity}/{objectId} | PUT | Edits the given userfields of the given object of the given entity |
|
|
86
|
+
| /users | GET | Returns all users |
|
|
87
|
+
| /users | POST | Creates a new user |
|
|
88
|
+
| /users/{userId} | PUT | Edits the given user |
|
|
89
|
+
| /users/{userId} | DELETE | Deletes the given user |
|
|
90
|
+
| /users/{userId}/permissions | GET | Returns the assigned permissions of the given user |
|
|
91
|
+
| /users/{userId}/permissions | POST | Adds a permission to the given user |
|
|
92
|
+
| /users/{userId}/permissions | PUT | Replaces the assigned permissions of the given user |
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
# MCP Grocy Configuration Guide
|
|
2
|
+
|
|
3
|
+
Advanced configuration reference for the MCP Grocy server. For basic setup, see the [README](../../README.md).
|
|
4
|
+
|
|
5
|
+
## 🔧 Configuration Variables
|
|
6
|
+
|
|
7
|
+
### Core Variables
|
|
8
|
+
|
|
9
|
+
| Variable | Description | Default | Required |
|
|
10
|
+
|----------|-------------|---------|----------|
|
|
11
|
+
| `GROCY_BASE_URL` | Your Grocy instance URL | `http://localhost:9283` | ✅ |
|
|
12
|
+
| `GROCY_APIKEY_VALUE` | Your Grocy API key | - | ✅ |
|
|
13
|
+
|
|
14
|
+
### Optional Variables
|
|
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` |
|
|
20
|
+
|
|
21
|
+
## 🌐 HTTP Server Configuration
|
|
22
|
+
|
|
23
|
+
Enable HTTP/SSE transport for web-based access:
|
|
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` |
|
|
29
|
+
|
|
30
|
+
### Transport Modes
|
|
31
|
+
- **stdio** (default) - Standard MCP protocol for CLI/desktop clients
|
|
32
|
+
- **HTTP** - Streamable HTTP for web applications (`POST /mcp`)
|
|
33
|
+
- **SSE** - Server-Sent Events for real-time web clients (`GET /mcp/sse`)
|
|
34
|
+
|
|
35
|
+
## 🛠️ Tool Configuration
|
|
36
|
+
|
|
37
|
+
### Tool Toggle System
|
|
38
|
+
|
|
39
|
+
Enable/disable specific tools using the `TOOL__` prefix pattern:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Stock management
|
|
43
|
+
TOOL__get_all_stock=true
|
|
44
|
+
TOOL__purchase_product=true
|
|
45
|
+
TOOL__consume_product=false
|
|
46
|
+
|
|
47
|
+
# Shopping lists
|
|
48
|
+
TOOL__get_shopping_list=true
|
|
49
|
+
TOOL__add_shopping_list_item=true
|
|
50
|
+
|
|
51
|
+
# Meal planning
|
|
52
|
+
TOOL__get_meal_plan=true
|
|
53
|
+
TOOL__add_recipe_to_meal_plan=true
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Available Tool Categories
|
|
57
|
+
|
|
58
|
+
#### 📦 Stock Management Tools
|
|
59
|
+
```bash
|
|
60
|
+
TOOL__get_all_stock=true # Get all stock entries
|
|
61
|
+
TOOL__get_stock_volatile=true # Get due/expired products
|
|
62
|
+
TOOL__get_stock_by_location=true # Stock by specific location
|
|
63
|
+
TOOL__inventory_product=true # Set stock amounts
|
|
64
|
+
TOOL__purchase_product=true # Record purchases
|
|
65
|
+
TOOL__consume_product=true # Record consumption
|
|
66
|
+
TOOL__transfer_product=true # Move stock between locations
|
|
67
|
+
TOOL__open_product=true # Mark products as opened
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### 🛒 Shopping & Planning Tools
|
|
71
|
+
```bash
|
|
72
|
+
TOOL__get_shopping_list=true # Get shopping lists
|
|
73
|
+
TOOL__add_shopping_list_item=true # Add to shopping list
|
|
74
|
+
TOOL__remove_shopping_list_item=true # Remove from shopping list
|
|
75
|
+
TOOL__get_shopping_locations=true # Get store locations
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### 🍽️ Recipe & Meal Planning Tools
|
|
79
|
+
```bash
|
|
80
|
+
TOOL__get_recipes=true # Get all recipes
|
|
81
|
+
TOOL__get_recipe_by_id=true # Get specific recipe
|
|
82
|
+
TOOL__create_recipe=true # Create new recipes
|
|
83
|
+
TOOL__get_recipe_fulfillment=true # Check recipe availability
|
|
84
|
+
TOOL__consume_recipe=true # Cook a recipe
|
|
85
|
+
TOOL__get_meal_plan=true # Get meal plans
|
|
86
|
+
TOOL__add_recipe_to_meal_plan=true # Schedule meals
|
|
87
|
+
TOOL__delete_recipe_from_meal_plan=true # Remove from meal plan
|
|
88
|
+
TOOL__cooked_something=true # Complete cooking workflow
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### 🏠 Household Management Tools
|
|
92
|
+
```bash
|
|
93
|
+
TOOL__track_chore_execution=true # Record chore completion
|
|
94
|
+
TOOL__complete_task=true # Mark tasks as done
|
|
95
|
+
TOOL__charge_battery=true # Record battery charging
|
|
96
|
+
TOOL__get_chores=true # Get all chores
|
|
97
|
+
TOOL__get_tasks=true # Get all tasks
|
|
98
|
+
TOOL__get_batteries=true # Get battery info
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### 🔧 System & Utility Tools
|
|
102
|
+
```bash
|
|
103
|
+
TOOL__get_products=true # Get product information
|
|
104
|
+
TOOL__lookup_product=true # Fuzzy product search
|
|
105
|
+
TOOL__get_locations=true # Get storage locations
|
|
106
|
+
TOOL__get_quantity_units=true # Get quantity units
|
|
107
|
+
TOOL__get_users=true # Get user information
|
|
108
|
+
TOOL__call_grocy_api=true # Make custom API calls
|
|
109
|
+
TOOL__test_request=true # Test API endpoints
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Tool Sub-Configuration
|
|
113
|
+
|
|
114
|
+
Some tools have additional configuration options:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# cooked_something tool options
|
|
118
|
+
TOOL__cooked_something__allow_meal_plan_entry_already_done=false
|
|
119
|
+
TOOL__cooked_something__allow_no_meal_plan=false
|
|
120
|
+
TOOL__cooked_something__print_labels=true
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 📋 Configuration Presets
|
|
124
|
+
|
|
125
|
+
### Read-Only Mode
|
|
126
|
+
Safe for information gathering only:
|
|
127
|
+
```bash
|
|
128
|
+
# Enable only GET operations
|
|
129
|
+
TOOL__get_all_stock=true
|
|
130
|
+
TOOL__get_recipes=true
|
|
131
|
+
TOOL__get_meal_plan=true
|
|
132
|
+
TOOL__get_shopping_list=true
|
|
133
|
+
TOOL__get_products=true
|
|
134
|
+
TOOL__lookup_product=true
|
|
135
|
+
# Disable all modification tools
|
|
136
|
+
TOOL__purchase_product=false
|
|
137
|
+
TOOL__consume_product=false
|
|
138
|
+
TOOL__add_shopping_list_item=false
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Meal Planning Focus
|
|
142
|
+
For meal planning and recipe management:
|
|
143
|
+
```bash
|
|
144
|
+
# Recipe and meal planning tools
|
|
145
|
+
TOOL__get_recipes=true
|
|
146
|
+
TOOL__get_recipe_by_id=true
|
|
147
|
+
TOOL__get_recipe_fulfillment=true
|
|
148
|
+
TOOL__get_meal_plan=true
|
|
149
|
+
TOOL__add_recipe_to_meal_plan=true
|
|
150
|
+
TOOL__delete_recipe_from_meal_plan=true
|
|
151
|
+
TOOL__cooked_something=true
|
|
152
|
+
|
|
153
|
+
# Supporting tools
|
|
154
|
+
TOOL__get_products=true
|
|
155
|
+
TOOL__lookup_product=true
|
|
156
|
+
TOOL__get_all_stock=true
|
|
157
|
+
TOOL__add_missing_products_to_shopping_list=true
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Stock Management Focus
|
|
161
|
+
For inventory and shopping management:
|
|
162
|
+
```bash
|
|
163
|
+
# Stock operations
|
|
164
|
+
TOOL__get_all_stock=true
|
|
165
|
+
TOOL__get_stock_volatile=true
|
|
166
|
+
TOOL__purchase_product=true
|
|
167
|
+
TOOL__consume_product=true
|
|
168
|
+
TOOL__inventory_product=true
|
|
169
|
+
|
|
170
|
+
# Shopping management
|
|
171
|
+
TOOL__get_shopping_list=true
|
|
172
|
+
TOOL__add_shopping_list_item=true
|
|
173
|
+
TOOL__remove_shopping_list_item=true
|
|
174
|
+
|
|
175
|
+
# Product management
|
|
176
|
+
TOOL__get_products=true
|
|
177
|
+
TOOL__lookup_product=true
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## 🔒 Security Considerations
|
|
181
|
+
|
|
182
|
+
### API Key Security
|
|
183
|
+
- Never commit API keys to version control
|
|
184
|
+
- Use `.env` files for local development
|
|
185
|
+
- Use secure environment variable management in production
|
|
186
|
+
|
|
187
|
+
### Tool Access Control
|
|
188
|
+
- Disable unused tools to reduce attack surface
|
|
189
|
+
- Use read-only mode for information-gathering use cases
|
|
190
|
+
- Be cautious with tools that modify data (`purchase_product`, `consume_product`, etc.)
|
|
191
|
+
|
|
192
|
+
### Network Security
|
|
193
|
+
- Use HTTPS for production Grocy instances
|
|
194
|
+
- Consider SSL verification settings carefully
|
|
195
|
+
- Limit response sizes to prevent memory issues
|
|
196
|
+
|
|
197
|
+
## 📝 Environment File Examples
|
|
198
|
+
|
|
199
|
+
### Development Configuration
|
|
200
|
+
```bash
|
|
201
|
+
# .env for development
|
|
202
|
+
GROCY_BASE_URL=http://localhost:9283
|
|
203
|
+
GROCY_APIKEY_VALUE=dev_api_key_here
|
|
204
|
+
GROCY_ENABLE_SSL_VERIFY=false
|
|
205
|
+
REST_RESPONSE_SIZE_LIMIT=50000
|
|
206
|
+
|
|
207
|
+
# Enable HTTP server for testing
|
|
208
|
+
ENABLE_HTTP_SERVER=true
|
|
209
|
+
HTTP_SERVER_PORT=8080
|
|
210
|
+
|
|
211
|
+
# Enable commonly used tools
|
|
212
|
+
TOOL__get_all_stock=true
|
|
213
|
+
TOOL__get_recipes=true
|
|
214
|
+
TOOL__get_meal_plan=true
|
|
215
|
+
TOOL__lookup_product=true
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Production Configuration
|
|
219
|
+
```bash
|
|
220
|
+
# .env for production
|
|
221
|
+
GROCY_BASE_URL=https://grocy.yourdomain.com
|
|
222
|
+
GROCY_APIKEY_VALUE=secure_production_key
|
|
223
|
+
GROCY_ENABLE_SSL_VERIFY=true
|
|
224
|
+
REST_RESPONSE_SIZE_LIMIT=20000
|
|
225
|
+
|
|
226
|
+
# Selective tool enablement for security
|
|
227
|
+
TOOL__get_all_stock=true
|
|
228
|
+
TOOL__get_recipes=true
|
|
229
|
+
TOOL__add_recipe_to_meal_plan=true
|
|
230
|
+
TOOL__get_shopping_list=true
|
|
231
|
+
# Explicitly disable sensitive operations
|
|
232
|
+
TOOL__call_grocy_api=false
|
|
233
|
+
TOOL__test_request=false
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## 🔄 Configuration Management
|
|
237
|
+
|
|
238
|
+
### Loading Order
|
|
239
|
+
1. Default values
|
|
240
|
+
2. Environment variables
|
|
241
|
+
3. `.env` file (if present)
|
|
242
|
+
|
|
243
|
+
### Validation
|
|
244
|
+
- Server validates all tool names at startup
|
|
245
|
+
- Invalid configuration prevents server start
|
|
246
|
+
- Error messages show valid options
|
|
247
|
+
|
|
248
|
+
### Runtime Changes
|
|
249
|
+
- Configuration changes require server restart
|
|
250
|
+
- Use process managers (PM2, systemd) for production restarts
|
|
251
|
+
- Docker containers need to be recreated with new environment
|
|
252
|
+
|
|
253
|
+
## 🐛 Troubleshooting Configuration
|
|
254
|
+
|
|
255
|
+
### Common Issues
|
|
256
|
+
|
|
257
|
+
**Tool toggle not working**
|
|
258
|
+
- Check exact spelling of tool names
|
|
259
|
+
- Ensure `TOOL__` prefix is correct
|
|
260
|
+
- Verify boolean values (`true`/`false`)
|
|
261
|
+
|
|
262
|
+
**SSL/TLS connection errors**
|
|
263
|
+
- Set `GROCY_ENABLE_SSL_VERIFY=false` for self-signed certificates
|
|
264
|
+
- Verify Grocy URL is accessible
|
|
265
|
+
- Check firewall and network settings
|
|
266
|
+
|
|
267
|
+
**Large response errors**
|
|
268
|
+
- Increase `REST_RESPONSE_SIZE_LIMIT`
|
|
269
|
+
- Consider disabling unused tools to reduce response size
|
|
270
|
+
- Check Grocy instance has reasonable data volumes
|
|
271
|
+
|
|
272
|
+
### Debugging Configuration
|
|
273
|
+
```bash
|
|
274
|
+
# Use mock mode to test configuration
|
|
275
|
+
npm run dev
|
|
276
|
+
|
|
277
|
+
# Enable MCP inspector for protocol debugging
|
|
278
|
+
npm run inspector
|
|
279
|
+
|
|
280
|
+
# Check configuration loading
|
|
281
|
+
# (Server logs show loaded configuration at startup)
|
|
282
|
+
```
|