Skip to main content

MCP server and CLI for Grocy - control stock, shopping lists, recipes and chores via AI agents

Project description

grocy-mcp

MCP server and CLI for Grocy — control stock, shopping lists, recipes and chores via AI agents.

Features

  • 30 MCP tools covering stock, shopping lists, recipes, chores, and system management
  • Full CLI with subcommand groups mirroring every MCP tool
  • Name-based lookups — pass product/recipe/chore names instead of numeric IDs
  • Dual transport — stdio (for Claude Desktop / Claude Code) and streamable-http
  • Grocy v4.4.1+ compatible

Installation

pip install grocy-mcp

Run without installing using uvx:

uvx grocy-mcp --transport stdio

Configuration

grocy-mcp reads configuration from (in priority order):

  1. CLI flags / environment variables
  2. TOML config file

Environment variables

export GROCY_URL="https://grocy.example.com"
export GROCY_API_KEY="your-api-key-here"

TOML config file

Create ~/.config/grocy-mcp/config.toml (Linux/macOS) or the platform equivalent:

[grocy]
url = "https://grocy.example.com"
api_key = "your-api-key-here"

Usage

MCP server — stdio (Claude Desktop / Claude Code)

grocy-mcp --transport stdio

MCP server — streamable-http

grocy-mcp --transport streamable-http --port 8000

Claude Code configuration

Add to your ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "grocy": {
      "command": "grocy-mcp",
      "args": ["--transport", "stdio"],
      "env": {
        "GROCY_URL": "https://grocy.example.com",
        "GROCY_API_KEY": "your-api-key-here"
      }
    }
  }
}

CLI examples

# Stock
grocy stock overview
grocy stock expiring
grocy stock add Milk 2
grocy stock consume "Oat Milk" 1
grocy stock search milk
grocy stock barcode 5000112637922

# Shopping list
grocy shopping view
grocy shopping add Butter --amount 3
grocy shopping clear

# Recipes
grocy recipes list
grocy recipes details "Spaghetti Bolognese"
grocy recipes fulfillment "Spaghetti Bolognese"
grocy recipes consume "Spaghetti Bolognese"
grocy recipes add-to-shopping "Spaghetti Bolognese"

# Chores
grocy chores list
grocy chores overdue
grocy chores execute "Vacuum living room"
grocy chores undo "Vacuum living room"

# System
grocy system info
grocy entity list products
grocy entity manage products create --data '{"name": "Oat Milk"}'

Development

git clone https://github.com/moustafattia/grocy-mcp
cd grocy-mcp
pip install -e ".[dev]"
pytest -v

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grocy_mcp-0.1.0.tar.gz (40.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grocy_mcp-0.1.0-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file grocy_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: grocy_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 40.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for grocy_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2e0acbfa4211842232c996eb30c9a0716aaabfc728184e407ef7f63dbb55ac43
MD5 1887b469e657f9ec5a616ddf72f0071a
BLAKE2b-256 e846ca16d7d22ef7cb36093126182bde46784a8cb2a6958430b14d75f9e58086

See more details on using hashes here.

File details

Details for the file grocy_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: grocy_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for grocy_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af22c84a98f933c47ba5dd3f9dbeace9017a5e1cbdc118fac4037d5e5ef8e213
MD5 6f6b39cea78fa2cab072667a0da3da32
BLAKE2b-256 336191b6222a04fddbedfa0671c7199aa40a0a2de091d475644473c269ae77eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page