{
  "markdown": "<img src=\"assets/icon-128.png\" alt=\"\" width=\"96\" align=\"right\">\n\n# mcp-ptitchef\n\n[![npm](https://img.shields.io/npm/v/mcp-ptitchef.svg)](https://www.npmjs.com/package/mcp-ptitchef)\n[![CI](https://github.com/smeet666/mcp-ptitchef/actions/workflows/ci.yml/badge.svg)](https://github.com/smeet666/mcp-ptitchef/actions/workflows/ci.yml)\n[![license](https://img.shields.io/npm/l/mcp-ptitchef.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-ptitchef)\n[![Glama](https://glama.ai/mcp/servers/smeet666/mcp-ptitchef/badges/score.svg)](https://glama.ai/mcp/servers/smeet666/mcp-ptitchef)\n[![M8ven](https://m8ven.ai/badge/mcp/smeet666-mcp-ptitchef-gqkqc1?variant=verified)](https://m8ven.ai/mcp/smeet666-mcp-ptitchef-gqkqc1)\n[![LobeHub](https://lobehub.com/badge/mcp/smeet666-mcp-ptitchef)](https://lobehub.com/mcp/smeet666-mcp-ptitchef)\n[![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=ptitchef&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1jcC1wdGl0Y2hlZiJdfQ%3D%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=ptitchef&config=%7B%22name%22%3A%22ptitchef%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22mcp-ptitchef%22%5D%7D)\n\n[Ptitchef](https://www.ptitchef.com) is a French cooking site where home cooks\npublish their recipes. Each one gives its ingredients, its steps, often\nphotographed one by one, its preparation and cooking times, its cost, its\nnutrition figures and the ratings its readers left. The site files its recipes\nunder a tree of ingredient families, and publishes many of them in several\nlanguages.\n\nThis server connects a chat client to that site. You can walk the tree of\ncategories, search the recipes by dish or by ingredient, browse a category or one\nof the site's standing lists, ask what can be made from what is in the fridge,\nread one recipe with its ingredients rescaled to the number of people at your\ntable, and find the other languages a recipe was published in. It needs no API\nkey and no account.\n\n_[Version française](#mcp-ptitchef-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=ptitchef&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1jcC1wdGl0Y2hlZiJdfQ%3D%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=ptitchef&config=%7B%22name%22%3A%22ptitchef%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22mcp-ptitchef%22%5D%7D)\n\n**Claude Code**\n\n```bash\nclaude mcp add ptitchef -- npx -y mcp-ptitchef\n```\n\n**Claude Desktop, Cursor, and any client using the standard config format**\n\n```json\n{\n  \"mcpServers\": {\n    \"ptitchef\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-ptitchef\"]\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    \"ptitchef\": {\n      \"command\": \"docker\",\n      \"args\": [\"run\", \"-i\", \"--rm\", \"ghcr.io/smeet666/mcp-ptitchef: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.ptitchef.com`, and nothing else: no volume, no port, no credential.\n\n### Bundle, without npm\n\nDownload `mcp-ptitchef-1.0.1.mcpb` from\n[the latest release](https://github.com/smeet666/mcp-ptitchef/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- « Qu'est-ce que Ptitchef a comme recettes de chou kale ? »\n- \"What can I cook with courgettes, feta and mint?\"\n- \"Read me that gratin for eight people.\"\n- \"Show me the highest rated recipes on the site.\"\n- \"Is that recipe published in Spanish too?\"\n\nPtitchef is a French site, so its recipes are found in French. The ordinary path\nruns from a listing to a recipe: a row carries an `id`, and `get_recipe` takes\nthat id.\n\n## Tools\n\n| Tool                      | What it does                                                   |\n| ------------------------- | -------------------------------------------------------------- |\n| `list_categories`         | Walks the tree of ingredient families the site files under.    |\n| `search_recipes`          | Finds recipes by dish or by ingredient.                        |\n| `browse_recipes`          | Reads a category page by page, or a standing list.             |\n| `search_by_ingredients`   | Answers what can be made from what a cook already has.         |\n| `get_recipe`              | Reads one recipe, rescaled to a number of servings on request. |\n| `scale_ingredients`       | Rescales any ingredient list, with no request to the site.     |\n| `get_recipe_translations` | Lists the other languages a recipe was published in.           |\n\n**Start at `list_categories`.** The site gives you the right addresses, which\nsaves building one by hand: an address built that way lands on the site's front\npage.\n\n### `list_categories`\n\nReads the tree the site files its recipes under. Called with no argument it\nreturns the families; pass a family's slug back as `family` to read what it\nholds.\n\n| Argument | Type                            | Required | What it does                                      |\n| -------- | ------------------------------- | -------- | ------------------------------------------------- |\n| `family` | string, 1 to 80 characters      | no       | A family's slug, to read the categories under it. |\n| `limit`  | integer, 1 to 200, default `20` | no       | Rows to serve.                                    |\n\n**In return:** rows carrying `slug`, which comes back as `family` or as\n`category`; `title` in the site's own wording; `url`; `description`, which is\n`null` where the page carries none; and `sample_children` for the categories one\nlevel below.\n\n### `search_recipes`\n\nSearches the recipes for a dish or an ingredient.\n\n| Argument | Type                            | Required | What it does                        |\n| -------- | ------------------------------- | -------- | ----------------------------------- |\n| `query`  | string, 1 to 120 characters     | yes      | A dish or an ingredient, in French. |\n| `limit`  | integer, 1 to 100, default `20` | no       | Rows to serve.                      |\n\n**In return:** `results`, rows carrying `id`, `title`, `url`, `image_url`,\n`rating`, `rating_count` and `review_count`, a counter the page prints nothing\nfor being `null`. The envelope says how the site answered: `kind` reads\n`category` when the answer came from a category page of its own, whose\n`total_available` counts that whole category, and `free_text` when the site\nanswered on its own terms on a single page, where the total counts the rows\nserved. Those two totals count different things. `kind` also reads `guide` for a\ntopic the site wrote by hand, where rows carry a name and an address and no total\nexists. Alongside come `result_count`, `rows_seen`, `page`, `single_page` and\n`url`. A listing marked `single_page` whose total exceeds `rows_seen` has a\nremainder the site counts and does not serve.\n\n### `browse_recipes`\n\nReads a category page by page, or one of the site's standing lists.\n\n| Argument   | Type                                   | Required | What it does                                                  |\n| ---------- | -------------------------------------- | -------- | ------------------------------------------------------------- |\n| `category` | string, 1 to 120 characters            | no       | A category slug, as `list_categories` published it.           |\n| `listing`  | `latest`, `top_rated` or `most_viewed` | no       | A standing list, read instead of a category.                  |\n| `page`     | integer, 1 to 1000                     | no       | The page of a category to read. A standing list has one page. |\n| `limit`    | integer, 1 to 100, default `20`        | no       | Rows to serve.                                                |\n\n**In return:** the envelope `search_recipes` returns, with `kind` reading\n`category`, `standing` or `topic`. `page` is the page the site served, which is\nthe first one again when the page asked for is past the last.\n\n### `search_by_ingredients`\n\nAnswers what can be made from the ingredients a cook already has.\n\n| Argument      | Type                                        | Required | What it does                        |\n| ------------- | ------------------------------------------- | -------- | ----------------------------------- |\n| `ingredients` | array of 1 to 5 strings, 1 to 60 characters | yes      | The ingredients on hand, in French. |\n| `limit`       | integer, 1 to 100, default `20`             | no       | Rows to serve.                      |\n\n**In return:** the envelope the other listings return, with `kind` reading\n`fridge`. The site matches on its own vocabulary, so an ingredient it writes\ndifferently narrows the answer rather than widening it.\n\n### `get_recipe`\n\nReads one recipe in full, and rescales its ingredients when a number of servings\nis given.\n\n| Argument   | Type                        | Required | What it does                                   |\n| ---------- | --------------------------- | -------- | ---------------------------------------------- |\n| `id`       | string, 1 to 300 characters | yes      | The `id` of a row from a search or a listing.  |\n| `servings` | integer, 1 to 500           | no       | Rescale the ingredients to this many servings. |\n\n**In return:** `title`, `url`, `description`, `image_url`, `category`, `cuisine`,\n`difficulty` in the site's own wording, `author`, `published`, `modified`,\n`rating`, `rating_count`, `review_count`, `prep_minutes`, `cook_minutes`,\n`total_minutes`, `nutrition` as published for the serving size it names,\n`estimated_cost`, `keywords`, `faq` and `translations`, each `null` where the\npage states nothing. `steps` carries the method one line per step, and\n`illustrated_steps` the same steps with the photograph the site took of each.\n`yield` says what the recipe was written for and what it was rescaled to. Every\ningredient carries `scaling`, which reads `scaled`, `rounded` or `unscaled`: read\nit before quoting a quantity, since `rounded` was moved to stay usable in a\nkitchen.\n\n### `scale_ingredients`\n\nApplies the same arithmetic to any list of French ingredient lines, with no\nrequest to the site.\n\n| Argument        | Type                                       | Required   | What it does                               |\n| --------------- | ------------------------------------------ | ---------- | ------------------------------------------ |\n| `ingredients`   | array of 1 to 100 strings, up to 300 chars | yes        | The lines to rescale, in French.           |\n| `factor`        | number, above 0 and up to 100              | one of two | The multiplier to apply.                   |\n| `from_servings` | number, above 0 and up to 500              | one of two | How many servings the list is written for. |\n| `to_servings`   | number, above 0 and up to 500              | one of two | How many servings are wanted.              |\n\nPass `factor`, or the `from_servings` and `to_servings` pair.\n\n**In return:** the `factor` used, the rescaled `ingredients` in the shape\n`get_recipe` returns, and `scaled_count`, `rounded_count` and `unscaled_count`.\n\n### `get_recipe_translations`\n\nLists the other languages one recipe was published in, using the pairing the site\npublishes itself.\n\n| Argument | Type                        | Required | What it does                                  |\n| -------- | --------------------------- | -------- | --------------------------------------------- |\n| `id`     | string, 1 to 300 characters | yes      | The `id` of a row from a search or a listing. |\n\n**In return:** `translations`, each carrying the `language` tag the site\npublishes and the `url` of that version, with `translation_count` and the `url`\nof the French page they were read from.\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`.\n\nHow finely an ingredient can be divided depends on what it is. A baguette can be\ncut in 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| `PTC_USER_AGENT`        | the project identity | Names your application to the site, with an address where a person can be reached.        |\n| `PTC_MIN_INTERVAL_MS`   | `1500`               | Gap between two requests, from 1000 to 60000.                                             |\n| `PTC_TIMEOUT_MS`        | `20000`              | Deadline for one request, from 1000 to 120000.                                            |\n| `PTC_MAX_RETRIES`       | `3`                  | Attempts after a transient failure, from 0 to 8.                                          |\n| `PTC_CACHE_TTL_MS`      | `900000`             | How long a page stays in memory, from 0 to 86400000.                                      |\n| `PTC_CACHE_MAX_ENTRIES` | `200`                | Pages held in memory at once, from 1 to 5000.                                             |\n| `PTC_MAX_BODY_BYTES`    | `8000000`            | The largest response read whole, from 100000 to 64000000.                                 |\n| `PTC_BUDGET_MS`         | `60000`              | The time one read owes an answer inside, retries and waits included, from 5000 to 600000. |\n| `PTC_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 or page.    | Check the slug with `list_categories`, or the id with a search.                                              |\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-ptitchef/issues).                           |\n| `network_error` | The request did not complete.                           | Try again shortly.                                                                                           |\n| `timeout`       | The request passed its deadline or its budget.          | Raise `PTC_TIMEOUT_MS` or `PTC_BUDGET_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 { PtitchefClient } from \"mcp-ptitchef/client\";\n\nconst client = new PtitchefClient();\nconst { data, cached } = await client.listCategories();\nconsole.log(data.results.length, cached);\n```\n\n`listCategories`, `searchRecipes`, `browseRecipes`, `searchByIngredients` and\n`getRecipe` each answer `{ data, cached }`, and throw an error carrying one of\nthe six codes. The floor between two requests holds 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. Recipes, titles and categories belong to Ptitchef and to the cooks who\nwrote them.\n\nThis MCP server is an unofficial project, with no affiliation to Ptitchef.\n\n## Privacy\n\nThis server collects nothing about you and sends nothing to its author. It runs\non your machine, contacts `www.ptitchef.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-ptitchef/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 Ptitchef and to their authors.\n\n---\n\n<a name=\"mcp-ptitchef-français\"></a>\n\n# mcp-ptitchef (français)\n\n_[English version](#mcp-ptitchef)_\n\n[Ptitchef](https://www.ptitchef.com) est un site de cuisine français où des\ncuisiniers publient leurs recettes. Chacune donne ses ingrédients, ses étapes,\nsouvent photographiées une à une, ses temps de préparation et de cuisson, son\ncoût, ses valeurs nutritionnelles et les notes laissées par ses lecteurs. Le site\nclasse ses recettes dans un arbre de familles d'ingrédients, et en publie\nbeaucoup en plusieurs langues.\n\nCe serveur relie un client de conversation à ce site. On peut parcourir l'arbre\ndes catégories, chercher des recettes par plat ou par ingrédient, lire une\ncatégorie ou l'une des listes permanentes du site, demander ce qu'on peut faire\navec ce qu'il y a dans le frigo, lire une recette avec ses ingrédients adaptés au\nnombre de convives, et trouver les autres langues dans lesquelles une recette a\nété publiée. 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=ptitchef&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1jcC1wdGl0Y2hlZiJdfQ%3D%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=ptitchef&config=%7B%22name%22%3A%22ptitchef%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22mcp-ptitchef%22%5D%7D)\n\n**Claude Code**\n\n```bash\nclaude mcp add ptitchef -- npx -y mcp-ptitchef\n```\n\n**Claude Desktop, Cursor, et tout client au format de configuration standard**\n\n```json\n{\n  \"mcpServers\": {\n    \"ptitchef\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-ptitchef\"]\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    \"ptitchef\": {\n      \"command\": \"docker\",\n      \"args\": [\"run\", \"-i\", \"--rm\", \"ghcr.io/smeet666/mcp-ptitchef: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.ptitchef.com`, et de rien d'autre : aucun volume, aucun port,\naucun identifiant.\n\n### Bundle, sans npm\n\nTéléchargez `mcp-ptitchef-1.0.1.mcpb` depuis\n[la dernière publication](https://github.com/smeet666/mcp-ptitchef/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- « Qu'est-ce que Ptitchef a comme recettes de chou kale ? »\n- « Qu'est-ce que je peux cuisiner avec des courgettes, de la feta et de la menthe ? »\n- « Lis-moi ce gratin pour huit personnes. »\n- « Montre-moi les recettes les mieux notées du site. »\n- « Cette recette existe-t-elle aussi en espagnol ? »\n\nPtitchef est un site français, donc ses recettes se trouvent en français. Le\nchemin ordinaire va d'une liste à une recette : une ligne porte un `id`, et\n`get_recipe` reprend cet identifiant.\n\n## Les outils\n\n| Outil                     | Ce qu'il fait                                                      |\n| ------------------------- | ------------------------------------------------------------------ |\n| `list_categories`         | Parcourt l'arbre des familles d'ingrédients du site.               |\n| `search_recipes`          | Trouve des recettes par plat ou par ingrédient.                    |\n| `browse_recipes`          | Lit une catégorie page par page, ou une liste permanente.          |\n| `search_by_ingredients`   | Répond avec ce qu'on peut faire de ce qu'un cuisinier a déjà.      |\n| `get_recipe`              | Lit une recette, adaptée à un nombre de parts sur demande.         |\n| `scale_ingredients`       | Adapte n'importe quelle liste d'ingrédients, sans requête au site. |\n| `get_recipe_translations` | Liste les autres langues où une recette a été publiée.             |\n\n**Commencez par `list_categories`.** Le site vous donne les adresses correctes,\nce qui évite d'en construire une à la main : une adresse construite ainsi mène à\nla page d'accueil du site.\n\n### `list_categories`\n\nLit l'arbre sous lequel le site classe ses recettes. Appelé sans argument, il\nrend les familles ; redonnez le slug d'une famille en `family` pour lire ce\nqu'elle contient.\n\n| Argument | Type                         | Requis | Ce qu'il fait                                            |\n| -------- | ---------------------------- | ------ | -------------------------------------------------------- |\n| `family` | chaîne, 1 à 80 caractères    | non    | Le slug d'une famille, pour lire les catégories dessous. |\n| `limit`  | entier, 1 à 200, défaut `20` | non    | Lignes à servir.                                         |\n\n**En retour :** des lignes portant `slug`, qui se redonne en `family` ou en\n`category` ; `title` dans les termes du site ; `url` ; `description`, `null` là\noù la page n'en porte pas ; et `sample_children` pour les catégories du niveau\ninférieur.\n\n### `search_recipes`\n\nCherche des recettes par plat ou par ingrédient.\n\n| Argument | Type                         | Requis | Ce qu'il fait                          |\n| -------- | ---------------------------- | ------ | -------------------------------------- |\n| `query`  | chaîne, 1 à 120 caractères   | oui    | Un plat ou un ingrédient, en français. |\n| `limit`  | entier, 1 à 100, défaut `20` | non    | Lignes à servir.                       |\n\n**En retour :** `results`, des lignes portant `id`, `title`, `url`, `image_url`,\n`rating`, `rating_count` et `review_count`, un compteur que la page n'imprime pas\nvalant `null`. L'enveloppe dit comment le site a répondu : `kind` vaut `category`\nquand la réponse vient d'une page de catégorie, dont le `total_available` compte\ntoute la catégorie, et `free_text` quand le site a répondu à sa façon sur une\nseule page, où le total compte les lignes servies. Ces deux totaux comptent des\nchoses différentes. `kind` vaut aussi `guide` pour un dossier que le site a\nécrit à la main, où les lignes portent un nom et une adresse sans qu'aucun total\nexiste. Viennent aussi `result_count`, `rows_seen`, `page`, `single_page` et\n`url`. Une liste marquée `single_page` dont le total dépasse `rows_seen` a un\nreste que le site compte et ne sert pas.\n\n### `browse_recipes`\n\nLit une catégorie page par page, ou l'une des listes permanentes du site.\n\n| Argument   | Type                                   | Requis | Ce qu'il fait                                                    |\n| ---------- | -------------------------------------- | ------ | ---------------------------------------------------------------- |\n| `category` | chaîne, 1 à 120 caractères             | non    | Un slug de catégorie, publié par `list_categories`.              |\n| `listing`  | `latest`, `top_rated` ou `most_viewed` | non    | Une liste permanente, lue à la place d'une catégorie.            |\n| `page`     | entier, 1 à 1000                       | non    | La page de catégorie à lire. Une liste permanente n'en a qu'une. |\n| `limit`    | entier, 1 à 100, défaut `20`           | non    | Lignes à servir.                                                 |\n\n**En retour :** l'enveloppe que rend `search_recipes`, avec `kind` valant\n`category`, `standing` ou `topic`. `page` est la page que le site a servie, qui\nest la première de nouveau quand la page demandée dépasse la dernière.\n\n### `search_by_ingredients`\n\nRépond avec ce qu'on peut faire des ingrédients qu'un cuisinier a déjà.\n\n| Argument      | Type                                        | Requis | Ce qu'il fait                              |\n| ------------- | ------------------------------------------- | ------ | ------------------------------------------ |\n| `ingredients` | tableau de 1 à 5 chaînes, 1 à 60 caractères | oui    | Les ingrédients sous la main, en français. |\n| `limit`       | entier, 1 à 100, défaut `20`                | non    | Lignes à servir.                           |\n\n**En retour :** l'enveloppe des autres listes, avec `kind` valant `fridge`. Le\nsite fait correspondre son propre vocabulaire, donc un ingrédient qu'il écrit\nautrement resserre la réponse au lieu de l'élargir.\n\n### `get_recipe`\n\nLit une recette en entier, et adapte ses ingrédients quand un nombre de parts est\ndonné.\n\n| Argument   | Type                       | Requis | Ce qu'il fait                                |\n| ---------- | -------------------------- | ------ | -------------------------------------------- |\n| `id`       | chaîne, 1 à 300 caractères | oui    | L'`id` d'une ligne de recherche ou de liste. |\n| `servings` | entier, 1 à 500            | non    | Adapte les ingrédients à ce nombre de parts. |\n\n**En retour :** `title`, `url`, `description`, `image_url`, `category`,\n`cuisine`, `difficulty` dans les termes du site, `author`, `published`,\n`modified`, `rating`, `rating_count`, `review_count`, `prep_minutes`,\n`cook_minutes`, `total_minutes`, `nutrition` telle que publiée pour la portion\nqu'elle nomme, `estimated_cost`, `keywords`, `faq` et `translations`, chacun\n`null` là où la page n'indique rien. `steps` porte la méthode une ligne par\nétape, et `illustrated_steps` les mêmes étapes avec la photographie que le site a\nprise de chacune. `yield` dit pour quoi la recette est écrite et vers quoi elle a\nété adaptée. Chaque ingrédient porte `scaling`, qui vaut `scaled`, `rounded` ou\n`unscaled` : lisez-le avant de citer une quantité, `rounded` ayant été déplacée\npour rester utilisable en cuisine.\n\n### `scale_ingredients`\n\nApplique la même arithmétique à n'importe quelle liste d'ingrédients en français,\nsans requête au site.\n\n| Argument        | Type                                               | Requis        | Ce qu'il fait                             |\n| --------------- | -------------------------------------------------- | ------------- | ----------------------------------------- |\n| `ingredients`   | tableau de 1 à 100 chaînes, jusqu'à 300 caractères | oui           | Les lignes à adapter, en français.        |\n| `factor`        | nombre, au-delà de 0 jusqu'à 100                   | l'un des deux | Le multiplicateur à appliquer.            |\n| `from_servings` | nombre, au-delà de 0 jusqu'à 500                   | l'un des deux | Le nombre de parts de la liste d'origine. |\n| `to_servings`   | nombre, au-delà de 0 jusqu'à 500                   | l'un des deux | Le nombre de parts voulu.                 |\n\nPassez `factor`, ou le couple `from_servings` et `to_servings`.\n\n**En retour :** le `factor` employé, les `ingredients` adaptés dans la forme que\nrend `get_recipe`, et `scaled_count`, `rounded_count` et `unscaled_count`.\n\n### `get_recipe_translations`\n\nListe les autres langues dans lesquelles une recette a été publiée, d'après\nl'appariement que le site publie lui-même.\n\n| Argument | Type                       | Requis | Ce qu'il fait                                |\n| -------- | -------------------------- | ------ | -------------------------------------------- |\n| `id`     | chaîne, 1 à 300 caractères | oui    | L'`id` d'une ligne de recherche ou de liste. |\n\n**En retour :** `translations`, chacune portant l'étiquette `language` que le\nsite publie et l'`url` de cette version, avec `translation_count` et l'`url` de\nla page française d'où elles ont été lues.\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`.\n\nLa finesse à laquelle un ingrédient se coupe dépend de sa nature. Une baguette 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| `PTC_USER_AGENT`        | l'identité du projet | Nomme votre application auprès du site, avec une adresse où joindre une personne.                           |\n| `PTC_MIN_INTERVAL_MS`   | `1500`               | Écart entre deux requêtes, de 1000 à 60000.                                                                 |\n| `PTC_TIMEOUT_MS`        | `20000`              | Délai d'une requête, de 1000 à 120000.                                                                      |\n| `PTC_MAX_RETRIES`       | `3`                  | Tentatives après un échec passager, de 0 à 8.                                                               |\n| `PTC_CACHE_TTL_MS`      | `900000`             | Durée pendant laquelle une page reste en mémoire, de 0 à 86400000.                                          |\n| `PTC_CACHE_MAX_ENTRIES` | `200`                | Pages gardées en mémoire à la fois, de 1 à 5000.                                                            |\n| `PTC_MAX_BODY_BYTES`    | `8000000`            | La plus grosse réponse lue en entier, de 100000 à 64000000.                                                 |\n| `PTC_BUDGET_MS`         | `60000`              | Le temps dans lequel une lecture doit rendre une réponse, reprises et attentes comprises, de 5000 à 600000. |\n| `PTC_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 ni cette recette ni cette page. | Vérifiez le slug avec `list_categories`, ou l'identifiant avec une recherche.                     |\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-ptitchef/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 ou son budget.             | Augmentez `PTC_TIMEOUT_MS` ou `PTC_BUDGET_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 { PtitchefClient } from \"mcp-ptitchef/client\";\n\nconst client = new PtitchefClient();\nconst { data, cached } = await client.listCategories();\nconsole.log(data.results.length, cached);\n```\n\n`listCategories`, `searchRecipes`, `browseRecipes`, `searchByIngredients` et\n`getRecipe` répondent chacun `{ data, cached }`, et lèvent une erreur portant un\ndes six codes. Le plancher entre deux requêtes tient é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, les titres et les catégories appartiennent à Ptitchef et aux\ncuisiniers qui les ont écrites.\n\nCe MCP est un projet non officiel, sans affiliation à Ptitchef.\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.ptitchef.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-ptitchef/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 à Ptitchef et à leurs\nauteurs.\n",
  "bytes": 36581,
  "sha": "24922fbe9aac64666629b2cc72c6343006eb6c9207dfe079088b9fcee3d93915",
  "repo_slug": "smeet666/mcp-ptitchef",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_smeet666_mcp_ptitchef_3ede96b5/readme"
}