Skip to main content
Glama
MealCP MCP

MealCP MCP

Official
by MealCP

MealCP MCP

Official Model Context Protocol server for MealCP — the grocery & food data layer for AI agents.

Exposes two tools over the MealCP public API:

  • search_products — search the grocery product catalog by keyword with faceted filtering (country, retailer, chain, brand, tag, category, city, price range, sort, pagination).

  • get_price_history — aggregated price-history stats (min/max/avg/first/ last, net change) for one product over a date range.

Requirements

  • Python 3.10+

  • An API key from MealCP (each tool call consumes 1 credit)

Related MCP server: market-fiyatlari-mcp-server

Usage

Run directly with uv:

uvx mealcp-mcp

Or install:

pip install mealcp-mcp
mealcp-mcp

The server speaks MCP over stdio; any MCP host (Claude Desktop, opencode, Cursor, …) can spawn it.

Claude Desktop

{
  "mcpServers": {
    "mealcp": {
      "command": "uvx",
      "args": ["mealcp-mcp"],
      "env": {
        "MEALCP_API_URL": "https://api.mealcp.com",
        "MEALCP_API_KEY": "mcp_live_your_key_here"
      }
    }
  }
}

opencode

{
  "mcp": {
    "mealcp": {
      "type": "local",
      "command": ["uvx", "mealcp-mcp"],
      "enabled": true,
      "environment": {
        "MEALCP_API_URL": "https://api.mealcp.com",
        "MEALCP_API_KEY": "mcp_live_your_key_here"
      }
    }
  }
}

Configuration

Variable

Default

Description

MEALCP_API_URL

http://localhost:8000

Base URL of the MealCP API

MEALCP_API_KEY

(none)

X-API-Key sent with every request

Errors

Tool errors surface the API's stable error tokens, formatted <code>: <message> (e.g. not_found: Product not found). Branch on the code, never the message.

Contract

Response models are generated from the API's OpenAPI spec (contract/openapi.json, currently version 0.1.0). Refresh with:

uvx --from datamodel-code-generator datamodel-codegen \
  --input contract/openapi.json \
  --output src/mealcp_mcp/models.py \
  --output-model-type pydantic_v2.BaseModel \
  --target-python-version 3.10 --disable-timestamp

Development

uv sync
uv run pytest
uv run ruff check .

License

MIT

Available Tools

2 tools
get_price_historyA

Get aggregated price-history stats for one product over a date range.

Returns min/max/avg/first/last price plus the net change over the window, pooled across every store carrying the product. Pair with search_products first and pass a hit's id here verbatim.

Args: product_id: Opaque product id from a search hit (e.g. rp_550e8400e29b41d4a8b2c3d1e9f7a6c8). from_date: ISO date, inclusive lower bound (e.g. "2026-01-01"). to_date: ISO date, inclusive upper bound; defaults to today.

Returns: Aggregated price-history stats.

Raises: mcp.server.mcpserver.exceptions.ToolError: If the API is unavailable or the product is not found; the message starts with the API's stable error token.

Inputs: from_date (required), product_id (required), to_date. Returns: id, name, brand, change, +14 more

search_productsA

Search the grocery product catalog by keyword with faceted filtering.

Returns matching products with name, brand, price, unit price, retailer and a URL, plus facet counts for retailers, brands and countries.

Args: q: Free-text query (e.g. "potatoes", "krumpli"). Empty returns all, sorted by sort or recency. country: ISO 3166-1 alpha-2 country code (e.g. HU, FR). retailer: Retailer slug (e.g. tesco-hu, auchan-fr). chain: Chain slug (e.g. tesco, auchan). brand: Brand free-text token. tag: Tag slug (e.g. vegan). category: Category slug at any level (L1/L2/L3, e.g. fresh-produce, dairy-eggs, vegetables/potatoes); matches the whole subtree. city: City free-text token filtering stores carrying the product. currency: ISO 4217 currency code (e.g. HUF, EUR). min_price: Minimum latest price (inclusive). max_price: Maximum latest price (inclusive). sort: Stable sort token: relevance, newest, oldest, price_asc, price_desc, unit_price_asc, unit_price_desc. page: 1-indexed result page. page_size: Hits per page (1-100).

Returns: A structured search response.

Raises: mcp.server.mcpserver.exceptions.ToolError: If the search API is unavailable; the message starts with the API's stable error token.

Inputs: q, tag, city, page, +10 more. Returns: hits, page, found, query, +2 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct purposes: catalog search versus price-history retrieval for a specific product. There is no overlap in function or ambiguity about when to use each.

    Naming Consistency5/5

    Both tool names follow a consistent snake_case verb_noun pattern: search_products and get_price_history. The convention is predictable and readable.

    Tool Count3/5

    Only two tools exist for a grocery catalog and price-history server. While they are focused, the surface feels thin for the apparent domain, which likely needs more lookup or discovery operations.

    Completeness3/5

    Search is broad and returns useful facets, and price history works when paired with search. However, notable gaps remain: no direct product-detail lookup, no category/retailer/brand listing endpoints, and no multi-product comparison tools.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables searching and comparing products from Woolworths and Coles supermarkets.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables querying Open Food Facts product database by barcode, full-text search, category, brand, or country.
      123 npm
      MIT