MCP server for the Spoonacular Food API - search recipes, get nutrition info, and more
npm install spoonacular-mcpbash
npm install -g spoonacular-mcp
`
$3
1. Get a Spoonacular API key (free at https://spoonacular.com/food-api/console#Dashboard)
2. Set your API key as an environment variable:
`bash
# Windows (PowerShell)
$env:SPOONACULAR_API_KEY="your_api_key_here"
# macOS/Linux
export SPOONACULAR_API_KEY="your_api_key_here"
`
$3
Add this configuration to your MCP client (Claude Desktop, etc.):
`json
{
"servers": {
"spoonacular": {
"command": "spoonacular-mcp",
"env": {
"SPOONACULAR_API_KEY": "your_api_key_here"
}
}
}
}
`
$3
`bash
Set your API key
export SPOONACULAR_API_KEY="your_key_here"
Test the server
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | spoonacular-mcp
`
Available Tools
$3
Search for recipes with various filters.
Parameters:
- query (string): Search query for recipes
- number (number, 1-100): Number of results (default: 10)
- diet (string, optional): Diet type (vegetarian, vegan, gluten-free, etc.)
- intolerances (string, optional): Comma-separated intolerances
- includeIngredients (string, optional): Required ingredients (comma-separated)
- excludeIngredients (string, optional): Ingredients to exclude (comma-separated)
- type (string, optional): Meal type (main course, side dish, dessert, etc.)
- cuisine (string, optional): Cuisine type (italian, mexican, chinese, etc.)
$3
Get detailed information about a specific recipe.
Parameters:
- id (number): Recipe ID
- includeNutrition (boolean): Include nutrition information (default: false)
$3
Search for ingredients by name.
Parameters:
- query (string): Ingredient search query
- number (number, 1-100): Number of results (default: 10)
- metaInformation (boolean): Include meta information (default: false)
$3
Analyze nutrition for a list of ingredients.
Parameters:
- ingredientList (string): List of ingredients, one per line
- servings (number): Number of servings
$3
Find recipes based on available ingredients.
Parameters:
- ingredients (string): Comma-separated list of available ingredients
- number (number, 1-100): Number of recipes (default: 5)
- ranking (number, 1-2): Ranking strategy (1=maximize used, 2=minimize missing)
$3
Get random recipes with optional filtering.
Parameters:
- number (number, 1-100): Number of random recipes (default: 1)
- tags (string, optional): Comma-separated tags for filtering
Development
To run in development mode:
`bash
npm run dev
`
To build:
`bash
npm run build
``