Metadata-Version: 2.4
Name: mcp-mealie
Version: 0.1.0
Summary: MCP server for Mealie
Keywords: mcp,mealie,model-context-protocol
Author: Matthew O'Brien
Author-email: Matthew O'Brien <matthew@obrien.dev>
License-Expression: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Dist: mcp>=1.27.0,<2
Requires-Dist: httpx>=0.28.0
Requires-Python: >=3.14
Project-URL: Repository, https://github.com/obrien-matthew/mcp-mealie
Project-URL: Issues, https://github.com/obrien-matthew/mcp-mealie/issues
Description-Content-Type: text/markdown

# mcp-mealie

MCP server for [Mealie](https://mealie.io/) — exposes a Mealie instance's REST
API to MCP clients (Claude Desktop, Claude Code, etc.) so an LLM can read,
search, scrape, edit, and delete recipes on your behalf.

## Prerequisites

- Python 3.14+
- [uv](https://docs.astral.sh/uv/)
- A reachable Mealie instance (self-hosted or otherwise)
- A Mealie API token: in Mealie, click your avatar → **Profile** → **API Tokens**
  → **Generate**. The token inherits the issuing user's permissions, so for
  automation prefer a dedicated non-admin user.

## Setup

```bash
uv sync
```

## Configuration

Two environment variables are required:

| Variable             | Purpose                                            |
| -------------------- | -------------------------------------------------- |
| `MEALIE_BASE_URL`    | Root URL of your Mealie instance, no trailing path |
| `MEALIE_API_TOKEN`   | Long-lived bearer token from Profile → API Tokens  |

### Claude Desktop

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

```json
{
  "mcpServers": {
    "mealie": {
      "command": "uvx",
      "args": ["mcp-mealie"],
      "env": {
        "MEALIE_BASE_URL": "https://mealie.example.com",
        "MEALIE_API_TOKEN": "eyJhbGc..."
      }
    }
  }
}
```

### Claude Code

```bash
claude mcp add mealie \
  -e MEALIE_BASE_URL=https://mealie.example.com \
  -e MEALIE_API_TOKEN=eyJhbGc... \
  -- uvx mcp-mealie
```

## Tools

### Diagnostics

| Tool         | Description                                      |
| ------------ | ------------------------------------------------ |
| `get_about`  | Mealie version / health (no auth required)       |
| `whoami`     | Current user — confirms the token works          |

### Recipes (full CRUD)

| Tool                      | Description                                           |
| ------------------------- | ----------------------------------------------------- |
| `list_recipes`            | Paginated list with optional search and ordering      |
| `get_recipe`              | Full recipe by slug (ingredients, steps, tags, etc.)  |
| `create_recipe`           | Create an empty recipe by name; returns the new slug  |
| `create_recipe_from_url`  | Scrape a recipe from a URL via Mealie's scraper       |
| `update_recipe`           | Patch common fields (name, description, times, etc.)  |
| `delete_recipe`           | Delete a recipe by slug (permanent)                   |

## Development

```bash
uv sync
uv run pytest tests/ -x -q
uv run ruff check src/ tests/
uv run pyright src/
```
