# Tandoor MCP Server
A FastMCP server for interacting with [Tandoor Recipe Manager](https://tandoor.dev/) via the Model Context Protocol.
## Features
- **Recipe Management**: Search, view, create, and import recipes from URLs
- **Cooking History**: Track what you've cooked with ratings and notes
- **Recipe Suggestions**: Get recipe ideas based on pantry inventory
- **Meal Planning**: Plan meals with bulk scheduling support
- **Shopping Lists**: Manage shopping with bulk add/remove/check operations
- **Pantry Tracking**: Track on-hand ingredients for smarter suggestions
- **Lookups**: Search keywords, foods, and units
## Tools (4 Consolidated Tools)
### `tandoor_recipes`
| Operation | Description | Bulk Support |
|-----------|-------------|--------------|
| `list` | Search recipes by name, keywords, foods, or rating | - |
| `get` | Get full recipe with ingredients and instructions | - |
| `create` | Create a new recipe | - |
| `import` | Import recipe from URL | `urls` list |
| `history` | Get cooking history with date filtering | - |
| `log` | Log a cooked recipe with rating/notes | `logs` list |
| `suggest` | Get recipe suggestions based on pantry | - |
### `tandoor_meal_plan`
| Operation | Description | Bulk Support |
|-----------|-------------|--------------|
| `types` | List available meal types | - |
| `list` | Get meal plan entries with date filtering | - |
| `create` | Add recipe to meal plan | `meals` list |
| `create_type` | Create a new meal type | - |
| `delete` | Delete a meal plan entry | `meal_plan_ids` list |
### `tandoor_shopping_list`
| Operation | Description | Bulk Support |
|-----------|-------------|--------------|
| `list` | Get shopping list items | - |
| `add` | Add item to shopping list | `add_items` list |
| `update` | Update a shopping list item | - |
| `remove` | Remove item from shopping list | `item_ids` list |
| `check` | Check/uncheck items | `item_ids` or `items` list |
| `clear` | Clear checked items and sync to pantry | - |
### `tandoor_lookup`
| Type | Description | Bulk Support |
|------|-------------|--------------|
| `keywords` | Search recipe keywords/tags | - |
| `foods` | Search foods/ingredients | - |
| `units` | Search measurement units | - |
| `pantry` | View/update pantry inventory | `pantry_items` list |
## Bulk Operations Examples
### Plan a week of meals
```python
tandoor_meal_plan(
operation="create",
meals=[
{"recipe": "Pasta Carbonara", "date": "2025-01-27", "meal_type": 3, "servings": 4},
{"recipe": "Chicken Curry", "date": "2025-01-28", "meal_type": 3, "servings": 4},
{"recipe": "Beef Tacos", "date": "2025-01-29", "meal_type": 3, "servings": 4},
]
)
```
### Add multiple items to shopping list
```python
tandoor_shopping_list(
operation="add",
add_items=[
{"food": "Milk", "amount": 1, "unit": "gallon"},
{"food": "Eggs", "amount": 12},
{"food": "Bread", "amount": 1, "unit": "loaf"},
]
)
```
### Update pantry inventory
```python
tandoor_lookup(
type="pantry",
action="update",
pantry_items=[
{"food_name": "salt", "on_hand": True},
{"food_name": "pepper", "on_hand": True},
{"food_id": 123, "on_hand": False},
]
)
```
### Log multiple cooked recipes
```python
tandoor_recipes(
operation="log",
logs=[
{"recipe_id": "45", "servings": 4, "rating": 5, "comment": "Perfect!"},
{"recipe_id": "32", "servings": 2, "rating": 4},
]
)
```
## Configuration
Set the following environment variables:
| Variable | Description |
|----------|-------------|
| `TANDOOR_URL` | Tandoor instance URL (default: `http://web_recipes`) |
| `TANDOOR_PUBLIC_URL` | Public URL for recipe links (optional) |
| `TANDOOR_API_TOKEN` | API token from Tandoor settings |
## Running with Docker
```yaml
services:
mcp_server:
build: .
environment:
- TANDOOR_URL=http://your-tandoor-instance
- TANDOOR_PUBLIC_URL=https://recipes.example.com
- TANDOOR_API_TOKEN=your_token_here
ports:
- "8089:8000"
```
## Running Locally
```bash
pip install -r requirements.txt
export TANDOOR_URL=http://localhost:8081
export TANDOOR_API_TOKEN=your_token_here
python server.py
```
## MCP Client Configuration
```json
{
"mcpServers": {
"tandoor": {
"url": "http://localhost:8089/mcp/"
}
}
}
```
## License
MIT