Skip to main content
Glama
jihopark

Grocery Logger MCP Server

by jihopark
README.md
# Grocery Logger MCP Server

A Model Context Protocol (MCP) server for logging and analyzing grocery purchases. Works with Claude Desktop to track prices, spending patterns, and purchase history.

## Features

- **Bulk add grocery items** with timestamp, vendor, item name, category, price, quantity, and unit
- **Query item prices** with average price and purchase history
- **List items by category** with price statistics
- **Analyze spending** by vendor, category, or date range
- **List categories** to maintain consistency when logging

## Installation

Requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).

```bash
# Clone the repo
git clone <your-repo-url>
cd grocery_mcp

# Install dependencies
uv sync
```

## Claude Desktop Configuration

Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "grocery-logger": {
      "command": "/usr/local/bin/uv",
      "args": [
        "run",
        "--directory", "/path/to/grocery_mcp",
        "grocery-mcp"
      ]
    }
  }
}
```

Then restart Claude Desktop.

## Available Tools

| Tool | Description |
|------|-------------|
| `add_grocery_items` | Bulk add grocery purchases |
| `query_item_price` | Get price history and average for an item |
| `list_items_by_category` | List all items in a category with stats |
| `query_spending` | Analyze spending by vendor, category, or date |
| `list_categories` | List existing categories for consistency |

## Example Usage

Once configured, ask Claude:

- "Log these groceries: 2 lbs bananas $2.99, 1 gallon milk $4.50 from Costco"
- "What was the price of green onions?"
- "How much did I spend at Trader Joes this month?"
- "Show me all produce items I've bought"
- "What's my average spending by category?"

## Data Storage

Grocery data is stored in `data/grocery.db` (SQLite). This file is gitignored to keep your personal data private.

TDQS

A3.9/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct action+resource: single-item price lookup, category listing, aggregate spending analysis, bulk insertion, and category enumeration. The two read tools that surface prices (query_item_price vs list_items_by_category) differ clearly in scope (one item's history vs all items in a category).

Naming Consistency5/5

All names follow a consistent snake_case verb_noun pattern (query_item_price, list_items_by_category, query_spending, add_grocery_items, list_categories). The query_/list_/add_ verb prefixes are used predictably.

Tool Count5/5

Five tools is well-scoped for a focused grocery logging server; each tool covers a distinct, non-redundant operation. No bloat or trivial padding.

Completeness3/5

The surface covers create and several read operations but lacks any update or delete tool, so agents cannot correct or remove mislogged purchases. Core workflows (log + query price/spending) are supported, but the lifecycle is incomplete.

Maintenance

ActivityInactive
ResponsivenessNo issues