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.1.tar.gz (47.8 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.1-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grocy_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 47.8 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.1.tar.gz
Algorithm Hash digest
SHA256 5d956c83aa9959037edeba966ae6ff3d7de6d37be9abbddf81dc4e4c9627e1fa
MD5 9d35cf84095e176e8d650b43d7eed787
BLAKE2b-256 758a75766a59e0b9f7711a06928fb191a70a0ac942b4f6e2ecc3dacd2a066fff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: grocy_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ffe3fd479b2b9e0d500d961c63d3b91dd8accd44bfefecd788b7c8125d4a2ae1
MD5 d06da884f72e22cb206201b850954f5e
BLAKE2b-256 1bc202d8d4744d959370d624f1b0f53d60ecbbef4499e340e5ac212333525cf5

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