
Cook (Cooklang recipes)
io.github.cook-mdv0.2.3更新於 Oct 6, 2026
Cooklang recipes for AI agents: validate, meal plans, shopping lists, pantry, nutrition
概覽
讓 AI 助理讀取、搜尋、驗證並寫入本機 Cooklang 食譜與菜單,產生購物清單、管理庫存並輸出報告
- 功能
- 讓助理存取存放純文字 Cooklang .cook 與 .menu 檔案的資料夾。免費的本機工具可列出、讀取、搜尋、驗證與寫入食譜和菜單,產生依貨架分區並扣除庫存的購物清單,追蹤庫存數量與保存期限,並渲染 Jinja 報告範本(R38-R51)。使用 cook.md 登入後還可取得營養資料、單位換算、食材與包裝商品查詢、每日參考攝取量,以及從網頁、照片或社群連結匯入食譜(R52-R63)。此外也提供 Cooklang 規格、語法、菜單格式與各技能指南等資源與提示(R69-R74)。
- 適用情境
- 如果你以 Cooklang 檔案保存食譜,並希望助理規劃餐點、產生購物清單、檢查整個食譜庫的錯誤,或回答用現有庫存能煮什麼,就值得安裝。它也適合需要營養估算或從照片與連結匯入食譜的使用者,這些功能需要 cook.md 帳號。如果你不使用 Cooklang 或需要 Windows 支援,則不必安裝。(R4、R5、R10、R11)
- 執行需求
- 以 stdio 在本機執行,通常透過 npx @cookmd/mcp 啟動,因此需要 Node.js。支援 macOS(arm64、x64)與 Linux(x64、arm64、glibc 2.35 以上),目前沒有 Windows 版本(R10、R11、R89)。本機的食譜、庫存、購物清單與報告工具不需要帳號。營養計算以及照片或社群連結匯入需要 cook.md 登入(Cook Basic 或 Pro)。可選變數:COOK_RECIPES_DIR、COOKMD_BASE_URL、NUTRITION_API_URL、NUTRITION_API_TOKEN、COOK_MCP_AUTH_PATH(R93-R100)。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Cook (Cooklang recipes),將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
cook-mcp
An MCP server that gives your AI agent (Claude Code, Claude Desktop, Cursor, ChatGPT, or any other MCP client) access to your Cooklang recipe collection. Recipes stay as plain .cook and .menu files in a folder you own. The agent can read, search, validate and write them, build shopping lists, track a pantry and render reports, all locally and without an account. With a cook.md login it can also compute nutrition and import recipes from photos and social links.
Install
Claude Code:
Any client that takes an mcpServers config:
If COOK_RECIPES_DIR is not set, the server uses the workspace folder your client shares, or the folder the client was started in. See How the recipe folder is chosen.
Supported platforms: macOS (arm64, x64) and Linux (x64, arm64, glibc 2.35 or newer). There are no Windows builds yet.
Setup notes for specific clients: https://cook.md/help/mcp
Claude Code plugin
Claude Code users can install the cooklang plugin instead of adding the server by hand. It lives in cooklang/cooklang-skills and bundles this server plus the skills below:
The plugin starts the server with your Claude Code project folder as the recipe root, and Claude Code picks the right skill from what you ask ("plan dinners for next week", "is this recipe valid?"). If you already added the server with claude mcp add cook, remove that entry so you don't run two copies.
The skills (also served by this server as cooklang://skills/<name> resources):
skills/ in this repo is the canonical copy; the plugin repo syncs from it. Each skill is skills/<name>/SKILL.md.
Tools
Free (local, no login)
Cook Basic / Pro (cook.md login)
import_recipe from a web page or pasted text works without a login. Photos and social-media links need a cook.md account and use your import allowance. It returns Cooklang text and does not save it; the agent validates it and calls write_recipe. Nutrition functions inside render_report also need Cook Basic or Pro.
Prompts and resources
Prompts: meal-planning, shopping-list, pantry, import-recipe, edit-recipe, nutrition-report, nutrition-goals, scale-recipe.
Resources:
cooklang://spec: the Cooklang specificationcooklang://syntax: a syntax referencecooklang://menu-format: the.menumeal plan formatcooklang://skills/<name>: working guides for the agent, one per skill in the table above:cooklang-editing,cooklang-validation,export-recipe,meal-planning,metadata,nutrition-goals,nutrition-reports,organize-collection,pantry,recipe-import,recipe-search,report-authoring,scale-recipe,shopping-list
Safety
- Writes stay inside the recipe root. Paths outside it are refused.
- Every write is validated first; invalid Cooklang is not saved.
- The deprecated
>>metadata syntax is refused. Use YAML frontmatter. - There is no delete tool. The agent cannot remove your files.
Known limitations
- Pantry subtraction in shopping lists only works when units match. For example, 1 kg in the pantry does not cancel 200 g in a recipe. This is a limitation of cookcli-core.
- Symlinks inside the recipe folder are mostly not followed for reads and listing. A symlink requested by bare name without an extension, or reached through a recipe's
@./reference, may still be followed. This only matters if you put symlinks pointing outside the folder into your recipes. - No Windows builds yet.
- No delete tool.
Environment variables
How the recipe folder is chosen
COOK_RECIPES_DIR, if set. Nothing else is consulted.- The client's MCP roots. If the client supports roots (it shares its open workspace folders with the server), the first
file://root that is an existing folder becomes the recipe root. The server asks on the first recipe tool call and again whenever the client reports that its roots changed. If the client doesn't answer within 5 seconds, the server uses the working directory and asks again later (at most once every 30 seconds). - The folder the client started the server in.
A root is a folder you opened on purpose, so it is used unless it is /, your home folder or inside an agent plugin install folder (for example ~/.codex/plugins/cache/..., ~/.gemini/extensions/... or the folder CLAUDE_PLUGIN_ROOT points to). The working directory is checked more strictly: it is also refused when it, or a folder up to four levels above it, has .claude-plugin/plugin.json, an Agent Plugins plugin.json or gemini-extension.json, because a plugin that starts the server in its own install folder would otherwise expose the wrong files and write recipes into a folder that is wiped on update. When nothing usable is found, recipe tools say that no recipe folder is set, why, and that COOK_RECIPES_DIR fixes it; auth_status shows recipe_root_source: "unset". Otherwise recipe_root_source is env, roots or cwd.
What each client does:
-
Claude Code sends its project folder as a root (verified), so nothing to configure.
-
Codex sends no roots (verified with 0.160.1) and may start the server in a plugin folder, so set
COOK_RECIPES_DIR: -
VS Code and Cursor document support for roots (not verified here). If recipe tools say no folder is set, set
COOK_RECIPES_DIRin the server's config.
Things to ask
- "Plan dinners for next week from my recipes and make the shopping list."
- "What can I cook with what's in my pantry?"
- "Check my whole collection for broken references."
- "Import https://example.com/some-recipe as a recipe."
- "How much protein is in this week's plan?" (needs Cook Basic or Pro)
Building from source
The binary is target/release/cook-mcp. It speaks MCP over stdio. cook-mcp login and cook-mcp logout manage the cook.md login from a terminal.
Migrating from nutrition-mcp
@cookmd/nutrition-mcp keeps working: it is now a thin shim that runs @cookmd/mcp. To switch, change the package name in your MCP config to @cookmd/mcp. Your login carries over.
Two things changed. Recipe tools need COOK_RECIPES_DIR (old configs did not set it), or start the client in your recipe folder; without either, recipe tools tell the agent that no recipe folder is set. And render_report paths are now relative to the recipe folder.
License
MIT
來源:README.md,提交 19d4f47
工具
0版本歷史
1- v0.2.3最新Oct 6, 2026


