grocy-mcp
Provides tools for managing a Grocy instance: checking stock levels, tracking expiring products, managing the product catalog, and handling shopping lists, with safeguards against invalid operations.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@grocy-mcpcheck my pantry for items expiring this week"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
grocy-mcp
An MCP server for Grocy, so an AI assistant can read and manage your pantry: what's in stock, what's going off, what needs buying, and what you just used.
27 tools covering stock, the product catalog and the shopping list. Every call reads live from Grocy — there is no cache to go stale.
You: what's going off this week, and can I make something with it?
...
You: right, I used the last of the coconut milk and two of the tomatoes
...
You: add coconut milk to the shopping listInstall
Not on PyPI yet — install from the repo:
pip install git+https://github.com/anishanilkumar/grocy-mcp # stdio only
pip install 'grocy-mcp[http] @ git+https://github.com/anishanilkumar/grocy-mcp'The http extra adds PyJWT and cryptography, needed only to verify OAuth
bearer tokens when serving over HTTP. A stdio server needs neither.
You need a Grocy API key: in Grocy, wrench icon → Manage API keys → add.
export GROCY_API_URL=https://grocy.example.com/api
export GROCY_API_KEY=...Related MCP server: MCP Grocy API
Use it from a local client
Most MCP clients launch the server themselves over stdio. For Claude Desktop,
add this to claude_desktop_config.json:
{
"mcpServers": {
"grocy": {
"command": "grocy-mcp",
"env": {
"GROCY_API_URL": "https://grocy.example.com/api",
"GROCY_API_KEY": "your-api-key",
"GROCY_MCP_CONFIG": "/path/to/pantry.toml"
}
}
}
}GROCY_MCP_CONFIG is optional — see Configuration.
Tools
Stock
Tool | |
| Everything on the shelf, filterable by location or category |
| Expired or due within N days, worst first |
| Products at zero. Needs no minimum levels |
| Products under a configured minimum |
| The individual batches making up a total, with their own dates |
| Last bought, last used, average shelf life, spoil rate, minimum |
| The journal: what was bought, used, opened or corrected |
| Record a purchase |
| Record use, or something thrown away |
| Mark a pack opened without consuming it |
| Set the amount to what you actually counted, either direction |
| Move stock between locations |
| Fix one batch's date, shelf or amount |
| Reverse a stock transaction |
Catalog — search_products, get_conventions, create_product,
update_product, delete_product, add_barcode, remove_barcode
Shopping list — list_shopping_list, add_to_shopping_list,
remove_from_shopping_list, check_off_shopping_item,
add_missing_to_shopping_list, clear_shopping_list
It refuses rather than guessing
Most of the value over raw API calls is in what these tools won't do. Grocy will happily take stock negative or move a batch out of a shelf it isn't on; an agent that does so is very hard to notice afterwards.
An ambiguous product name raises with the candidates listed, instead of picking one. A wrong guess silently moves the wrong product's stock.
Consuming, opening or transferring more than is on hand is refused.
A transfer with stock split across shelves refuses until you say which shelf.
Changing a product's unit while it holds stock is refused — Grocy would reinterpret the existing amount in the new unit.
A barcode already belonging to another product is refused.
Adding a misspelled product to the shopping list is refused rather than quietly written as a free-text note that can never be matched back to stock.
Deleting a product that still has stock is refused.
Every stock write returns a transaction_id, so mistakes get undone properly
rather than cancelled out with an opposite booking that leaves both rows in the
journal and invents a best-before date.
Configuration
Optional, and only for things Grocy has no field for. Locations, categories and units are always read live from your instance, so they are never configured here and cannot drift.
What you can configure is the advice: what each location is for, how long things keep when the package has no date, how you name products. That is what makes an agent's guesses good, and it is different in every kitchen.
[pantry]
summary = "Household inventory for a two-person kitchen."
soon_days = 7
expiry_guidance = """
Best-before estimates when the package date is unknown:
fresh veg ~1 week frozen ~2 months whole spices ~3 years
"""
[pantry.location_notes]
"Fridge" = "Perishables: dairy, eggs, opened jars"
"Freezer" = "Frozen items, meat, fish"See examples/pantry.toml for every option. Point at
it with GROCY_MCP_CONFIG=/path/to/pantry.toml or --config.
With no config file the server still works — it just describes your instance without opinions about it.
Serving over HTTP
For a remote client (e.g. a Claude custom connector) rather than a local one. Bind to loopback and put a reverse proxy in front to terminate TLS.
grocy-mcp --transport http --public-host grocy-mcp.example.comAuthentication is required by default over HTTP, because a write-capable server without it is the kind of default nobody notices until it is reachable from somewhere it shouldn't be. Tokens are validated locally against the issuer's published keys — no introspection call, so a public PKCE client needs no secret here.
export GROCY_MCP_OIDC_ISSUER=https://auth.example.com/realms/home
export GROCY_MCP_OIDC_AUDIENCE=grocy-mcp # usually the client id
export GROCY_MCP_OIDC_SCOPES=mcp # optional, space separatedThe JWKS endpoint is discovered from the issuer. Set
GROCY_MCP_OIDC_JWKS_URI if your provider doesn't publish standard discovery
metadata — Kanidm, for instance, serves per-client keys
at <issuer>/public_key.jwk, which this tries as a fallback.
--no-auth exists for a server on an interface nothing untrusted can reach.
Be sure that's true before using it.
The SSE response must not be buffered, and the timeouts need raising:
location /mcp {
proxy_pass http://127.0.0.1:8765;
proxy_http_version 1.1;
proxy_buffering off;
proxy_read_timeout 3600s;
}
# RFC 9728 protected-resource metadata, served at the path-suffixed location.
location /.well-known/oauth-protected-resource/mcp {
proxy_pass http://127.0.0.1:8765;
}Two things are easy to get wrong here. The metadata lives at the
path-suffixed location (…/oauth-protected-resource/mcp), not the bare one.
And --public-url must equal the URL exactly as the client has it configured,
path included, or the metadata is rejected as not describing this server.
Requirements
Python 3.11+, and Grocy 4.x. Developed against 4.6; every endpoint used is checked against the instance's own OpenAPI spec.
Development
pip install -e '.[http,dev]'
pytestThe tests run against an in-memory fake Grocy, so they need no instance and no network. They assert on the request bodies the tools send, not just their return values.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityBmaintenanceMCP server for Mealie that exposes its REST API to manage recipes, meal plans, shopping lists, cookbooks, and taxonomy through natural language.75MIT
- Alicense-qualityFmaintenanceEnables interaction with Grocy's API through MCP, allowing management of grocery inventory, shopping lists, and household tasks via natural language.19529MIT
- Flicense-qualityAmaintenanceMCP server that integrates with AnyList for managing shopping lists, recipes, and meal planning via natural language.25
- Alicense-qualityFmaintenanceMCP server for MealMastery AI meal planning that enables users to manage meal plans, recipes, and grocery lists through natural language conversation with AI agents like Claude.67MIT
Related MCP Connectors
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/anishanilkumar/grocy-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server