使用说明
Mealie MCP服务器
用于与自托管Mealie配方管理实例交互的MCP(模型上下文协议)服务器。
特性
- 配方CRUD+导入+刮擦测试+建议
- 购物清单/商品管理(包括批量商品创建)
- 食谱组织(类别、标签、工具、食物、单位、标签)
- 成分解析/形式化
- 导入清理助手:
import_or_get_recipe_from_urlset_recipe_organizersset_recipe_instructionsget_recipe_ingredient_rowsupdate_recipe_ingredient_rowupdate_recipe_ingredient_rowsadd_recipe_ingredient_rowdelete_recipe_ingredient_rowget_recipe_cleanup_summaryget_or_create_food
- 两个服务器配置文件:
core(精益默认)full(更宽的表面)
快速启动(默认操作)
- 配置环境:
cp .env.example .env
# edit .env and set MEALIE_URL + MEALIE_API_TOKEN
- 安装依赖项:
uv sync
- 运行服务器(默认:通过stdio运行核心配置文件):
uv run fastmcp run src/mealie_mcp/server_core.py
使用 src/mealie_mcp/server_full.py 相反,如果你想要完整的工具表面。
与MCP客户端一起使用
Stdio客户端(推荐默认)
{
"mcpServers": {
"mealie": {
"command": "uv",
"args": ["run", "fastmcp", "run", "src/mealie_mcp/server_core.py"],
"cwd": "/path/to/mealie-mcp-server"
}
}
}
流式HTTP客户端(Codex自定义MCP、n8n等)
以HTTP模式运行服务器:
uv run fastmcp run src/mealie_mcp/server_core.py --transport streamable-http --host 127.0.0.1 --port 8000 --path /mcp
端点:
http://127.0.0.1:8000/mcp
对于完整配置文件,请交换 server_core.py 随着 server_full.py.
开发(检查员)
fastmcp dev 意味着:使用MCP Inspector UI运行服务器,进行交互式本地开发/调试。
uv run fastmcp dev src/mealie_mcp/server_core.py
检查器UI: http://127.0.0.1:6274
测试/诊断
# list tools
uv run python test_cli.py --list
# run a specific tool (simple call)
uv run python test_cli.py get_recipes
# inspect server metadata
uv run fastmcp inspect src/mealie_mcp/server_core.py
当前检查的工具数量:
core:65个工具full:75个工具
项目结构
mealie-mcp-server/
├── src/mealie_mcp/
│ ├── server.py
│ ├── server_core.py
│ ├── server_full.py
│ └── client.py
├── test_cli.py
├── MEALIE_API_REFERENCE.md
├── SYSTEM_PROMPT.md
├── TESTING_GUIDE.md
└── pyproject.toml
备注
- 如果您的MCP客户端是远程的(例如,托管n8n),则无法访问您的本地
127.0.0.1;使用隧道URL。 core是降低工具元数据开销的推荐默认值。
