mealie-mcp
mealie-mcp
一个 Model Context Protocol 服务器,它将 Mealie(一个自托管的食谱管理器)公开为一组 LLM 可调用的工具。它允许 Claude Desktop / Claude Code(或任何 MCP 客户端)在您自己的 Mealie 实例上搜索食谱、获取详细信息、管理膳食计划和编辑购物清单。
工具
工具 | 用途 |
| 搜索食谱;返回 slug、名称、描述、标签、类别 |
| 获取指定 slug 的完整食谱 JSON |
| 两个 ISO 日期之间的膳食计划条目 |
| 所有购物清单的 ID 和名称 |
| 向清单添加自由文本项目 |
| 创建一个空白食谱;返回生成的 slug |
| 添加膳食计划条目 |
Related MCP server: mealie-mcp
要求
Python 3.11+
一个正在运行的 Mealie 实例(自托管;已针对 Mealie v2 进行测试)
一个长期有效的 Mealie API 令牌(在 Mealie UI 中:用户个人资料 → API 令牌)
配置
将 .env.example 复制到 .env 并填入相应值:
cp .env.example .env变量 | 必需 | 默认 | 描述 |
| 是 | — | Mealie 实例的基础 URL(例如 |
| 是 | — | 来自 Mealie 的长期有效持有者令牌 |
| 否 |
|
|
| 否 |
| SSE 模式的绑定地址 |
| 否 |
| SSE 模式的绑定端口 |
本地安装与运行
pip install -e .
# stdio mode (for Claude Desktop):
MCP_TRANSPORT=stdio mealie-mcp
# sse/http mode (for docker-compose / remote clients):
MCP_TRANSPORT=sse MCP_PORT=8000 mealie-mcpSSE 端点位于 http://<host>:<port>/sse。
Claude Desktop 配置
编辑 Claude Desktop 的配置文件(macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"mealie": {
"command": "mealie-mcp",
"env": {
"MEALIE_URL": "http://localhost:9011",
"MEALIE_API_TOKEN": "paste-your-token-here",
"MCP_TRANSPORT": "stdio"
}
}
}
}如果 mealie-mcp 不在您的 PATH 中,请将 command 指向完整的二进制文件路径(例如 /Users/you/.venvs/mealie-mcp/bin/mealie-mcp)或通过 Python 调用:
{
"mcpServers": {
"mealie": {
"command": "python",
"args": ["-m", "mealie_mcp"],
"env": {
"MEALIE_URL": "http://localhost:9011",
"MEALIE_API_TOKEN": "paste-your-token-here",
"MCP_TRANSPORT": "stdio"
}
}
}
}编辑配置后重启 Claude Desktop。
Docker / docker-compose
包含了一个 Dockerfile。要独立运行:
docker build -t mealie-mcp .
docker run --rm -p 8765:8000 \
-e MEALIE_URL=http://host.docker.internal:9011 \
-e MEALIE_API_TOKEN=your-token \
mealie-mcp要将服务器添加到现有的 Mealie 堆栈中,请参阅 docker-compose.snippet.yml:
services:
mealie-mcp:
build:
context: ./mealie-mcp
depends_on:
- mealie
environment:
MEALIE_URL: "http://mealie:9000"
MEALIE_API_TOKEN: "${MEALIE_API_TOKEN}"
MCP_TRANSPORT: "sse"
MCP_HOST: "0.0.0.0"
MCP_PORT: "8000"
ports:
- "8765:8000"将您的 MCP 客户端指向 http://<docker-host>:8765/sse。
手动测试服务器
在 SSE 模式下运行服务器时,确认其可访问:
curl -N http://localhost:8000/sse您应该会看到一个 SSE 事件流已打开。对于 stdio 模式,Claude Desktop 会处理握手——没有 HTTP 端点。
项目布局
mealie-mcp/
├── pyproject.toml
├── Dockerfile
├── docker-compose.snippet.yml
├── .env.example
├── README.md
└── src/mealie_mcp/
├── __init__.py
├── __main__.py # CLI entry point (loads .env, dispatches transport)
├── server.py # FastMCP server + tool definitions
└── client.py # Async httpx wrapper for the Mealie REST API许可证
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Scraps Kitchen gives any AI agent a persistent, household-aware kitchen memory. Unlike generic chatbot recall, Scraps maintains structured cooking data: what's in your fridge (with freshness tracking), who you cook for (with allergens, dietary restrictions, and preferences), your recipe collection (with cook notes and per-diner ratings), your shopping list, and your kitchen equipment. 27 tools across 6 domains let agents read kitchen context, suggest meals that respect dietary safety, update the pantry after cooking, and build a history of what works for your household. Every interaction makes the data richer. Cooking history, preference signals, kitchen awareness = better suggestions next time. All tools work via oAuth and a free scraps.kitchen account.
Household meal planning: recipes, weekly meal plans, and grocery lists for your AI agent.
Recipe search, ingredient matching, nutrition filters and a private cookbook for any AI agent.
Household-aware cooking brain: pantry, meal suggestions, dietary safety, recipes, shopping lists.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Mealie for recipe management, meal planning, and shopping list operations. Supports searching and managing recipes, creating meal plans, and generating shopping lists from recipes or meal plans.10MIT
- AlicenseCqualityBmaintenanceExposes every endpoint of the Mealie REST API as MCP tools, enabling LLMs to manage recipes, meal plans, shopping lists, and more.211481 npm4MIT
- AlicenseBqualityBmaintenanceEnables AI agents to manage recipes, meal plans, shopping lists, recipe imports, Bring! grocery sync, Mercadona price lookups, and optional nutrition using a self-hosted Mealie instance.24123 PyPIAGPL 3.0
- AlicenseAqualityBmaintenanceEnables Claude to search, create, and update recipes and manage meal plans in a Mealie instance, including importing recipes from URLs.8MIT