recipe-mcp について
recipe-mcp は、食事の好みや栄養目標に合わせてレシピを生成・調整する MCP サーバーです。新規作成と既存レシピの変更に対応し、API キー不要で匿名利用できますが、リクエスト数には制限があります。
主な機能
- 01自然言語の指示からレシピを生成
- 02指示に沿って既存レシピを変更
- 03食事制限とアレルギーに対応
- 04カロリー、タンパク質、分量を指定
- 05API キー不要の匿名利用
活用シーン
- 01食事の好みに合うレシピの案出し
- 02既存レシピをビーガン向けに変更
- 03カロリーやタンパク質の目標に合わせて調整
MCP 対応
MCP サーバーとして、レシピ生成と既存レシピの変換ツールを MCP クライアントに公開します。
設定
ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。
ツール
ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。
詳細
Recipe MCP Server
AI を活用したレシピの生成・変換ツールを提供する MCP(Model Context Protocol)サーバーです。食事の好みに合わせたレシピの生成、栄養目標に合わせた既存レシピの変換などができます。
Features
- 🍳 レシピの生成 - 自然言語による説明からカスタムレシピを作成します
- 🔄 レシピの変換 - 既存のレシピを変更します(ヴィーガン向けへの変更、カロリー調整など)
- 🥗 食事に関するニーズへの対応 - アレルギー、制限、食べ物の好みに対応します
- 📊 栄養目標 - 指定したカロリーやタンパク質の要件を目標に設定します
- 🆓 オープンアクセス - API キーは不要です(レート制限あり)
Installation
Claude Desktop の場合
- MCP サーバーをインストールします:
npm install -g @cookwith/recipe-mcp
- Claude Desktop の設定に追加します:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
{
"mcpServers": {
"recipe-mcp": {
"command": "npx",
"args": ["@cookwith/recipe-mcp"],
"env": {
"COOKWITH_API_URL": "https://cookwith.co"
}
}
}
}
- Claude Desktop を再起動します
開発の場合
# Clone the repository
git clone https://github.com/cookwith/recipe-mcp.git
cd recipe-mcp
# Install dependencies
npm install
# Run in development mode
npm run dev
Usage Examples
レシピを生成する
// In Claude Desktop, you can say:
"Generate a healthy Mediterranean pasta dish with lots of vegetables"
// The tool will be called with:
{
"prompt": "A healthy Mediterranean pasta dish with lots of vegetables",
"dietaryRestrictions": ["vegetarian"],
"calories": "450",
"servings": 4
}
レシピを変換する
// After generating or providing a recipe:
"Make this recipe vegan and reduce the calories by 200"
// The tool will be called with:
{
"recipe": { /* existing recipe object */ },
"instructions": "Make this vegan and reduce calories by 200",
"calories": "350"
}
Tools
generate_recipe
自然言語の指示に基づいて新しいレシピを生成します。
Parameters:
prompt(文字列、必須)- 自然言語による説明dietaryRestrictions(文字列の配列、任意)- 例:["vegetarian", "gluten-free"]allergies(文字列の配列、任意)- 避けるべき食材dislikes(文字列の配列、任意)- 除外する食べ物calories(文字列、任意)- 1 人分の目標カロリーprotein(文字列、任意)- 目標とするタンパク質量(グラム)servings(数値、任意)- 人数(1~20、デフォルト:4)
transform_recipe
指示に基づいて既存のレシピを変換します。
Parameters:
recipe(オブジェクト、必須)- 変換するレシピinstructions(文字列、必須)- レシピの変更方法calories(文字列、任意)- 新しい目標カロリーprotein(文字列、任意)- 新しい目標タンパク質量servings(数値、任意)- 新しい人数
Rate Limits
公開 API には次のレート制限があります:
- 匿名アクセス:IP アドレスごとに 1 時間あたり 20 リクエスト
- 認証は不要です
- 制限を超えた場合は
Retry-Afterヘッダーが返されます
Recipe Object Format
interface Recipe {
title: string;
description: string;
ingredients: string[]; // e.g., ["2 cups flour", "1 tsp salt"]
instructions: string[]; // Step-by-step instructions
servings: number;
prepTime?: number; // Minutes
cookTime?: number; // Minutes
totalTime?: number; // Minutes
cuisine?: string; // e.g., "Italian", "Mexican"
course?: string; // e.g., "main", "dessert"
difficulty?: string; // e.g., "easy", "medium", "hard"
calories?: number; // Per serving
protein?: number; // Grams per serving
carbs?: number; // Grams per serving
fat?: number; // Grams per serving
fiber?: number; // Grams per serving
sugar?: number; // Grams per serving
sodium?: number; // Milligrams per serving
}
Configuration
環境変数
COOKWITH_API_URL- API エンドポイント(デフォルト:https://cookwith.co)
カスタム API エンドポイント
開発環境またはセルフホストのインスタンスの場合:
export COOKWITH_API_URL=http://localhost:3000
npx @cookwith/recipe-mcp
Examples
基本的なレシピ生成
// Request
{
"prompt": "Quick and easy chicken stir-fry"
}
// Response
{
"title": "Quick Chicken Stir-Fry",
"description": "A delicious and speedy chicken stir-fry...",
"ingredients": [
"2 chicken breasts, sliced",
"2 cups mixed vegetables",
"3 tbsp soy sauce",
// ...
],
"instructions": [
"Heat oil in a large wok or skillet",
"Add chicken and cook until golden",
// ...
],
"servings": 4,
"prepTime": 10,
"cookTime": 15,
"calories": 320,
"protein": 28
}
レシピの変換
// Request
{
"recipe": {
"title": "Classic Beef Lasagna",
"ingredients": ["1 lb ground beef", "ricotta cheese", ...],
// ... full recipe
},
"instructions": "Make this vegetarian and lower in calories"
}
// Response
{
"title": "Vegetarian Light Lasagna",
"description": "A healthier vegetarian version...",
"ingredients": [
"2 cups chopped mushrooms",
"1 cup low-fat ricotta",
// ... transformed ingredients
],
// ... rest of transformed recipe
}
Troubleshooting
レート制限エラー
429 エラーが返された場合、レート制限を超えています。次のリクエストを送信する前に、retryAfter フィールドに指定された時間だけ待ってください。
接続の問題
インターネット接続が安定しており、API エンドポイントにアクセスできることを確認してください。
無効なパラメーター
パラメーターが想定される形式と制約(例:servings が 1~20 の範囲)に合っていることを確認してください。
Contributing
コントリビューションを歓迎します!詳細はコントリビューションガイドをご覧ください。
License
MIT License - 詳細はLICENSEファイルをご覧ください。
Support
- 🐛 問題を報告
- 💬 ディスカッション
- 📧 メール:[email protected]
Powered By
- Cookwith - AI を活用した料理プラットフォーム
- OpenAI GPT-4 - レシピ生成
- Model Context Protocol - ツール連携
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。