{
  "markdown": "<img src=\"assets/icon-128.png\" alt=\"\" width=\"96\" align=\"right\">\n\n# mcp-bbc-goodfood\n\n[![npm](https://img.shields.io/npm/v/mcp-bbc-goodfood.svg)](https://www.npmjs.com/package/mcp-bbc-goodfood)\n[![CI](https://github.com/smeet666/mcp-bbc-goodfood/actions/workflows/ci.yml/badge.svg)](https://github.com/smeet666/mcp-bbc-goodfood/actions/workflows/ci.yml)\n[![license](https://img.shields.io/npm/l/mcp-bbc-goodfood.svg)](./LICENSE)\n[![MCP Registry](https://img.shields.io/badge/MCP_Registry-listed-6E56CF)](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.smeet666/mcp-bbc-goodfood)\n[![Glama](https://glama.ai/mcp/servers/smeet666/mcp-bbc-goodfood/badges/score.svg)](https://glama.ai/mcp/servers/smeet666/mcp-bbc-goodfood)\n[![M8ven](https://m8ven.ai/badge/mcp/smeet666-mcp-bbc-goodfood-mij0e9?variant=verified)](https://m8ven.ai/mcp/smeet666-mcp-bbc-goodfood-mij0e9)\n[![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=bbc-goodfood&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1jcC1iYmMtZ29vZGZvb2QiXX0%3D)\n[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=bbc-goodfood&config=%7B%22name%22%3A%22bbc-goodfood%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22mcp-bbc-goodfood%22%5D%7D)\n\n[BBC Good Food](https://www.bbcgoodfood.com) is a British cooking site, the\nonline home of the magazine of the same name. Its recipes are written and tested\nby its own cooks, and each one gives its ingredients, its method, its\npreparation and cooking times, its difficulty, the diets it suits, its nutrition\nper serving and the stars its readers gave it. The site narrows its recipes along\naxes of its own: a diet, a cuisine, a kind of meal, a difficulty. Part of the\ncollection sits behind a subscription.\n\nThis server connects a chat client to that site. You can read the values each\naxis takes, search the recipes along them, read one recipe with its ingredients\nrescaled to the number of people at your table, and switch its quantities between\nmetric and US units. It needs no API key and no account.\n\n_[Version française](#mcp-bbc-goodfood-français)_\n\n---\n\n## Install\n\n**One-click install**\n\n[![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=bbc-goodfood&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1jcC1iYmMtZ29vZGZvb2QiXX0%3D)\n[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=bbc-goodfood&config=%7B%22name%22%3A%22bbc-goodfood%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22mcp-bbc-goodfood%22%5D%7D)\n\n**Claude Code**\n\n```bash\nclaude mcp add bbc-goodfood -- npx -y mcp-bbc-goodfood\n```\n\n**Claude Desktop, Cursor, and any client using the standard config format**\n\n```json\n{\n  \"mcpServers\": {\n    \"bbc-goodfood\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-bbc-goodfood\"]\n    }\n  }\n}\n```\n\nNode 24 or later is required, and no environment variable has to be set.\n\n### With Docker\n\n```json\n{\n  \"mcpServers\": {\n    \"bbc-goodfood\": {\n      \"command\": \"docker\",\n      \"args\": [\"run\", \"-i\", \"--rm\", \"ghcr.io/smeet666/mcp-bbc-goodfood:1.0.1\"]\n    }\n  }\n}\n```\n\n`-i` keeps stdin open, which is where the protocol travels, and `-t` is left out\nbecause a TTY rewrites the stream. The container needs outbound HTTPS to\n`www.bbcgoodfood.com`, and nothing else: no volume, no port, no credential.\n\n### Bundle, without npm\n\nDownload `mcp-bbc-goodfood-1.0.1.mcpb` from\n[the latest release](https://github.com/smeet666/mcp-bbc-goodfood/releases/latest)\nand open it. A client that supports MCP bundles installs it on its own, with no\nnpm and no configuration file to edit. The bundle carries its dependencies, so\nnothing is fetched at install time.\n\n## What you can ask\n\n- \"Find me a vegetarian curry that takes under 40 minutes.\"\n- \"What diets can I filter on?\"\n- \"Read me that recipe for six, in US cups.\"\n- \"Which of these are rated four stars or better?\"\n- \"Scale this ingredient list from a magazine by 1.5.\"\n\nThe ordinary path runs `list_filters`, then `search_recipes`, then `get_recipe`\non the path a row carries.\n\n## Tools\n\n| Tool                | What it does                                               |\n| ------------------- | ---------------------------------------------------------- |\n| `list_filters`      | Reads the values each axis of the site takes.              |\n| `search_recipes`    | Finds recipes, narrowed along those axes.                  |\n| `get_recipe`        | Reads one recipe, rescaled or in other units on request.   |\n| `scale_ingredients` | Rescales any ingredient list, with no request to the site. |\n\n**Call `list_filters` before narrowing a search.** The site accepts any value on\nan axis and answers one it does not know with a total of zero, so a guessed\nspelling comes back as a confident absence instead of a refusal.\n\n### `list_filters`\n\nReads the axes the site narrows by, and the values each one takes.\n\n| Argument | Type                       | Required | What it does                                                            |\n| -------- | -------------------------- | -------- | ----------------------------------------------------------------------- |\n| `query`  | string, 1 to 80 characters | no       | Count the values within one search instead of across the whole listing. |\n\n**In return:** `filters`, one entry per axis carrying `name` and `label` in the\nsite's own wording, `argument`, which names the argument `search_recipes` takes\nfor it, and `options` with each `value`, its `label` and its `count`. A `count`\nthe site published nothing for is `null`. `option_count` says how many options are\nlisted here, which is fewer than the site accepts: the values returned are the\nmost frequent ones, and an option absent from the list is still usable. Counts\nare measured inside a scope, so passing `query` counts within one search and\nleaving it out counts across the listing; the two answer different questions.\n\n### `search_recipes`\n\nSearches the recipes, narrowed along the site's own axes and along restrictions\nthis server applies to the rows it read.\n\n| Argument            | Type                                                                | Required | What it does                                  |\n| ------------------- | ------------------------------------------------------------------- | -------- | --------------------------------------------- |\n| `query`             | string, 1 to 80 characters                                          | yes      | A dish, an ingredient, a technique.           |\n| `limit`             | integer, 1 to 30, default `30`                                      | no       | Rows to serve.                                |\n| `page`              | integer, 1 to 334, default `1`                                      | no       | Which page of rows.                           |\n| `sort`              | `relevant`, `rating`, `published` or `quickest`, default `relevant` | no       | How the site orders the rows.                 |\n| `diet`              | string, 1 to 60 characters                                          | no       | A value `list_filters` publishes.             |\n| `cuisine`           | string, 1 to 60 characters                                          | no       | A value `list_filters` publishes.             |\n| `meal_type`         | string, 1 to 60 characters                                          | no       | A value `list_filters` publishes.             |\n| `difficulty`        | string, 1 to 60 characters                                          | no       | A value `list_filters` publishes.             |\n| `max_total_minutes` | integer, 1 to 1440                                                  | no       | The whole recipe, in minutes.                 |\n| `max_calories`      | integer, 1 to 10000                                                 | no       | Calories per serving.                         |\n| `min_servings`      | integer, 1 to 50                                                    | no       | At least this many servings.                  |\n| `min_rating`        | number, 1 to 5                                                      | no       | At least this many stars.                     |\n| `exclude_premium`   | boolean                                                             | no       | Drop the rows behind the site's subscription. |\n\n**In return:** rows carrying `id`, which `get_recipe` takes; `title`; `url`;\n`image_url`; and `rating`, which is `null` where the site published none.\nAlongside come `result_count`, `rows_seen` for the rows the site served before\nanything was set aside, and `total_available`. A total marked `total_is_ceiling`\nsits on the largest number of rows one search will serve, so it states a floor\nrather than a count. `restrictions_lifted` names what was set aside when\nnarrowing made the search fail, and `premium_dropped` counts the subscription\nrows removed. The site offers no restriction on subscription rows, so\n`exclude_premium` removes them after the page arrives: a page then comes back\nshorter than the limit asked for, and a short page is not the end of the results.\n\n### `get_recipe`\n\nReads one recipe, rescaled to a number of servings and in the unit system asked\nfor.\n\n| Argument      | Type                        | Required | What it does                                               |\n| ------------- | --------------------------- | -------- | ---------------------------------------------------------- |\n| `id`          | string, 1 to 200 characters | yes      | The page's own path, as a `search_recipes` row carries it. |\n| `servings`    | integer, 1 to 100           | no       | Rescale the ingredients to this many servings.             |\n| `unit_system` | `metric` or `us`            | no       | The units the quantities are written in.                   |\n\n**In return:** `title`, `url`, `premium`, `yield_text` in the site's own wording\nsuch as `Serves 4 - 6`, `yield_count`, `prep_minutes`, `cook_minutes`,\n`total_minutes`, `difficulty`, `diets`, `author`, `rating`, `rating_count`,\n`description`, `ingredients`, `steps`, `nutrition` with `nutrition_per` naming\nthe serving it describes, and `unit_system`. A figure the page states nothing for\nis `null`. **A recipe behind the site's subscription comes back with `premium`\ntrue, no ingredients and no steps:** send the reader to its page rather than\nreconstructing them. Each ingredient carries `scaling`, reading `scaled`,\n`rounded` or `unscaled`.\n\n### `scale_ingredients`\n\nApplies the same arithmetic to any list of ingredient lines, with no request to\nthe site.\n\n| Argument        | Type                                           | Required   | What it does                                   |\n| --------------- | ---------------------------------------------- | ---------- | ---------------------------------------------- |\n| `ingredients`   | array of 1 to 100 strings, 1 to 300 characters | yes        | The lines to rescale, as a recipe writes them. |\n| `factor`        | number, 0.001 to 1000                          | one of two | What to multiply every quantity by.            |\n| `from_servings` | integer, 1 to 100                              | one of two | How many people the list feeds as written.     |\n| `to_servings`   | integer, 1 to 100                              | one of two | How many people it should feed.                |\n\nPass `factor`, or the `from_servings` and `to_servings` pair.\n\n**In return:** the rescaled lines in the shape `get_recipe` returns, each with its\n`original`, its `text`, its `amount`, `amount_max` and `unit`, and its `scaling`.\n\n## Rescaling the quantities\n\nA quantity is stated in the unit that suits it, so a line can come back in a\ndifferent unit from the one the recipe used: 200 g multiplied by twenty reads\n`4 kg`, and 2 g divided by ten reads `200 mg`.\n\nHow finely an ingredient can be divided depends on what it is. A loaf can be cut\nin two, in three or in four; an egg cannot be shared out. A quantity landing\nbetween the two is rounded, and the rescaled recipe then departs a little from\nthe proportions of the original. The line carries `rounded`, and its note says\nwhat was done.\n\nThe figures are this server's arithmetic, so say they were recomputed when you\nshow them. A recipe whose page states no number of servings cannot be put to a\nnumber of people, and the answer says so.\n\n## Configuration\n\nEvery variable is optional. Set them in the `env` block of your client config.\n\n| Variable                | Default              | What it does                                                                       |\n| ----------------------- | -------------------- | ---------------------------------------------------------------------------------- |\n| `BGF_USER_AGENT`        | the project identity | Names your application to the site, with an address where a person can be reached. |\n| `BGF_MIN_INTERVAL_MS`   | `1500`               | Gap between two requests, from 1000 to 60000.                                      |\n| `BGF_TIMEOUT_MS`        | `20000`              | Deadline for one request, from 1000 to 120000.                                     |\n| `BGF_MAX_RETRIES`       | `3`                  | Attempts after a transient failure, from 0 to 8.                                   |\n| `BGF_CACHE_TTL_MS`      | `900000`             | How long a page stays in memory, from 0 to 86400000.                               |\n| `BGF_CACHE_MAX_ENTRIES` | `200`                | Pages held in memory at once, from 1 to 5000.                                      |\n| `BGF_LOG_LEVEL`         | `error`              | `silent`, `error`, `info` or `debug`, written to stderr.                           |\n\nA value outside its range falls back to the default, and the reason is written to\nstderr.\n\n## Errors\n\nEvery failure carries one of six codes, a message, and where it helps a hint\nnaming the next move.\n\n| Code            | What happened                                           | What to do                                                                                                   |\n| --------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |\n| `not_found`     | The site answered, and holds no such recipe.            | Check the path with `search_recipes`.                                                                        |\n| `invalid_input` | The arguments were refused before any request went out. | Read the message, which names the argument.                                                                  |\n| `rate_limited`  | The site asked this client to slow down.                | Wait the number of seconds the hint names and call again with the same arguments. The recipe is still there. |\n| `parse_failure` | The page loaded and the expected content was absent.    | Report it at [the issue tracker](https://github.com/smeet666/mcp-bbc-goodfood/issues).                       |\n| `network_error` | The request did not complete.                           | Try again shortly.                                                                                           |\n| `timeout`       | The request passed its deadline.                        | Raise `BGF_TIMEOUT_MS`, or ask for fewer rows.                                                               |\n\n## As a library\n\nThe layer reading the site is published on its own, with its pacing, its cache\nand its errors, and with no protocol attached.\n\n```ts\nimport { BbcGoodFoodClient } from \"mcp-bbc-goodfood/client\";\n\nconst client = new BbcGoodFoodClient();\nconst { data, cached } = await client.searchRecipes({ query: \"lasagne\" });\nconsole.log(data.rows.length, cached);\n```\n\n`listFilters`, `searchRecipes` and `getRecipe` each answer `{ data, cached }`,\nand throw an error carrying one of the six codes. The floor between two requests\nholds here as well.\n\n## Pacing and attribution\n\nRequests go out one at a time with at least a second and a half between them, and\nthe floor of one second holds however the server is configured. The `User-Agent`\nalways ends with the project identity and an address where a person can be\nreached.\n\nEvery result carries the address of the page it was read from, and `source` names\nthe site. The recipes belong to BBC Good Food and to the cooks who wrote them.\n\nThis MCP server is an unofficial project, with no affiliation to BBC Good Food.\n\n## Privacy\n\nThis server collects nothing about you and sends nothing to its author. It runs\non your machine, contacts `www.bbcgoodfood.com` and nothing else, holds its answers in memory\nwhile it runs, and writes nothing to disk.\n[PRIVACY.md](PRIVACY.md) states what a request carries and which settings change\nany of it.\n\n## Development\n\n```bash\nnpm install\nnpm run build:fixtures\nnpm test\nnpm run check\n```\n\nTests run against generated fixtures and make no network request. The live suite,\n`npm run test:live`, makes one request per route and runs nightly against the\nsite itself.\n\n## Contributing\n\nBugs, questions and ideas belong in\n[the issue tracker](https://github.com/smeet666/mcp-bbc-goodfood/issues). Pull\nrequests are welcome; opening an issue first helps agree on the shape of the\nchange. See [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License\n\nMIT, see [LICENSE](LICENSE). The recipes belong to BBC Good Food and to their\nauthors.\n\n---\n\n<a name=\"mcp-bbc-goodfood-français\"></a>\n\n# mcp-bbc-goodfood (français)\n\n_[English version](#mcp-bbc-goodfood)_\n\n[BBC Good Food](https://www.bbcgoodfood.com) est un site de cuisine britannique,\nla maison en ligne du magazine du même nom. Ses recettes sont écrites et testées\npar ses propres cuisiniers, et chacune donne ses ingrédients, sa méthode, ses\ntemps de préparation et de cuisson, sa difficulté, les régimes auxquels elle\nconvient, ses valeurs nutritionnelles par portion et les étoiles que ses lecteurs\nlui ont données. Le site resserre ses recettes selon des axes qui lui sont\npropres : un régime, une cuisine, un type de repas, une difficulté. Une partie de\nla collection est réservée aux abonnés.\n\nCe serveur relie un client de conversation à ce site. On peut lire les valeurs\nque prend chaque axe, chercher des recettes le long de ces axes, lire une recette\navec ses ingrédients adaptés au nombre de convives, et basculer ses quantités\nentre unités métriques et américaines. Aucune clé d'API, aucun compte.\n\n## Installation\n\n**Installation en un clic**\n\n[![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=bbc-goodfood&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1jcC1iYmMtZ29vZGZvb2QiXX0%3D)\n[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=bbc-goodfood&config=%7B%22name%22%3A%22bbc-goodfood%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22mcp-bbc-goodfood%22%5D%7D)\n\n**Claude Code**\n\n```bash\nclaude mcp add bbc-goodfood -- npx -y mcp-bbc-goodfood\n```\n\n**Claude Desktop, Cursor, et tout client au format de configuration standard**\n\n```json\n{\n  \"mcpServers\": {\n    \"bbc-goodfood\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-bbc-goodfood\"]\n    }\n  }\n}\n```\n\nNode 24 ou plus récent est nécessaire, et aucune variable d'environnement n'est à\nrenseigner.\n\n### Avec Docker\n\n```json\n{\n  \"mcpServers\": {\n    \"bbc-goodfood\": {\n      \"command\": \"docker\",\n      \"args\": [\"run\", \"-i\", \"--rm\", \"ghcr.io/smeet666/mcp-bbc-goodfood:1.0.1\"]\n    }\n  }\n}\n```\n\n`-i` garde l'entrée standard ouverte, qui est le canal du protocole, et `-t` est\nomis parce qu'un TTY réécrit le flux. Le conteneur a besoin d'un accès HTTPS\nsortant vers `www.bbcgoodfood.com`, et de rien d'autre : aucun volume, aucun\nport, aucun identifiant.\n\n### Bundle, sans npm\n\nTéléchargez `mcp-bbc-goodfood-1.0.1.mcpb` depuis\n[la dernière publication](https://github.com/smeet666/mcp-bbc-goodfood/releases/latest)\net ouvrez-le. Un client qui gère les bundles MCP l'installe seul, sans npm et\nsans fichier de configuration à modifier. Le bundle emporte ses dépendances, donc\nrien n'est téléchargé à l'installation.\n\n## Ce qu'on peut demander\n\n- « Trouve-moi un curry végétarien qui prend moins de 40 minutes. »\n- « Sur quels régimes puis-je filtrer ? »\n- « Lis-moi cette recette pour six, en tasses américaines. »\n- « Lesquelles sont notées quatre étoiles ou plus ? »\n- « Multiplie par 1,5 cette liste d'ingrédients tirée d'un magazine. »\n\nLe chemin ordinaire va de `list_filters` à `search_recipes`, puis à `get_recipe`\nsur le chemin que porte une ligne.\n\n## Les outils\n\n| Outil               | Ce qu'il fait                                                      |\n| ------------------- | ------------------------------------------------------------------ |\n| `list_filters`      | Lit les valeurs que prend chaque axe du site.                      |\n| `search_recipes`    | Trouve des recettes, resserrées selon ces axes.                    |\n| `get_recipe`        | Lit une recette, adaptée ou dans d'autres unités sur demande.      |\n| `scale_ingredients` | Adapte n'importe quelle liste d'ingrédients, sans requête au site. |\n\n**Appelez `list_filters` avant de resserrer une recherche.** Le site accepte\nn'importe quelle valeur sur un axe et répond à celle qu'il ne connaît pas par un\ntotal de zéro, donc une orthographe devinée revient comme une absence assurée au\nlieu d'un refus.\n\n### `list_filters`\n\nLit les axes selon lesquels le site resserre, et les valeurs que chacun prend.\n\n| Argument | Type                      | Requis | Ce qu'il fait                                                        |\n| -------- | ------------------------- | ------ | -------------------------------------------------------------------- |\n| `query`  | chaîne, 1 à 80 caractères | non    | Compte les valeurs dans une recherche plutôt que sur toute la liste. |\n\n**En retour :** `filters`, une entrée par axe portant `name` et `label` dans les\ntermes du site, `argument`, qui nomme l'argument que `search_recipes` prend pour\nlui, et `options` avec chaque `value`, son `label` et son `count`. Un `count` que\nle site n'a pas publié vaut `null`. `option_count` dit combien d'options sont\nlistées ici, ce qui est moins que ce que le site accepte : les valeurs rendues\nsont les plus fréquentes, et une option absente de la liste reste utilisable. Les\ncomptes sont mesurés dans une portée, donc passer `query` compte dans une\nrecherche et l'omettre compte sur toute la liste ; les deux répondent à des\nquestions différentes.\n\n### `search_recipes`\n\nCherche des recettes, resserrées selon les axes du site et selon des\nrestrictions que ce serveur applique aux lignes qu'il a lues.\n\n| Argument            | Type                                                               | Requis | Ce qu'il fait                                 |\n| ------------------- | ------------------------------------------------------------------ | ------ | --------------------------------------------- |\n| `query`             | chaîne, 1 à 80 caractères                                          | oui    | Un plat, un ingrédient, une technique.        |\n| `limit`             | entier, 1 à 30, défaut `30`                                        | non    | Lignes à servir.                              |\n| `page`              | entier, 1 à 334, défaut `1`                                        | non    | Quelle page de lignes.                        |\n| `sort`              | `relevant`, `rating`, `published` ou `quickest`, défaut `relevant` | non    | L'ordre dans lequel le site range les lignes. |\n| `diet`              | chaîne, 1 à 60 caractères                                          | non    | Une valeur publiée par `list_filters`.        |\n| `cuisine`           | chaîne, 1 à 60 caractères                                          | non    | Une valeur publiée par `list_filters`.        |\n| `meal_type`         | chaîne, 1 à 60 caractères                                          | non    | Une valeur publiée par `list_filters`.        |\n| `difficulty`        | chaîne, 1 à 60 caractères                                          | non    | Une valeur publiée par `list_filters`.        |\n| `max_total_minutes` | entier, 1 à 1440                                                   | non    | La recette entière, en minutes.               |\n| `max_calories`      | entier, 1 à 10000                                                  | non    | Calories par portion.                         |\n| `min_servings`      | entier, 1 à 50                                                     | non    | Au moins ce nombre de portions.               |\n| `min_rating`        | nombre, 1 à 5                                                      | non    | Au moins ce nombre d'étoiles.                 |\n| `exclude_premium`   | booléen                                                            | non    | Retire les lignes réservées aux abonnés.      |\n\n**En retour :** des lignes portant `id`, que `get_recipe` reprend ; `title` ;\n`url` ; `image_url` ; et `rating`, `null` là où le site n'en a publié aucune.\nViennent aussi `result_count`, `rows_seen` pour les lignes servies par le site\navant tout écartement, et `total_available`. Un total marqué `total_is_ceiling`\nse pose sur le plus grand nombre de lignes qu'une recherche servira, donc il\nénonce un plancher plutôt qu'un compte. `restrictions_lifted` nomme ce qui a été\nécarté quand le resserrement faisait échouer la recherche, et `premium_dropped`\ncompte les lignes d'abonnés retirées. Le site n'offre aucune restriction sur les\nlignes d'abonnés, donc `exclude_premium` les retire une fois la page arrivée :\nune page revient alors plus courte que la limite demandée, et une page courte\nn'est pas la fin des résultats.\n\n### `get_recipe`\n\nLit une recette, adaptée à un nombre de parts et dans le système d'unités\ndemandé.\n\n| Argument      | Type                       | Requis | Ce qu'il fait                                          |\n| ------------- | -------------------------- | ------ | ------------------------------------------------------ |\n| `id`          | chaîne, 1 à 200 caractères | oui    | Le chemin de la page, tel qu'une ligne le porte.       |\n| `servings`    | entier, 1 à 100            | non    | Adapte les ingrédients à ce nombre de parts.           |\n| `unit_system` | `metric` ou `us`           | non    | Les unités dans lesquelles les quantités sont écrites. |\n\n**En retour :** `title`, `url`, `premium`, `yield_text` dans les termes du site\ncomme `Serves 4 - 6`, `yield_count`, `prep_minutes`, `cook_minutes`,\n`total_minutes`, `difficulty`, `diets`, `author`, `rating`, `rating_count`,\n`description`, `ingredients`, `steps`, `nutrition` avec `nutrition_per` qui nomme\nla portion décrite, et `unit_system`. Un chiffre que la page n'indique pas vaut\n`null`. **Une recette réservée aux abonnés revient avec `premium` à vrai, sans\ningrédients et sans étapes :** renvoyez le lecteur vers sa page au lieu de les\nreconstituer. Chaque ingrédient porte `scaling`, valant `scaled`, `rounded` ou\n`unscaled`.\n\n### `scale_ingredients`\n\nApplique la même arithmétique à n'importe quelle liste d'ingrédients, sans\nrequête au site.\n\n| Argument        | Type                                           | Requis        | Ce qu'il fait                                      |\n| --------------- | ---------------------------------------------- | ------------- | -------------------------------------------------- |\n| `ingredients`   | tableau de 1 à 100 chaînes, 1 à 300 caractères | oui           | Les lignes à adapter, comme une recette les écrit. |\n| `factor`        | nombre, 0.001 à 1000                           | l'un des deux | Ce par quoi multiplier chaque quantité.            |\n| `from_servings` | entier, 1 à 100                                | l'un des deux | Le nombre de convives de la liste d'origine.       |\n| `to_servings`   | entier, 1 à 100                                | l'un des deux | Le nombre de convives voulu.                       |\n\nPassez `factor`, ou le couple `from_servings` et `to_servings`.\n\n**En retour :** les lignes adaptées dans la forme que rend `get_recipe`, chacune\navec son `original`, son `text`, son `amount`, `amount_max` et `unit`, et son\n`scaling`.\n\n## L'adaptation des quantités\n\nUne quantité est exprimée dans l'unité qui lui convient. Après adaptation, une\nligne peut donc apparaître dans une autre unité que celle de la recette : 200 g\nmultipliés par vingt donnent `4 kg`, et 2 g divisés par dix donnent `200 mg`.\n\nLa finesse à laquelle un ingrédient se coupe dépend de sa nature. Un pain se\ncoupe en deux, en trois ou en quatre ; un oeuf ne se partage pas. Une quantité\nqui tombe entre les deux est donc arrondie, et la recette adaptée s'écarte alors\nun peu des proportions de l'originale. La ligne porte `rounded`, et sa note dit\nce qui a été fait.\n\nLes chiffres sont l'arithmétique de ce serveur, donc dites qu'ils ont été\nrecalculés quand vous les montrez. Une recette dont la page n'indique aucun\nnombre de parts ne peut pas être portée à un nombre de convives, et la réponse le\ndit.\n\n## Configuration\n\nChaque variable est facultative. Elles se posent dans le bloc `env` de la\nconfiguration du client.\n\n| Variable                | Défaut               | Ce qu'elle fait                                                                   |\n| ----------------------- | -------------------- | --------------------------------------------------------------------------------- |\n| `BGF_USER_AGENT`        | l'identité du projet | Nomme votre application auprès du site, avec une adresse où joindre une personne. |\n| `BGF_MIN_INTERVAL_MS`   | `1500`               | Écart entre deux requêtes, de 1000 à 60000.                                       |\n| `BGF_TIMEOUT_MS`        | `20000`              | Délai d'une requête, de 1000 à 120000.                                            |\n| `BGF_MAX_RETRIES`       | `3`                  | Tentatives après un échec passager, de 0 à 8.                                     |\n| `BGF_CACHE_TTL_MS`      | `900000`             | Durée pendant laquelle une page reste en mémoire, de 0 à 86400000.                |\n| `BGF_CACHE_MAX_ENTRIES` | `200`                | Pages gardées en mémoire à la fois, de 1 à 5000.                                  |\n| `BGF_LOG_LEVEL`         | `error`              | `silent`, `error`, `info` ou `debug`, écrit sur la sortie d'erreur.               |\n\nUne valeur hors de sa plage retombe sur le défaut, et la raison est écrite sur la\nsortie d'erreur.\n\n## Erreurs\n\nChaque échec porte un des six codes, un message, et quand cela aide une\nindication du geste suivant.\n\n| Code            | Ce qui s'est passé                                 | Que faire                                                                                         |\n| --------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------- |\n| `not_found`     | Le site a répondu, et n'a pas cette recette.       | Vérifiez le chemin avec `search_recipes`.                                                         |\n| `invalid_input` | Les arguments ont été refusés avant toute requête. | Lisez le message, qui nomme l'argument.                                                           |\n| `rate_limited`  | Le site demande à ce client de ralentir.           | Attendez les secondes indiquées et rappelez avec les mêmes arguments. La recette est toujours là. |\n| `parse_failure` | La page a chargé et le contenu attendu est absent. | Signalez-le sur [le suivi d'incidents](https://github.com/smeet666/mcp-bbc-goodfood/issues).      |\n| `network_error` | La requête n'a pas abouti.                         | Réessayez sous peu.                                                                               |\n| `timeout`       | La requête a dépassé son délai.                    | Augmentez `BGF_TIMEOUT_MS`, ou demandez moins de lignes.                                          |\n\n## Comme bibliothèque\n\nLa couche qui lit le site est publiée seule, avec son rythme, son cache et ses\nerreurs, sans protocole attaché.\n\n```ts\nimport { BbcGoodFoodClient } from \"mcp-bbc-goodfood/client\";\n\nconst client = new BbcGoodFoodClient();\nconst { data, cached } = await client.searchRecipes({ query: \"lasagne\" });\nconsole.log(data.rows.length, cached);\n```\n\n`listFilters`, `searchRecipes` et `getRecipe` répondent chacun `{ data, cached }`,\net lèvent une erreur portant un des six codes. Le plancher entre deux requêtes\ntient également ici.\n\n## Rythme et attribution\n\nLes requêtes partent une à une avec au moins une seconde et demie entre elles, et\nle plancher d'une seconde tient quelle que soit la configuration. Le `User-Agent`\nse termine toujours par l'identité du projet et une adresse où joindre une\npersonne.\n\nChaque résultat porte l'adresse de la page d'où il a été lu, et `source` nomme le\nsite. Les recettes appartiennent à BBC Good Food et aux cuisiniers qui les ont\nécrites.\n\nCe MCP est un projet non officiel, sans affiliation à BBC Good Food.\n\n## Confidentialité\n\nCe serveur ne collecte rien sur vous et n'envoie rien à son auteur. Il tourne sur\nvotre machine, ne joint que `www.bbcgoodfood.com`, garde ses réponses en mémoire le temps qu'il\ntourne, et n'écrit rien sur le disque. [PRIVACY.md](PRIVACY.md) dit ce qu'une\nrequête emporte et quels réglages changent cela.\n\n## Développement\n\n```bash\nnpm install\nnpm run build:fixtures\nnpm test\nnpm run check\n```\n\nLes tests s'exécutent sur des fixtures engendrées et n'émettent aucune requête.\nLa suite en direct, `npm run test:live`, émet une requête par route et tourne\nchaque nuit contre le site lui-même.\n\n## Contribuer\n\nLes anomalies, les questions et les idées ont leur place dans\n[le suivi d'incidents](https://github.com/smeet666/mcp-bbc-goodfood/issues). Les\npropositions de modification sont bienvenues ; ouvrir un ticket d'abord aide à\ns'accorder sur la forme du changement. Voir [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Licence\n\nMIT, voir [LICENSE](LICENSE). Les recettes appartiennent à BBC Good Food et à\nleurs auteurs.\n",
  "bytes": 34490,
  "sha": "95bd6803d02c5cf2d58a31674c982ef7c66816f16b1a04ac92de427836f660c5",
  "repo_slug": "smeet666/mcp-bbc-goodfood",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_smeet666_mcp_bbc_goodfood_91a25985/readme"
}