食谱生成服务

一个基于AI的食谱生成和转换工具,支持个性化食谱创建、饮食限制调整和营养目标设定。

  • by valetdotdev
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 blaideinc/cookwith-mcp

使用说明

使用MCP服务器进行烹饪

MCP(模型上下文协议)服务器,使用Cookwith的高级烹饪人工智能提供人工智能驱动的食谱生成和转换工具。

特性

  • 配方生成:根据自然语言描述创建自定义食谱
  • 配方转换:根据饮食需求、份量或其他要求修改现有食谱
  • 饮食支持:处理过敏、饮食限制和营养目标
  • 智能适应:根据卡路里、蛋白质目标和食用次数进行调整

安装

通过MCP注册表

npx @modelcontextprotocol/create-server install @cookwith/mcp-server

通过npm

npm install -g @cookwith/mcp-server

适用于克劳德桌面

添加到您的Claude Desktop配置中:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 视窗: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "cookwith": {
      "command": "npx",
      "args": ["@cookwith/mcp-server"]
    }
  }
}

可用工具

generate_recipe

根据自然语言指令生成新配方。

参数:

  • prompt (字符串,必填):所需配方的自然语言描述
  • dietaryRestrictions (数组):饮食限制(例如素食、纯素、无麸质)
  • allergies (数组):因过敏而应避免的成分
  • dislikes (array):用户不喜欢的食物
  • calories (string):每份目标卡路里
  • protein (string):每份目标蛋白质的克数
  • servings (number):份数(1-20,默认值:4)

例子:

{
  "prompt": "A healthy pasta dish with lots of vegetables",
  "dietaryRestrictions": ["vegetarian"],
  "calories": "500",
  "servings": 2
}

transform_recipe

根据说明转换或修改现有配方。

参数:

  • recipe (object,必填):要转换的配方
    • title (字符串):配方标题
    • description (string):配方说明
    • ingredients (array):成分列表
    • instructions (数组):烹饪说明
    • servings (数量):份数
    • 营养、时间等其他可选字段。
  • instructions (string,必填):如何转换配方
  • calories (string):每份新的目标卡路里
  • protein (string):每份新的目标蛋白
  • servings (数量):新的份数

例子:

{
  "recipe": {
    "title": "Classic Spaghetti Carbonara",
    "description": "Traditional Italian pasta dish",
    "ingredients": ["400g spaghetti", "200g guanciale", "4 eggs", "100g pecorino"],
    "instructions": ["Cook pasta", "Fry guanciale", "Mix eggs and cheese", "Combine"],
    "servings": 4
  },
  "instructions": "Make it vegetarian and reduce calories",
  "calories": "400"
}

使用示例

与克劳德

配置后,您可以使用自然语言与工具进行交互:

"Generate a healthy dinner recipe for 2 people with chicken and vegetables, around 500 calories per serving"

"Transform this pasta recipe to be gluten-free and dairy-free"

程序化使用

import { Client } from '@modelcontextprotocol/sdk';

const client = new Client({
  name: 'my-app',
  version: '1.0.0'
});

await client.connect('npx', ['@cookwith/mcp-server']);

// Generate a recipe
const result = await client.callTool('generate_recipe', {
  prompt: 'Quick and healthy breakfast',
  calories: '350',
  servings: 1
});

发展

从源头构建

git clone https://github.com/blaideinc/cookwith-mcp
cd cookwith-mcp
npm install
npm run build

本地运行

npm start

测试

npm test

API端点

MCP服务器也可以通过HTTP访问:

  • 生产: https://cookwith.co/api/mcp
  • 发展: http://localhost:3000/api/mcp

许可证

麻省理工学院

支持

关于Cookwith

Cookwith是一个基于人工智能的烹饪平台,可根据您的偏好、饮食限制和口味特征生成个性化食谱。了解更多信息,请访问 cookwith.co.