Skip to main content

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)

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

Metadata

Release files for mealcp-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mealcp-mcp 0.1.0
File Size Uploaded
mealcp_mcp-0.1.0.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mealcp-mcp 0.1.0
File Interpreter ABI Platform
mealcp_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / mealcp_mcp-0.1.0.tar.gz

Download URL mealcp_mcp-0.1.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
db45720a9195a7338cf46b840b5e72747ff0a9e1a4d784eca5b840e4c1483e1e
BLAKE2b-256 checksum
How to use checksums
4dbf85dfdc1e56b6a75ab9e120be3af8ea071efce8645be861b15f66fdf0ce61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mealcp_mcp-0.1.0-py3-none-any.whl

Download URL mealcp_mcp-0.1.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
feae18ffcd097c453659118db7e4bea918057c28a148510bf4f6e5fc7a38668a
BLAKE2b-256 checksum
How to use checksums
859732866cbb783b896009c0ed76ca6516a15c49e759e0ef4d805719e2307b89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page