skip to content

Grocy

An agent for the shopping list, for requests such as “add milk to the shopping list”.

MCP server github.com/miguelangel-nubla/mcp-grocy
Transport Streamable HTTP
Authentication bearer

In Compose, beside the server of Ambrogio, with its HTTP server on and only the Streamable HTTP transport:

services:
grocy-mcp:
image: ghcr.io/miguelangel-nubla/mcp-grocy:v2.10.0
environment:
GROCY_BASE_URL: http://<grocy-host>
GROCY_API_KEY: ${GROCY_API_KEY:?}
ENABLE_HTTP_SERVER: "true"
MCP_HTTP_TRANSPORT_ONLY: "true"
HTTP_SERVER_PORT: "8080"
MCP_HTTP_ACCESS_TOKEN: ${GROCY_MCP_TOKEN:?}

It serves Streamable HTTP on port 8080 at /mcp, so the server of Ambrogio reaches it at http://grocy-mcp:8080/mcp, the name of its Compose service on a network the two share; from another host, use the name or address of the host that runs it, with the same port and path.

GROCY_API_KEY is how the MCP server signs in to Grocy: an API key, created in Grocy under Settings, Manage API keys.

  1. Run the MCP server, as Run the MCP server shows.

  2. Choose the token that the MCP server accepts, a random value such as the output of openssl rand -hex 32: the same value goes to the MCP server, as MCP_HTTP_ACCESS_TOKEN above, and to Ambrogio. Write it in .env as GROCY_MCP_TOKEN, and pass the variable to the server of Ambrogio in compose.yaml:

    services:
    server:
    environment:
    GROCY_MCP_TOKEN: ${GROCY_MCP_TOKEN:?}
  3. Add the agent file agents/grocy.json, with the address of the Streamable HTTP endpoint of the MCP server in mcp.url:

    {
    "description": "Answers the household's requests about the shopping list, with the tools of Grocy.",
    "instructions": "You handle the household's requests about the shopping list with the tools of Grocy. Requests may come from speech recognition and contain misheard words; interpret them in context. Answer briefly.",
    "llm": {
    "provider": "mistral",
    "model": "mistral-medium-latest",
    "apiKeyEnv": "MISTRAL_API_KEY"
    },
    "maxToolCalls": 4,
    "mcp": {
    "url": "http://grocy-mcp:8080/mcp",
    "auth": {
    "type": "bearer",
    "tokenEnv": "GROCY_MCP_TOKEN"
    }
    }
    }
  4. Restart with docker compose up -d.

Authentication: a bearer token, which the agent file names through the variable GROCY_MCP_TOKEN. The description, the instructions, the language model and maxToolCalls are an example: adapt them to the household. See Agents for every field of the file.