内容
mealie-mcp-server
===
[](https://github.com/timo-reymann/mealie-mcp-server/blob/main/LICENSE)
[](https://github.com/timo-reymann/mealie-mcp-server/actions/workflows/ci.yml)
[](https://github.com/timo-reymann/mealie-mcp-server/releases)
[](https://renovatebot.com)
一款适用于 [Mealie](https://github.com/mealie-recipes/mealie) 配方管理的 [模型上下文协议(MCP)](https://modelcontextprotocol.io) 服务器。为 AI 助手提供了 43 种工具和 1 种提示,用于搜索、创建和管理配方、膳食计划、购物清单、类别和标签。
<p align="center">
<img src="https://raw.githubusercontent.com/timo-reymann/mealie-mcp-server/main/.github/images/logo.png" alt="Logo" />
<br />
通过 MCP 协议与 AI 助手交互你的 Mealie 配方数据库。
</p>
## 功能
- **配方管理** — 搜索、创建、修改、复制和删除配方。批量获取多个配方。
- **膳食计划** — 查看、创建和批量创建膳食计划。复合工具通过并发批量请求获取包含营养信息的膳食计划和配方详情,消除 N+1 查询问题。
- **购物清单** — 完整的 CRUD 功能(创建、读取、更新、删除),以及批量操作和配方到清单的集成。
- **类别和标签** — 完整的 CRUD 功能,用于组织配方,包括空类别/标签检测。
- **批量和复合工具** — `get_recipes_batch` 和 `get_recipes_detailed_batch` 用于并发配方查找,`get_mealplan_with_recipes` 用于获取包含配方数据的膳食计划和客户端日期过滤。
- **零运行时依赖** — 使用原生的 `fetch`,无需 axios 或 httpx。
## 要求
- [Node.js](https://nodejs.org/) >= 22
- 一个运行中的 [Mealie](https://github.com/mealie-recipes/mealie) 实例,并具有 API 密钥
## 安装
### 快速开始(npx)
```bash
MEALIE_BASE_URL=https://your-mealie-instance.com \
MEALIE_API_KEY=your-api-key \
npx mealie-mcp-server
```
### opencode 配置
在你的 `opencode.json` 中添加:
```json
{
"mcp": {
"mealie-mcp-server": {
"type": "local",
"command": ["npx", "mealie-mcp-server"],
"enabled": true,
"environment": {
"MEALIE_BASE_URL": "https://your-mealie-instance.com",
"MEALIE_API_KEY": "your-api-key"
}
}
}
}
```
### 本地开发
```bash
git clone https://github.com/timo-reymann/mealie-mcp-server.git
cd mealie-mcp-server
corepack enable
yarn install
cp .env.template .env
# 编辑 .env 文件,添加你的 MEALIE_BASE_URL 和 MEALIE_API_KEY
yarn dev
```
确保 `MEALIE_BASE_URL` 和 `MEALIE_API_KEY` 已在你的环境或 opencode 配置中设置。
## 文档
查看 [API 覆盖范围](./API_COVERAGE.md),了解所有 42 种工具及其对应的 Mealie API 端点。
## 贡献
欢迎你的参与!请阅读 [贡献指南](./CONTRIBUTING.md) 以开始。
## 开发
### 要求
- [Node.js](https://nodejs.org/) >= 22
- [Yarn](https://yarnpkg.com/) (通过 Corepack: `corepack enable`)
- 用于集成测试的 [Mealie](https://github.com/mealie-recipes/mealie) 实例(或模拟 fetch 层)
### 测试
```bash
yarn test
```
### 类型检查
```bash
yarn typecheck
```
### 构建
```bash
yarn build
```
### 校验
```bash
yarn lint
```
## 可用工具(共 43 种)
### 配方(11 种)
`get_recipes`, `get_recipe_detailed`, `get_recipe_concise`, `get_recipes_batch`, `get_recipes_detailed_batch`, `create_recipe`, `patch_recipe`, `duplicate_recipe`, `mark_recipe_last_made`, `set_recipe_image_from_url`, `delete_recipe`
### 膳食计划(5 种)
`get_all_mealplans`, `get_mealplan_with_recipes`, `create_mealplan`, `create_mealplan_bulk`, `get_todays_mealplan`
### 类别(7 种)
`get_categories`, `get_empty_categories`, `create_category`, `get_category`, `get_category_by_slug`, `update_category`, `delete_category`
### 标签(7 种)
`get_tags`, `get_empty_tags`, `create_tag`, `get_tag`, `get_tag_by_slug`, `update_tag`, `delete_tag`
### 购物清单(13 种)
`get_shopping_lists`, `create_shopping_list`, `get_shopping_list`, `update_shopping_list`, `delete_shopping_list`, `add_recipe_to_shopping_list`, `remove_recipe_from_shopping_list`, `get_shopping_list_items`, `create_shopping_list_item`, `create_shopping_list_items_bulk`, `update_shopping_list_item`, `delete_shopping_list_item`, `delete_shopping_list_items_bulk`
## 许可证
[MIT](./LICENSE)
连接信息
猜你喜欢
暂无推荐服务器