[{"data":1,"prerenderedAt":1385},["ShallowReactive",2],{"infra-\u002Finfra\u002Fservices":3,"infra-children-\u002Finfra\u002Fservices":25},{"id":4,"title":5,"body":6,"contentId":13,"description":14,"ecosystem":15,"extension":16,"meta":17,"navigation":18,"part":15,"path":19,"rawbody":20,"repository":15,"robots":15,"schemaOrg":15,"seo":21,"sitemap":22,"stem":23,"url":15,"__hash__":24},"pages\u002Finfra\u002Fservices\u002Findex.md","Services",{"type":7,"value":8,"toc":9},"minimark",[],{"title":10,"searchDepth":11,"depth":11,"links":12},"",2,[],"7e967564-582f-499c-8ec3-fca15efd1af4","The services that support my websites and infrastructure.",null,"md",{},true,"\u002Finfra\u002Fservices","---\ncontentId: 7e967564-582f-499c-8ec3-fca15efd1af4\ntitle: Services\ndescription: The services that support my websites and infrastructure.\n---\n",{"title":5,"description":14},{"loc":19},"infra\u002Fservices\u002Findex","-mE8RPD0qZpXUsIRQsj_q3UBecUFOqFozuKIQIr5mgc",[26,197,798,1201],{"id":27,"title":28,"body":29,"contentId":137,"description":138,"ecosystem":139,"extension":16,"meta":190,"navigation":18,"part":15,"path":191,"rawbody":192,"repository":149,"robots":15,"schemaOrg":15,"seo":193,"sitemap":194,"stem":195,"url":37,"__hash__":196},"pages\u002Finfra\u002Fservices\u002Fapi-soubiran-dev.md","api.soubiran.dev",{"type":7,"value":30,"toc":131},[31,46,57,62,65,68,71,75,91,94,97,100,103,106,110,113,121,124,128],[32,33,34,40,41,45],"p",{},[35,36,28],"a",{"href":37,"rel":38},"https:\u002F\u002Fapi.soubiran.dev",[39],"nofollow"," owns the dynamic data behind ",[35,42,44],{"href":43},"\u002Finfra\u002Fwebsites\u002Fsoubiran-dev","soubiran.dev",". The personal website remains statically generated, while this Laravel application stores user accounts, comments, reactions, votes, feedback, messages, and notifications.",[32,47,48,49,51,52,56],{},"It also imports stable records for content published by ",[35,50,44],{"href":43},", including its ",[35,53,55],{"href":54},"\u002Finfra","infrastructure documentation",". Stable page IDs keep those records connected when a title or URL changes.",[58,59,61],"h2",{"id":60},"why-the-dynamic-state-is-separate","Why the dynamic state is separate",[32,63,64],{},"Most requests to my personal website only need static HTML and assets. Comments and reactions have different requirements. They need authenticated writes, authorization, persistence, and an administration interface. Putting those concerns in a separate application keeps them out of the static publishing path.",[32,66,67],{},"Laravel provides the data model and request lifecycle for that mutable state. The website can still deploy as static files on Cloudflare, and its browser code calls the API only for interactive features. This split fits a content site that benefits from static delivery but still needs accounts and user-generated data.",[32,69,70],{},"The API stores a local page record rather than copying article content. Published records use the UUID from the source website as their API route key. Interactions point to that record, so a later content build can change the page title or canonical URL without breaking its comments or reactions.",[58,72,74],{"id":73},"how-content-and-interactions-meet","How content and interactions meet",[32,76,77,78,82,83,86,87,90],{},"The website publishes ",[79,80,81],"code",{},"\u002Fpages.en.json"," and ",[79,84,85],{},"\u002Fpages.fr.json"," catalogs. During deployment, the API fetches those catalogs and upserts their entries by UUID. The ",[35,88,89],{"href":43},"soubiran.dev catalogs"," supply each page's stable ID, title, description, published URL, and Markdown URL. The English catalog also includes the infrastructure documentation.",[32,92,93],{},"The browser addresses published-page interaction routes with that UUID. Public endpoints return emoji definitions, vote totals, feedback summaries, reactions, and comment threads. They also accept page feedback without creating an account. Comment responses include rendered Markdown, replies, like counts, author data, and capability flags, which lets the website render the thread without reproducing Laravel's authorization rules.",[32,95,96],{},"Voting is the exception to UUID routing. A candidate article can exist in the API before publication, so vote mutations use its internal database ID. Once the article is published, a metadata import attaches the public UUID to the same record.",[32,98,99],{},"Authenticated routes cover user-specific data and mutations. They return the current account, votes, reactions, and notifications, and they handle comments, likes, reactions, votes, Markdown previews, and ask-me-anything messages. The API only includes private identity fields when a signed-in user reads their own account.",[32,101,102],{},"Laravel Sanctum treats the website as a stateful first-party client. Before an unsafe request, the browser obtains a CSRF cookie and sends the request with its session credentials. Users sign in through GitHub, Google, or Discord with Laravel Socialite. This uses the browser session for the first-party website instead of exposing long-lived API tokens to client code.",[32,104,105],{},"Filament provides the private administration panel. New accounts and user activity can create queued database notifications for administrators, while Laravel policies decide which comment and account actions each request may perform.",[58,107,109],{"id":108},"deployment-ordering","Deployment ordering",[32,111,112],{},"Forge deploys the application on a server. Its deployment script enables maintenance mode, pulls the selected branch, installs production PHP dependencies, optimizes Laravel, reloads PHP-FPM, and runs database migrations. It then imports the website's localized catalogs before bringing the application back online.",[32,114,115,116,120],{},"Those imports make deployment order part of the data contract. A normal API deployment must fetch catalogs that are already live, not files from the previous website build. After a push to the website, ",[35,117,119],{"href":118},"\u002Finfra\u002Fservices\u002Fredeploy-soubiran-dev","redeploy.soubiran.dev"," waits for the corresponding Cloudflare Worker deployment to reach production before it calls the API deploy hook.",[32,122,123],{},"This sequence keeps static content and mutable records independent without letting their shared page IDs drift. Website builds publish the source metadata first. The API deployment imports it second. Browser requests can then attach current interaction data to the new pages.",[58,125,127],{"id":126},"ecosystem","Ecosystem",[129,130],"infra-ecosystem",{},{"title":10,"searchDepth":11,"depth":11,"links":132},[133,134,135,136],{"id":60,"depth":11,"text":61},{"id":73,"depth":11,"text":74},{"id":108,"depth":11,"text":109},{"id":126,"depth":11,"text":127},"f2225f4f-7da6-4515-a5bf-e6adf1c9f294","The Laravel service that owns accounts, comments, reactions, votes, feedback, and other dynamic data for my personal website.",[140,179,187],{"type":141,"name":142,"description":143,"ecosystem":144},"deployment","Forge","Deploy the Laravel application and run its database migrations and metadata imports.",[145,176],{"type":146,"id":28,"name":147,"description":148,"href":149,"ecosystem":150},"repository","GitHub","Host the public application source and Forge deployment script.","https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fapi.soubiran.dev",[151,156,160,164,168,172],{"type":152,"name":153,"description":154,"href":155},"stack","Laravel","Handle HTTP routes, persistence, authorization, queues, and notifications.","https:\u002F\u002Flaravel.com",{"type":152,"name":157,"description":158,"href":159},"Laravel Sanctum","Authenticate first-party browser requests with the Laravel session.","https:\u002F\u002Flaravel.com\u002Fdocs\u002Fsanctum",{"type":152,"name":161,"description":162,"href":163},"Laravel Socialite","Connect user accounts to GitHub, Google, and Discord.","https:\u002F\u002Flaravel.com\u002Fdocs\u002Fsocialite",{"type":152,"name":165,"description":166,"href":167},"Filament","Provide the private administration panel for application records.","https:\u002F\u002Ffilamentphp.com",{"type":152,"name":169,"description":170,"href":171},"Spatie Laravel Markdown","Render the Markdown preview used when writing comments.","https:\u002F\u002Fgithub.com\u002Fspatie\u002Flaravel-markdown",{"type":152,"name":173,"description":174,"href":175},"Sentry","Capture application exceptions and performance traces.","https:\u002F\u002Fsentry.io",{"type":177,"name":119,"description":178},"service","Trigger this deployment only after an upstream website reaches production.",{"type":180,"name":181,"description":182,"ecosystem":183},"data","soubiran.dev metadata","Supply stable page IDs, titles, and URLs for personal website content and infrastructure documentation.",[184],{"type":185,"name":44,"description":186},"website","Publish the metadata during its static build.",{"type":185,"relationship":188,"name":44,"description":189},"consumer","Read public interaction data and send authenticated changes from the browser.",{},"\u002Finfra\u002Fservices\u002Fapi-soubiran-dev","---\ncontentId: f2225f4f-7da6-4515-a5bf-e6adf1c9f294\ntitle: api.soubiran.dev\ndescription: >-\n  The Laravel service that owns accounts, comments, reactions, votes, feedback,\n  and other dynamic data for my personal website.\nurl: 'https:\u002F\u002Fapi.soubiran.dev'\nrepository: 'https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fapi.soubiran.dev'\necosystem:\n  - type: deployment\n    name: Forge\n    description: Deploy the Laravel application and run its database migrations and metadata imports.\n    ecosystem:\n      - type: repository\n        id: api.soubiran.dev\n        name: GitHub\n        description: Host the public application source and Forge deployment script.\n        href: 'https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fapi.soubiran.dev'\n        ecosystem:\n          - type: stack\n            name: Laravel\n            description: Handle HTTP routes, persistence, authorization, queues, and notifications.\n            href: 'https:\u002F\u002Flaravel.com'\n          - type: stack\n            name: Laravel Sanctum\n            description: Authenticate first-party browser requests with the Laravel session.\n            href: 'https:\u002F\u002Flaravel.com\u002Fdocs\u002Fsanctum'\n          - type: stack\n            name: Laravel Socialite\n            description: Connect user accounts to GitHub, Google, and Discord.\n            href: 'https:\u002F\u002Flaravel.com\u002Fdocs\u002Fsocialite'\n          - type: stack\n            name: Filament\n            description: Provide the private administration panel for application records.\n            href: 'https:\u002F\u002Ffilamentphp.com'\n          - type: stack\n            name: Spatie Laravel Markdown\n            description: Render the Markdown preview used when writing comments.\n            href: 'https:\u002F\u002Fgithub.com\u002Fspatie\u002Flaravel-markdown'\n          - type: stack\n            name: Sentry\n            description: Capture application exceptions and performance traces.\n            href: 'https:\u002F\u002Fsentry.io'\n      - type: service\n        name: redeploy.soubiran.dev\n        description: Trigger this deployment only after an upstream website reaches production.\n  - type: data\n    name: soubiran.dev metadata\n    description: Supply stable page IDs, titles, and URLs for personal website content and infrastructure documentation.\n    ecosystem:\n      - type: website\n        name: soubiran.dev\n        description: Publish the metadata during its static build.\n  - type: website\n    relationship: consumer\n    name: soubiran.dev\n    description: Read public interaction data and send authenticated changes from the browser.\n---\n\n[api.soubiran.dev](https:\u002F\u002Fapi.soubiran.dev) owns the dynamic data behind [soubiran.dev](\u002Finfra\u002Fwebsites\u002Fsoubiran-dev). The personal website remains statically generated, while this Laravel application stores user accounts, comments, reactions, votes, feedback, messages, and notifications.\n\nIt also imports stable records for content published by [soubiran.dev](\u002Finfra\u002Fwebsites\u002Fsoubiran-dev), including its [infrastructure documentation](\u002Finfra). Stable page IDs keep those records connected when a title or URL changes.\n\n## Why the dynamic state is separate\n\nMost requests to my personal website only need static HTML and assets. Comments and reactions have different requirements. They need authenticated writes, authorization, persistence, and an administration interface. Putting those concerns in a separate application keeps them out of the static publishing path.\n\nLaravel provides the data model and request lifecycle for that mutable state. The website can still deploy as static files on Cloudflare, and its browser code calls the API only for interactive features. This split fits a content site that benefits from static delivery but still needs accounts and user-generated data.\n\nThe API stores a local page record rather than copying article content. Published records use the UUID from the source website as their API route key. Interactions point to that record, so a later content build can change the page title or canonical URL without breaking its comments or reactions.\n\n## How content and interactions meet\n\nThe website publishes `\u002Fpages.en.json` and `\u002Fpages.fr.json` catalogs. During deployment, the API fetches those catalogs and upserts their entries by UUID. The [soubiran.dev catalogs](\u002Finfra\u002Fwebsites\u002Fsoubiran-dev) supply each page's stable ID, title, description, published URL, and Markdown URL. The English catalog also includes the infrastructure documentation.\n\nThe browser addresses published-page interaction routes with that UUID. Public endpoints return emoji definitions, vote totals, feedback summaries, reactions, and comment threads. They also accept page feedback without creating an account. Comment responses include rendered Markdown, replies, like counts, author data, and capability flags, which lets the website render the thread without reproducing Laravel's authorization rules.\n\nVoting is the exception to UUID routing. A candidate article can exist in the API before publication, so vote mutations use its internal database ID. Once the article is published, a metadata import attaches the public UUID to the same record.\n\nAuthenticated routes cover user-specific data and mutations. They return the current account, votes, reactions, and notifications, and they handle comments, likes, reactions, votes, Markdown previews, and ask-me-anything messages. The API only includes private identity fields when a signed-in user reads their own account.\n\nLaravel Sanctum treats the website as a stateful first-party client. Before an unsafe request, the browser obtains a CSRF cookie and sends the request with its session credentials. Users sign in through GitHub, Google, or Discord with Laravel Socialite. This uses the browser session for the first-party website instead of exposing long-lived API tokens to client code.\n\nFilament provides the private administration panel. New accounts and user activity can create queued database notifications for administrators, while Laravel policies decide which comment and account actions each request may perform.\n\n## Deployment ordering\n\nForge deploys the application on a server. Its deployment script enables maintenance mode, pulls the selected branch, installs production PHP dependencies, optimizes Laravel, reloads PHP-FPM, and runs database migrations. It then imports the website's localized catalogs before bringing the application back online.\n\nThose imports make deployment order part of the data contract. A normal API deployment must fetch catalogs that are already live, not files from the previous website build. After a push to the website, [redeploy.soubiran.dev](\u002Finfra\u002Fservices\u002Fredeploy-soubiran-dev) waits for the corresponding Cloudflare Worker deployment to reach production before it calls the API deploy hook.\n\nThis sequence keeps static content and mutable records independent without letting their shared page IDs drift. Website builds publish the source metadata first. The API deployment imports it second. Browser requests can then attach current interaction data to the new pages.\n\n## Ecosystem\n\n::infra-ecosystem\n::\n",{"title":28,"description":138},{"loc":191},"infra\u002Fservices\u002Fapi-soubiran-dev","uoTy8_rbXZs4ep0szlOdsbwA127lHI-6FfAEfPkMda8",{"id":198,"title":199,"body":200,"contentId":755,"description":756,"ecosystem":757,"extension":16,"meta":789,"navigation":18,"part":15,"path":790,"rawbody":791,"repository":792,"robots":15,"schemaOrg":15,"seo":794,"sitemap":795,"stem":796,"url":206,"__hash__":797},"pages\u002Finfra\u002Fservices\u002Fautomation-soubiran-dev.md","automation.soubiran.dev",{"type":7,"value":201,"toc":750},[202,215,218,222,225,228,706,715,730,733,736,739,742,744,746],[32,203,204,208,209,214],{},[35,205,199],{"href":206,"rel":207},"https:\u002F\u002Fautomation.soubiran.dev",[39]," is an internal service that helps me automate various tasks with ",[35,210,213],{"href":211,"rel":212},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkflows\u002F",[39],"Cloudflare Workflows",".",[32,216,217],{},"There is no public access or frontend interface. The endpoint only receives calls and triggers workflows.",[58,219,221],{"id":220},"development","Development",[32,223,224],{},"The service runs on a Cloudflare Worker that receives HTTP requests from my local CLI tool. Each endpoint triggers a different Cloudflare Workflow.",[32,226,227],{},"For example, I have a workflow that I use to remind myself to publish scheduled tweets.",[229,230,235],"pre",{"className":231,"code":232,"filename":233,"language":234,"meta":10,"style":10},"language-ts shiki shiki-themes github-light github-light github-dark","import type { WorkflowEvent, WorkflowStep } from 'cloudflare:workers'\nimport { WorkflowEntrypoint } from 'cloudflare:workers'\n\nexport default {\n  async fetch(request: Request, env: Env): Promise\u003CResponse> {\n    const body = await request.json\u003C{ scheduleAt?: number, content?: string }>()\n\n    await env.AUTOMATION_WORKFLOW.create({\n      params: {\n        scheduleAt: body.scheduleAt,\n        content: body.content,\n      },\n    })\n\n    return new Response('Scheduled', { status: 201 })\n  },\n}\n\nexport class Automation extends WorkflowEntrypoint\u003CEnv, any> {\n  async run(event: WorkflowEvent\u003Cany>, step: WorkflowStep) {\n    await step.sleepUntil('trigger time', event.payload.scheduleAt)\n\n    await step.do('trigger action', async () => {\n      await fetch(this.env.DISCORD_WEBHOOK_URL, {\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application\u002Fjson',\n        },\n        body: JSON.stringify({ content: event.payload.content }),\n      })\n    })\n  }\n}\n","src\u002Findex.ts","ts",[79,236,237,260,271,277,289,340,387,392,412,418,424,430,436,442,447,473,479,485,490,519,555,574,579,607,629,641,647,661,667,684,690,695,701],{"__ignoreMap":10},[238,239,242,246,249,253,256],"span",{"class":240,"line":241},"line",1,[238,243,245],{"class":244},"s8jYJ","import",[238,247,248],{"class":244}," type",[238,250,252],{"class":251},"sxrX7"," { WorkflowEvent, WorkflowStep } ",[238,254,255],{"class":244},"from",[238,257,259],{"class":258},"sIIMD"," 'cloudflare:workers'\n",[238,261,262,264,267,269],{"class":240,"line":11},[238,263,245],{"class":244},[238,265,266],{"class":251}," { WorkflowEntrypoint } ",[238,268,255],{"class":244},[238,270,259],{"class":258},[238,272,274],{"class":240,"line":273},3,[238,275,276],{"emptyLinePlaceholder":18},"\n",[238,278,280,283,286],{"class":240,"line":279},4,[238,281,282],{"class":244},"export",[238,284,285],{"class":244}," default",[238,287,288],{"class":251}," {\n",[238,290,292,295,299,302,306,309,312,315,318,320,323,326,328,331,334,337],{"class":240,"line":291},5,[238,293,294],{"class":244},"  async",[238,296,298],{"class":297},"snPdu"," fetch",[238,300,301],{"class":251},"(",[238,303,305],{"class":304},"sP4rz","request",[238,307,308],{"class":244},":",[238,310,311],{"class":297}," Request",[238,313,314],{"class":251},", ",[238,316,317],{"class":304},"env",[238,319,308],{"class":244},[238,321,322],{"class":297}," Env",[238,324,325],{"class":251},")",[238,327,308],{"class":244},[238,329,330],{"class":297}," Promise",[238,332,333],{"class":251},"\u003C",[238,335,336],{"class":297},"Response",[238,338,339],{"class":251},"> {\n",[238,341,343,346,350,353,356,359,362,365,368,371,374,376,379,381,384],{"class":240,"line":342},6,[238,344,345],{"class":244},"    const",[238,347,349],{"class":348},"sBjJW"," body",[238,351,352],{"class":244}," =",[238,354,355],{"class":244}," await",[238,357,358],{"class":251}," request.",[238,360,361],{"class":297},"json",[238,363,364],{"class":251},"\u003C{ ",[238,366,367],{"class":304},"scheduleAt",[238,369,370],{"class":244},"?:",[238,372,373],{"class":348}," number",[238,375,314],{"class":251},[238,377,378],{"class":304},"content",[238,380,370],{"class":244},[238,382,383],{"class":348}," string",[238,385,386],{"class":251}," }>()\n",[238,388,390],{"class":240,"line":389},7,[238,391,276],{"emptyLinePlaceholder":18},[238,393,395,398,401,404,406,409],{"class":240,"line":394},8,[238,396,397],{"class":244},"    await",[238,399,400],{"class":251}," env.",[238,402,403],{"class":348},"AUTOMATION_WORKFLOW",[238,405,214],{"class":251},[238,407,408],{"class":297},"create",[238,410,411],{"class":251},"({\n",[238,413,415],{"class":240,"line":414},9,[238,416,417],{"class":251},"      params: {\n",[238,419,421],{"class":240,"line":420},10,[238,422,423],{"class":251},"        scheduleAt: body.scheduleAt,\n",[238,425,427],{"class":240,"line":426},11,[238,428,429],{"class":251},"        content: body.content,\n",[238,431,433],{"class":240,"line":432},12,[238,434,435],{"class":251},"      },\n",[238,437,439],{"class":240,"line":438},13,[238,440,441],{"class":251},"    })\n",[238,443,445],{"class":240,"line":444},14,[238,446,276],{"emptyLinePlaceholder":18},[238,448,450,453,456,459,461,464,467,470],{"class":240,"line":449},15,[238,451,452],{"class":244},"    return",[238,454,455],{"class":244}," new",[238,457,458],{"class":297}," Response",[238,460,301],{"class":251},[238,462,463],{"class":258},"'Scheduled'",[238,465,466],{"class":251},", { status: ",[238,468,469],{"class":348},"201",[238,471,472],{"class":251}," })\n",[238,474,476],{"class":240,"line":475},16,[238,477,478],{"class":251},"  },\n",[238,480,482],{"class":240,"line":481},17,[238,483,484],{"class":251},"}\n",[238,486,488],{"class":240,"line":487},18,[238,489,276],{"emptyLinePlaceholder":18},[238,491,493,495,498,501,504,507,509,512,514,517],{"class":240,"line":492},19,[238,494,282],{"class":244},[238,496,497],{"class":244}," class",[238,499,500],{"class":297}," Automation",[238,502,503],{"class":244}," extends",[238,505,506],{"class":297}," WorkflowEntrypoint",[238,508,333],{"class":251},[238,510,511],{"class":297},"Env",[238,513,314],{"class":251},[238,515,516],{"class":348},"any",[238,518,339],{"class":251},[238,520,522,524,527,529,532,534,537,539,541,544,547,549,552],{"class":240,"line":521},20,[238,523,294],{"class":244},[238,525,526],{"class":297}," run",[238,528,301],{"class":251},[238,530,531],{"class":304},"event",[238,533,308],{"class":244},[238,535,536],{"class":297}," WorkflowEvent",[238,538,333],{"class":251},[238,540,516],{"class":348},[238,542,543],{"class":251},">, ",[238,545,546],{"class":304},"step",[238,548,308],{"class":244},[238,550,551],{"class":297}," WorkflowStep",[238,553,554],{"class":251},") {\n",[238,556,558,560,563,566,568,571],{"class":240,"line":557},21,[238,559,397],{"class":244},[238,561,562],{"class":251}," step.",[238,564,565],{"class":297},"sleepUntil",[238,567,301],{"class":251},[238,569,570],{"class":258},"'trigger time'",[238,572,573],{"class":251},", event.payload.scheduleAt)\n",[238,575,577],{"class":240,"line":576},22,[238,578,276],{"emptyLinePlaceholder":18},[238,580,582,584,586,589,591,594,596,599,602,605],{"class":240,"line":581},23,[238,583,397],{"class":244},[238,585,562],{"class":251},[238,587,588],{"class":297},"do",[238,590,301],{"class":251},[238,592,593],{"class":258},"'trigger action'",[238,595,314],{"class":251},[238,597,598],{"class":244},"async",[238,600,601],{"class":251}," () ",[238,603,604],{"class":244},"=>",[238,606,288],{"class":251},[238,608,610,613,615,617,620,623,626],{"class":240,"line":609},24,[238,611,612],{"class":244},"      await",[238,614,298],{"class":297},[238,616,301],{"class":251},[238,618,619],{"class":348},"this",[238,621,622],{"class":251},".env.",[238,624,625],{"class":348},"DISCORD_WEBHOOK_URL",[238,627,628],{"class":251},", {\n",[238,630,632,635,638],{"class":240,"line":631},25,[238,633,634],{"class":251},"        method: ",[238,636,637],{"class":258},"'POST'",[238,639,640],{"class":251},",\n",[238,642,644],{"class":240,"line":643},26,[238,645,646],{"class":251},"        headers: {\n",[238,648,650,653,656,659],{"class":240,"line":649},27,[238,651,652],{"class":258},"          'Content-Type'",[238,654,655],{"class":251},": ",[238,657,658],{"class":258},"'application\u002Fjson'",[238,660,640],{"class":251},[238,662,664],{"class":240,"line":663},28,[238,665,666],{"class":251},"        },\n",[238,668,670,673,676,678,681],{"class":240,"line":669},29,[238,671,672],{"class":251},"        body: ",[238,674,675],{"class":348},"JSON",[238,677,214],{"class":251},[238,679,680],{"class":297},"stringify",[238,682,683],{"class":251},"({ content: event.payload.content }),\n",[238,685,687],{"class":240,"line":686},30,[238,688,689],{"class":251},"      })\n",[238,691,693],{"class":240,"line":692},31,[238,694,441],{"class":251},[238,696,698],{"class":240,"line":697},32,[238,699,700],{"class":251},"  }\n",[238,702,704],{"class":240,"line":703},33,[238,705,484],{"class":251},[707,708,709],"blockquote",{},[32,710,711,714],{},[238,712,713],{},"!NOTE","\nThe code is simplified for clarity. The actual implementation includes error handling, logging, and other production-ready features.",[32,716,717,718,723,724,729],{},"The worker itself does not authenticate requests, even though it is exposed to the public internet. Instead, I rely on ",[35,719,722],{"href":720,"rel":721},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fcloudflare-one\u002F",[39],"Cloudflare One"," with a ",[35,725,728],{"href":726,"rel":727},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fcloudflare-one\u002Faccess-controls\u002Fservice-credentials\u002Fservice-tokens\u002F",[39],"service token"," to ensure that only my CLI tool can call the endpoints.",[32,731,732],{},"This keeps authentication outside the worker and prevents unauthorized requests from triggering workflows and generating costs.",[58,734,735],{"id":141},"Deployment",[32,737,738],{},"Cloudflare Builds deploys the service automatically. Every push to the main branch triggers a new deployment of the worker and its workflows.",[32,740,741],{},"Cloudflare's observability tools expose workflow executions and worker metrics in the dashboard.",[58,743,127],{"id":126},[129,745],{},[747,748,749],"style",{},"html pre.shiki code .s8jYJ, html code.shiki .s8jYJ{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sxrX7, html code.shiki .sxrX7{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sIIMD, html code.shiki .sIIMD{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .snPdu, html code.shiki .snPdu{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sP4rz, html code.shiki .sP4rz{--shiki-light:#E36209;--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sBjJW, html code.shiki .sBjJW{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":10,"searchDepth":11,"depth":11,"links":751},[752,753,754],{"id":220,"depth":11,"text":221},{"id":141,"depth":11,"text":735},{"id":126,"depth":11,"text":127},"640cabcb-1bd2-4960-b25b-df4f4eb2e9de","An internal service for automating tasks using Cloudflare Workflows and secured by Cloudflare One to ensure only authorized access.",[758,785],{"type":759,"name":722,"description":760,"ecosystem":761},"auth","Protect the automation endpoints so only my CLI can trigger them.",[762],{"type":141,"id":763,"name":764,"description":765,"ecosystem":766},"automation-soubiran-dev","Cloudflare Workers","Expose the automation endpoints and trigger workflows from incoming requests.",[767,782],{"type":768,"id":763,"name":769,"description":770,"ecosystem":771},"build","Cloudflare Build","Deploy the worker and workflows automatically on each push.",[772],{"type":146,"id":773,"name":147,"description":774,"ecosystem":775},"automation-repository","Host the private source code for this internal automation service.",[776,779],{"type":152,"name":777,"href":778},"Wrangler","https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fwrangler",{"type":152,"name":780,"href":781},"Evlog","https:\u002F\u002Fevlog.dev",{"type":783,"name":213,"description":784},"workflows","Run background jobs for the automation tasks handled by the service.",{"type":786,"name":787,"description":788},"domain","Cloudflare Domains","Manage the DNS records that route `automation.soubiran.dev` to the worker.",{},"\u002Finfra\u002Fservices\u002Fautomation-soubiran-dev","---\ncontentId: 640cabcb-1bd2-4960-b25b-df4f4eb2e9de\ntitle: automation.soubiran.dev\ndescription: >-\n  An internal service for automating tasks using Cloudflare Workflows and secured\n  by Cloudflare One to ensure only authorized access.\nurl: https:\u002F\u002Fautomation.soubiran.dev\nrepository:\n  url: https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fplatform\n  private: true\necosystem:\n  - type: auth\n    name: Cloudflare One\n    description: Protect the automation endpoints so only my CLI can trigger them.\n    ecosystem:\n    - type: deployment\n      id: automation-soubiran-dev\n      name: Cloudflare Workers\n      description: Expose the automation endpoints and trigger workflows from incoming requests.\n      ecosystem:\n        - type: build\n          id: automation-soubiran-dev\n          name: Cloudflare Build\n          description: Deploy the worker and workflows automatically on each push.\n          ecosystem:\n            - type: repository\n              id: automation-repository\n              name: GitHub\n              description: Host the private source code for this internal automation service.\n              ecosystem:\n                - type: stack\n                  name: Wrangler\n                  href: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fwrangler\n                - type: stack\n                  name: Evlog\n                  href: https:\u002F\u002Fevlog.dev\n        - type: workflows\n          name: Cloudflare Workflows\n          description: Run background jobs for the automation tasks handled by the service.\n  - type: domain\n    name: Cloudflare Domains\n    description: Manage the DNS records that route `automation.soubiran.dev` to the worker.\n---\n\n[automation.soubiran.dev](https:\u002F\u002Fautomation.soubiran.dev) is an internal service that helps me automate various tasks with [Cloudflare Workflows](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkflows\u002F).\n\nThere is no public access or frontend interface. The endpoint only receives calls and triggers workflows.\n\n## Development\n\nThe service runs on a Cloudflare Worker that receives HTTP requests from my local CLI tool. Each endpoint triggers a different Cloudflare Workflow.\n\nFor example, I have a workflow that I use to remind myself to publish scheduled tweets.\n\n```ts [src\u002Findex.ts]\nimport type { WorkflowEvent, WorkflowStep } from 'cloudflare:workers'\nimport { WorkflowEntrypoint } from 'cloudflare:workers'\n\nexport default {\n  async fetch(request: Request, env: Env): Promise\u003CResponse> {\n    const body = await request.json\u003C{ scheduleAt?: number, content?: string }>()\n\n    await env.AUTOMATION_WORKFLOW.create({\n      params: {\n        scheduleAt: body.scheduleAt,\n        content: body.content,\n      },\n    })\n\n    return new Response('Scheduled', { status: 201 })\n  },\n}\n\nexport class Automation extends WorkflowEntrypoint\u003CEnv, any> {\n  async run(event: WorkflowEvent\u003Cany>, step: WorkflowStep) {\n    await step.sleepUntil('trigger time', event.payload.scheduleAt)\n\n    await step.do('trigger action', async () => {\n      await fetch(this.env.DISCORD_WEBHOOK_URL, {\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application\u002Fjson',\n        },\n        body: JSON.stringify({ content: event.payload.content }),\n      })\n    })\n  }\n}\n```\n\n> [!NOTE]\n> The code is simplified for clarity. The actual implementation includes error handling, logging, and other production-ready features.\n\nThe worker itself does not authenticate requests, even though it is exposed to the public internet. Instead, I rely on [Cloudflare One](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fcloudflare-one\u002F) with a [service token](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fcloudflare-one\u002Faccess-controls\u002Fservice-credentials\u002Fservice-tokens\u002F) to ensure that only my CLI tool can call the endpoints.\n\nThis keeps authentication outside the worker and prevents unauthorized requests from triggering workflows and generating costs.\n\n## Deployment\n\nCloudflare Builds deploys the service automatically. Every push to the main branch triggers a new deployment of the worker and its workflows.\n\nCloudflare's observability tools expose workflow executions and worker metrics in the dashboard.\n\n## Ecosystem\n\n::infra-ecosystem\n::\n",{"url":793,"private":18},"https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fplatform",{"title":199,"description":756},{"loc":790},"infra\u002Fservices\u002Fautomation-soubiran-dev","suOnJt7AzcGF88aUChkHxkQ87uVQEvSu_iuOczcasHM",{"id":799,"title":800,"body":801,"contentId":1139,"description":1140,"ecosystem":1141,"extension":16,"meta":1194,"navigation":18,"part":15,"path":1195,"rawbody":1196,"repository":815,"robots":15,"schemaOrg":15,"seo":1197,"sitemap":1198,"stem":1199,"url":807,"__hash__":1200},"pages\u002Finfra\u002Fservices\u002Fmcp-soubiran-dev.md","mcp.soubiran.dev",{"type":7,"value":802,"toc":1128},[803,810,826,830,849,856,864,867,871,877,887,890,901,905,911,914,918,924,927,1073,1079,1083,1088,1108,1111,1115,1118,1121,1123,1125],[32,804,805,809],{},[35,806,800],{"href":807,"rel":808},"https:\u002F\u002Fmcp.soubiran.dev\u002Fmcp",[39]," gives assistants access to my public English and French content. It exposes three read-only tools for topic discovery, complete Markdown retrieval, and exact metadata queries.",[32,811,812,813,818,819,822,823,825],{},"The ",[35,814,817],{"href":815,"rel":816},"https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fmcp.soubiran.dev",[39],"TypeScript Worker"," uses the Model Context Protocol SDK and the Cloudflare Agents MCP handler. Requests to ",[79,820,821],{},"\u002Fmcp"," reach the server. Other paths redirect to ",[35,824,44],{"href":43},". The handler does not require authentication.",[58,827,829],{"id":828},"one-content-catalog-two-locales","One content catalog, two locales",[32,831,832,833,82,835,837,838,82,841,844,845,848],{},"The server loads the website's ",[79,834,81],{},[79,836,85],{}," feeds in parallel. ",[79,839,840],{},"PAGES_EN_URL",[79,842,843],{},"PAGES_FR_URL"," configure their locations. Zod validates the records, and the loader combines them into one ",[79,846,847],{},"pages"," array.",[32,850,851,852,855],{},"Each record has a stable ID, locale, content type, title, published URL, and ",[79,853,854],{},"markdownUrl",". Descriptions, dates, and translation links are optional. Relative URLs are resolved against the feed URL. Duplicate IDs across the combined feeds cause an error rather than selecting one document arbitrarily.",[32,857,858,859,863],{},"The website catalog covers pages, posts, talks, series, series articles, and infrastructure documentation. ",[35,860,862],{"href":861},"\u002Finfra\u002Fwebsites\u002Ftalks-soubiran-dev","talks.soubiran.dev"," supplies talk content to the website during its build. The MCP reads the resulting website documents through the same catalog as the rest of the content.",[32,865,866],{},"Publication stays with the website. The MCP fetches metadata and follows the supplied Markdown URLs; it does not maintain another document store.",[58,868,870],{"id":869},"search-retrieve-or-query","Search, retrieve, or query",[872,873,875],"h3",{"id":874},"search_content",[79,876,874],{},[32,878,879,880,883,884,214],{},"This tool accepts a natural-language query and searches the ",[79,881,882],{},"soubiran-dev"," Cloudflare AI Search instance. Search and catalog loading run in parallel. Retrieval requests up to 20 results with a match threshold of 0.6 and reranks them with ",[79,885,886],{},"@cf\u002Fbaai\u002Fbge-reranker-base",[32,888,889],{},"The server matches each search chunk's metadata ID to a catalog record. It returns the score, excerpt, source key, and page metadata, including the published URL for citations. Chunks without a matching catalog entry are omitted.",[32,891,892,893,896,897,900],{},"Search finds relevant content, but ranking does not establish which page is newest. Exact date comparisons belong in ",[79,894,895],{},"list_pages",", and an assistant should read the full document with ",[79,898,899],{},"get_page"," before summarizing it.",[872,902,903],{"id":899},[79,904,899],{},[32,906,907,908,910],{},"This tool accepts an exact stable ID, resolves it in the combined catalog, and fetches its ",[79,909,854],{},". It returns the complete document as text. An unknown ID or failed upstream request produces an MCP tool error.",[32,912,913],{},"A talk document can include its summary, event details, resource links, and transcript. The website composes that Markdown, so retrieval works the same way for a talk, post, or infrastructure page.",[872,915,916],{"id":895},[79,917,895],{},[32,919,920,921,923],{},"This tool accepts a single asynchronous JavaScript arrow function. The function can read the combined ",[79,922,847],{}," array to filter by locale or type, match titles, compare dates, count records, or group metadata. It does not search document bodies.",[32,925,926],{},"For example, this query returns the five most recent dated English posts with the fields needed for retrieval and citation:",[229,928,932],{"className":929,"code":930,"language":931,"meta":10,"style":10},"language-js shiki shiki-themes github-light github-light github-dark","async () => pages\n  .filter(page => page.locale === 'en' && page.type === 'post' && page.date)\n  .sort((a, b) => b.date.localeCompare(a.date))\n  .slice(0, 5)\n  .map(({ id, title, date, url }) => ({ id, title, date, url }))\n","js",[79,933,934,945,986,1017,1037],{"__ignoreMap":10},[238,935,936,938,940,942],{"class":240,"line":241},[238,937,598],{"class":244},[238,939,601],{"class":251},[238,941,604],{"class":244},[238,943,944],{"class":251}," pages\n",[238,946,947,950,953,955,958,961,964,967,970,973,976,978,981,983],{"class":240,"line":11},[238,948,949],{"class":251},"  .",[238,951,952],{"class":297},"filter",[238,954,301],{"class":251},[238,956,957],{"class":304},"page",[238,959,960],{"class":244}," =>",[238,962,963],{"class":251}," page.locale ",[238,965,966],{"class":244},"===",[238,968,969],{"class":258}," 'en'",[238,971,972],{"class":244}," &&",[238,974,975],{"class":251}," page.type ",[238,977,966],{"class":244},[238,979,980],{"class":258}," 'post'",[238,982,972],{"class":244},[238,984,985],{"class":251}," page.date)\n",[238,987,988,990,993,996,998,1000,1003,1006,1008,1011,1014],{"class":240,"line":273},[238,989,949],{"class":251},[238,991,992],{"class":297},"sort",[238,994,995],{"class":251},"((",[238,997,35],{"class":304},[238,999,314],{"class":251},[238,1001,1002],{"class":304},"b",[238,1004,1005],{"class":251},") ",[238,1007,604],{"class":244},[238,1009,1010],{"class":251}," b.date.",[238,1012,1013],{"class":297},"localeCompare",[238,1015,1016],{"class":251},"(a.date))\n",[238,1018,1019,1021,1024,1026,1029,1031,1034],{"class":240,"line":279},[238,1020,949],{"class":251},[238,1022,1023],{"class":297},"slice",[238,1025,301],{"class":251},[238,1027,1028],{"class":348},"0",[238,1030,314],{"class":251},[238,1032,1033],{"class":348},"5",[238,1035,1036],{"class":251},")\n",[238,1038,1039,1041,1044,1047,1050,1052,1055,1057,1060,1062,1065,1068,1070],{"class":240,"line":291},[238,1040,949],{"class":251},[238,1042,1043],{"class":297},"map",[238,1045,1046],{"class":251},"(({ ",[238,1048,1049],{"class":304},"id",[238,1051,314],{"class":251},[238,1053,1054],{"class":304},"title",[238,1056,314],{"class":251},[238,1058,1059],{"class":304},"date",[238,1061,314],{"class":251},[238,1063,1064],{"class":304},"url",[238,1066,1067],{"class":251}," }) ",[238,1069,604],{"class":244},[238,1071,1072],{"class":251}," ({ id, title, date, url }))\n",[32,1074,1075,1076,1078],{},"Returning only the relevant records and fields reduces how much metadata enters the model's context. Both discovery tools return IDs that ",[79,1077,899],{}," can resolve.",[58,1080,1082],{"id":1081},"isolated-code-execution","Isolated code execution",[32,1084,1085,1087],{},[79,1086,895],{}," uses Code Mode to answer metadata questions without a separate tool for every filter or aggregation. Acorn parses the submitted code and checks that it is one asynchronous arrow function. Input is limited to 20,000 characters.",[32,1089,1090,1091,1093,1094,1097,1098,314,1101,1104,1105,214],{},"Worker Loader runs the function in a temporary Worker with a recursively frozen copy of ",[79,1092,847],{},". The Worker has no secrets, storage, or application bindings. Network access is disabled with ",[79,1095,1096],{},"globalOutbound: null",", and the executor also disables ",[79,1099,1100],{},"fetch",[79,1102,1103],{},"WebSocket",", and ",[79,1106,1107],{},"EventSource",[32,1109,1110],{},"Execution has a 50 ms CPU limit and permits no subrequests. The function must return a JSON-serializable value, and the server rejects results larger than 256 KiB. Query failures become tool errors rather than failing the MCP request handler.",[58,1112,1114],{"id":1113},"deployment-and-observability","Deployment and observability",[32,1116,1117],{},"Wrangler deploys the server to Cloudflare Workers with an AI Search namespace binding and a Worker Loader binding. The MCP handler uses a configurable allowed CORS origin.",[32,1119,1120],{},"Cloudflare persists logs and traces. Sentry captures exceptions, with user information and HTTP body collection disabled. Evlog records request duration, tool outcomes, selected upstream timings, result counts, and response sizes. Submitted query code is not logged. Redaction rules cover input and output payloads, queries, document content, excerpts, Markdown, authorization headers, and cookies.",[58,1122,127],{"id":126},[129,1124],{},[747,1126,1127],{},"html pre.shiki code .s8jYJ, html code.shiki .s8jYJ{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sxrX7, html code.shiki .sxrX7{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .snPdu, html code.shiki .snPdu{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sP4rz, html code.shiki .sP4rz{--shiki-light:#E36209;--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sIIMD, html code.shiki .sIIMD{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sBjJW, html code.shiki .sBjJW{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":10,"searchDepth":11,"depth":11,"links":1129},[1130,1131,1136,1137,1138],{"id":828,"depth":11,"text":829},{"id":869,"depth":11,"text":870,"children":1132},[1133,1134,1135],{"id":874,"depth":273,"text":874},{"id":899,"depth":273,"text":899},{"id":895,"depth":273,"text":895},{"id":1081,"depth":11,"text":1082},{"id":1113,"depth":11,"text":1114},{"id":126,"depth":11,"text":127},"cf208554-4904-4184-8ddb-05a8201c4347","My MCP server searches English and French website content, retrieves complete Markdown pages, and runs isolated JavaScript queries against page metadata.",[1142,1179,1187,1191],{"type":141,"id":1143,"name":764,"description":1144,"ecosystem":1145},"mcp-soubiran-dev","Expose the MCP server at `\u002Fmcp` and redirect other paths to the personal website.",[1146,1149,1168,1173],{"type":768,"id":1143,"name":777,"description":1147,"href":1148},"Deploy the TypeScript Worker with Wrangler.","https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fwrangler\u002F",{"type":146,"id":800,"name":147,"description":1150,"href":815,"ecosystem":1151},"Host the Worker source, content tools, and deployment configuration.",[1152,1156,1160,1164],{"type":152,"name":1153,"description":1154,"href":1155},"Model Context Protocol SDK","Define the server, tool inputs, and protocol responses.","https:\u002F\u002Fmodelcontextprotocol.io",{"type":152,"name":1157,"description":1158,"href":1159},"Cloudflare Agents","Handle MCP requests at the Worker's `\u002Fmcp` endpoint.","https:\u002F\u002Fdevelopers.cloudflare.com\u002Fagents\u002F",{"type":152,"name":1161,"description":1162,"href":1163},"Zod","Validate localized page catalogs and tool inputs.","https:\u002F\u002Fzod.dev",{"type":152,"name":1165,"description":1166,"href":1167},"Acorn","Parse query code and require a single asynchronous arrow function.","https:\u002F\u002Fgithub.com\u002Facornjs\u002Facorn",{"type":180,"id":1169,"name":1170,"description":1171,"href":1172},"soubiran-dev-ai-search","Cloudflare AI Search","Search the `soubiran-dev` instance through the `AI_SEARCH` namespace binding.","https:\u002F\u002Fdevelopers.cloudflare.com\u002Fai-search\u002F",{"type":1174,"id":1175,"name":1176,"description":1177,"href":1178},"runtime","mcp-content-loader","Cloudflare Worker Loader","Execute metadata queries in temporary Workers with network access disabled.","https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fruntime-apis\u002Fworker-loader\u002F",{"type":180,"id":1180,"name":1181,"description":1182,"ecosystem":1183},"localized-website-catalogs","Localized page catalogs and Markdown","Load `pages.en.json` and `pages.fr.json`, then retrieve documents through each record's `markdownUrl`.",[1184],{"type":185,"name":44,"relationship":1185,"description":1186},"producer","Publish pages, posts, series, talks, and infrastructure documentation in a shared content catalog.",{"type":1188,"id":1189,"name":173,"description":1190,"href":175},"monitoring","mcp-sentry","Capture request and tool exceptions without collecting user information or HTTP bodies.",{"type":1188,"id":1192,"name":780,"description":1193,"href":781},"mcp-evlog","Record structured request and tool outcomes with sensitive content redacted.",{},"\u002Finfra\u002Fservices\u002Fmcp-soubiran-dev","---\ncontentId: cf208554-4904-4184-8ddb-05a8201c4347\ntitle: mcp.soubiran.dev\ndescription: >-\n  My MCP server searches English and French website content, retrieves complete\n  Markdown pages, and runs isolated JavaScript queries against page metadata.\nurl: 'https:\u002F\u002Fmcp.soubiran.dev\u002Fmcp'\nrepository: 'https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fmcp.soubiran.dev'\necosystem:\n  - type: deployment\n    id: mcp-soubiran-dev\n    name: Cloudflare Workers\n    description: Expose the MCP server at `\u002Fmcp` and redirect other paths to the personal website.\n    ecosystem:\n      - type: build\n        id: mcp-soubiran-dev\n        name: Wrangler\n        description: Deploy the TypeScript Worker with Wrangler.\n        href: 'https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fwrangler\u002F'\n      - type: repository\n        id: mcp.soubiran.dev\n        name: GitHub\n        description: Host the Worker source, content tools, and deployment configuration.\n        href: 'https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fmcp.soubiran.dev'\n        ecosystem:\n          - type: stack\n            name: Model Context Protocol SDK\n            description: Define the server, tool inputs, and protocol responses.\n            href: 'https:\u002F\u002Fmodelcontextprotocol.io'\n          - type: stack\n            name: Cloudflare Agents\n            description: Handle MCP requests at the Worker's `\u002Fmcp` endpoint.\n            href: 'https:\u002F\u002Fdevelopers.cloudflare.com\u002Fagents\u002F'\n          - type: stack\n            name: Zod\n            description: Validate localized page catalogs and tool inputs.\n            href: 'https:\u002F\u002Fzod.dev'\n          - type: stack\n            name: Acorn\n            description: Parse query code and require a single asynchronous arrow function.\n            href: 'https:\u002F\u002Fgithub.com\u002Facornjs\u002Facorn'\n      - type: data\n        id: soubiran-dev-ai-search\n        name: Cloudflare AI Search\n        description: Search the `soubiran-dev` instance through the `AI_SEARCH` namespace binding.\n        href: 'https:\u002F\u002Fdevelopers.cloudflare.com\u002Fai-search\u002F'\n      - type: runtime\n        id: mcp-content-loader\n        name: Cloudflare Worker Loader\n        description: Execute metadata queries in temporary Workers with network access disabled.\n        href: 'https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fruntime-apis\u002Fworker-loader\u002F'\n  - type: data\n    id: localized-website-catalogs\n    name: Localized page catalogs and Markdown\n    description: Load `pages.en.json` and `pages.fr.json`, then retrieve documents through each record's `markdownUrl`.\n    ecosystem:\n      - type: website\n        name: soubiran.dev\n        relationship: producer\n        description: Publish pages, posts, series, talks, and infrastructure documentation in a shared content catalog.\n  - type: monitoring\n    id: mcp-sentry\n    name: Sentry\n    description: Capture request and tool exceptions without collecting user information or HTTP bodies.\n    href: 'https:\u002F\u002Fsentry.io'\n  - type: monitoring\n    id: mcp-evlog\n    name: Evlog\n    description: Record structured request and tool outcomes with sensitive content redacted.\n    href: 'https:\u002F\u002Fevlog.dev'\n---\n\n[mcp.soubiran.dev](https:\u002F\u002Fmcp.soubiran.dev\u002Fmcp) gives assistants access to my public English and French content. It exposes three read-only tools for topic discovery, complete Markdown retrieval, and exact metadata queries.\n\nThe [TypeScript Worker](https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fmcp.soubiran.dev) uses the Model Context Protocol SDK and the Cloudflare Agents MCP handler. Requests to `\u002Fmcp` reach the server. Other paths redirect to [soubiran.dev](\u002Finfra\u002Fwebsites\u002Fsoubiran-dev). The handler does not require authentication.\n\n## One content catalog, two locales\n\nThe server loads the website's `\u002Fpages.en.json` and `\u002Fpages.fr.json` feeds in parallel. `PAGES_EN_URL` and `PAGES_FR_URL` configure their locations. Zod validates the records, and the loader combines them into one `pages` array.\n\nEach record has a stable ID, locale, content type, title, published URL, and `markdownUrl`. Descriptions, dates, and translation links are optional. Relative URLs are resolved against the feed URL. Duplicate IDs across the combined feeds cause an error rather than selecting one document arbitrarily.\n\nThe website catalog covers pages, posts, talks, series, series articles, and infrastructure documentation. [talks.soubiran.dev](\u002Finfra\u002Fwebsites\u002Ftalks-soubiran-dev) supplies talk content to the website during its build. The MCP reads the resulting website documents through the same catalog as the rest of the content.\n\nPublication stays with the website. The MCP fetches metadata and follows the supplied Markdown URLs; it does not maintain another document store.\n\n## Search, retrieve, or query\n\n### `search_content`\n\nThis tool accepts a natural-language query and searches the `soubiran-dev` Cloudflare AI Search instance. Search and catalog loading run in parallel. Retrieval requests up to 20 results with a match threshold of 0.6 and reranks them with `@cf\u002Fbaai\u002Fbge-reranker-base`.\n\nThe server matches each search chunk's metadata ID to a catalog record. It returns the score, excerpt, source key, and page metadata, including the published URL for citations. Chunks without a matching catalog entry are omitted.\n\nSearch finds relevant content, but ranking does not establish which page is newest. Exact date comparisons belong in `list_pages`, and an assistant should read the full document with `get_page` before summarizing it.\n\n### `get_page`\n\nThis tool accepts an exact stable ID, resolves it in the combined catalog, and fetches its `markdownUrl`. It returns the complete document as text. An unknown ID or failed upstream request produces an MCP tool error.\n\nA talk document can include its summary, event details, resource links, and transcript. The website composes that Markdown, so retrieval works the same way for a talk, post, or infrastructure page.\n\n### `list_pages`\n\nThis tool accepts a single asynchronous JavaScript arrow function. The function can read the combined `pages` array to filter by locale or type, match titles, compare dates, count records, or group metadata. It does not search document bodies.\n\nFor example, this query returns the five most recent dated English posts with the fields needed for retrieval and citation:\n\n```js\nasync () => pages\n  .filter(page => page.locale === 'en' && page.type === 'post' && page.date)\n  .sort((a, b) => b.date.localeCompare(a.date))\n  .slice(0, 5)\n  .map(({ id, title, date, url }) => ({ id, title, date, url }))\n```\n\nReturning only the relevant records and fields reduces how much metadata enters the model's context. Both discovery tools return IDs that `get_page` can resolve.\n\n## Isolated code execution\n\n`list_pages` uses Code Mode to answer metadata questions without a separate tool for every filter or aggregation. Acorn parses the submitted code and checks that it is one asynchronous arrow function. Input is limited to 20,000 characters.\n\nWorker Loader runs the function in a temporary Worker with a recursively frozen copy of `pages`. The Worker has no secrets, storage, or application bindings. Network access is disabled with `globalOutbound: null`, and the executor also disables `fetch`, `WebSocket`, and `EventSource`.\n\nExecution has a 50 ms CPU limit and permits no subrequests. The function must return a JSON-serializable value, and the server rejects results larger than 256 KiB. Query failures become tool errors rather than failing the MCP request handler.\n\n## Deployment and observability\n\nWrangler deploys the server to Cloudflare Workers with an AI Search namespace binding and a Worker Loader binding. The MCP handler uses a configurable allowed CORS origin.\n\nCloudflare persists logs and traces. Sentry captures exceptions, with user information and HTTP body collection disabled. Evlog records request duration, tool outcomes, selected upstream timings, result counts, and response sizes. Submitted query code is not logged. Redaction rules cover input and output payloads, queries, document content, excerpts, Markdown, authorization headers, and cookies.\n\n## Ecosystem\n\n::infra-ecosystem\n::\n",{"title":800,"description":1140},{"loc":1195},"infra\u002Fservices\u002Fmcp-soubiran-dev","J1HgAzkigYvVb7k-sqa2CTdzeO4bcUiTSlYJMi4h7hI",{"id":1202,"title":119,"body":1203,"contentId":1339,"description":1340,"ecosystem":1341,"extension":16,"meta":1379,"navigation":18,"part":15,"path":118,"rawbody":1380,"repository":1351,"robots":15,"schemaOrg":15,"seo":1381,"sitemap":1382,"stem":1383,"url":1209,"__hash__":1384},"pages\u002Finfra\u002Fservices\u002Fredeploy-soubiran-dev.md",{"type":7,"value":1204,"toc":1333},[1205,1212,1223,1227,1234,1237,1240,1244,1255,1258,1269,1276,1296,1303,1307,1314,1317,1329,1331],[32,1206,1207,1211],{},[35,1208,119],{"href":1209,"rel":1210},"https:\u002F\u002Fredeploy.soubiran.dev",[39]," coordinates builds that depend on files published by another Cloudflare Worker. A GitHub Actions workflow sends the upstream Worker name and a downstream deploy hook. The service waits for the upstream deployment to reach production, then calls the hook.",[32,1213,1214,1215,1217,1218,1220,1221,214],{},"This keeps build-time dependencies in order across separate repositories. ",[35,1216,28],{"href":191}," must read current metadata from ",[35,1219,44],{"href":43},", while the personal website must read current talk metadata from ",[35,1222,862],{"href":861},[58,1224,1226],{"id":1225},"why-coordination-happens-outside-github-actions","Why coordination happens outside GitHub Actions",[32,1228,1229,1230,1233],{},"A push starts GitHub Actions and Cloudflare Builds independently. The source workflow knows that a commit reached ",[79,1231,1232],{},"main",", but it does not know when Cloudflare has promoted the resulting Worker version to production. Calling the dependent deploy hook immediately could start a build against the previous metadata.",[32,1235,1236],{},"I put that wait in one service instead of copying Cloudflare API checks into each repository. This fits projects that deploy independently but share a build-time data contract. Each source repository only declares what Worker must finish and which build should follow.",[32,1238,1239],{},"Cloudflare Workflows owns the long-running part. The request handler validates the input, creates a Workflow instance, and responds without holding the HTTP request open. The Workflow can retry deployment checks and retain its execution state independently of the caller.",[58,1241,1243],{"id":1242},"how-a-redeployment-flows","How a redeployment flows",[32,1245,812,1246,1254],{},[35,1247,1250,1253],{"href":1248,"rel":1249},"https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fredeploy.soubiran.dev\u002Fblob\u002Fmain\u002Fsrc\u002Findex.ts",[39],[79,1251,1252],{},"POST \u002Furl"," handler"," accepts a deploy hook URL and an optional Worker name. When the Worker name is absent, the Workflow calls the hook without waiting. Production callers include it because they need deployment ordering.",[32,1256,1257],{},"For a coordinated request, the Workflow first checks for another running instance with the same Worker and deploy hook. It hashes the hook URL when it builds the instance identifier, so it can reject duplicate work without putting the secret URL in that identifier.",[32,1259,812,1260,1268],{},[35,1261,1264,1267],{"href":1262,"rel":1263},"https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fredeploy.soubiran.dev\u002Fblob\u002Fmain\u002Fsrc\u002Fworkers.ts",[39],[79,1265,1266],{},"waitForLatestWorkersDeployment"," check"," compares two views from the Cloudflare API. It reads the latest build for the Worker and the build attached to its latest production deployment. The step succeeds only when the latest build completed successfully and both records point to the same build. Until then, Cloudflare Workflows retries the step.",[32,1270,1271,1272,1275],{},"Once those records match, the Workflow sends a ",[79,1273,1274],{},"POST"," request to the supplied deploy hook. The current flows are:",[1277,1278,1279,1289],"ul",{},[1280,1281,1282,1283,1285,1286,1288],"li",{},"A push to ",[79,1284,44],{}," waits for its Worker, then rebuilds ",[79,1287,28],{}," so website content, infrastructure documentation, and API data stay aligned.",[1280,1290,1282,1291,1285,1293,1295],{},[79,1292,862],{},[79,1294,44],{}," with the new talk catalog.",[32,1297,1298,1299,1302],{},"The initial ",[79,1300,1301],{},"OK"," response confirms that the Workflow started. The Workflow execution records whether the later deployment check and deploy hook succeeded.",[58,1304,1306],{"id":1305},"access-and-operations","Access and operations",[32,1308,1309,1310,1313],{},"Cloudflare Access protects the endpoint with service tokens stored as GitHub Actions secrets. The Worker does not duplicate that authentication check. Callers also send an ",[79,1311,1312],{},"x-service"," header, which identifies the source repository in logs but does not grant access.",[32,1315,1316],{},"The deploy hook URL stays inside the Workflow payload. Structured events record its host and a redacted path, then connect the incoming request ID, caller name, Workflow instance, checked deployment, and hook result. This gives each cross-project deployment one trace without writing the hook secret to logs.",[32,1318,812,1319,1324,1325,1328],{},[35,1320,1323],{"href":1321,"rel":1322},"https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fredeploy.soubiran.dev\u002Fblob\u002Fmain\u002Fwrangler.jsonc",[39],"Wrangler configuration"," maps the custom domain to the Worker and binds the ",[79,1326,1327],{},"RedeploySoubiranDev"," Workflow class. Wrangler deploys both pieces together. GitHub Actions runs ESLint on pushes and pull requests. Cloudflare stores Workflow execution state and exposes the resulting events through its observability tools.",[58,1330,127],{"id":126},[129,1332],{},{"title":10,"searchDepth":11,"depth":11,"links":1334},[1335,1336,1337,1338],{"id":1225,"depth":11,"text":1226},{"id":1242,"depth":11,"text":1243},{"id":1305,"depth":11,"text":1306},{"id":126,"depth":11,"text":127},"867adb28-d1d1-4017-adca-ffe1972b5f19","The deployment coordinator that waits for an upstream Cloudflare Worker to reach production before it triggers a dependent build.",[1342,1373,1375,1377],{"type":759,"name":722,"description":1343,"ecosystem":1344},"Authenticate deployment requests before they reach the Worker.",[1345],{"type":141,"id":1346,"name":764,"description":1347,"ecosystem":1348},"redeploy-soubiran-dev","Validate each request and start its deployment workflow.",[1349,1361],{"type":146,"id":119,"name":147,"description":1350,"href":1351,"ecosystem":1352},"Host the public Worker source and deployment configuration.","https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fredeploy.soubiran.dev",[1353,1357,1359],{"type":152,"name":1354,"description":1355,"href":1356},"Cloudflare SDK","Read Worker build and production deployment state from the Cloudflare API.","https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fcloudflare-typescript",{"type":152,"name":780,"description":1358,"href":781},"Correlate the incoming request with its Workflow execution.",{"type":152,"name":777,"description":1360,"href":1148},"Configure and deploy the Worker and Workflow binding.",{"type":783,"relationship":188,"name":213,"description":1362,"ecosystem":1363},"Wait for the upstream deployment and invoke the dependent deploy hook.",[1364],{"type":1365,"relationship":188,"name":1366,"description":1367,"ecosystem":1368},"ci\u002Fcd","Cloudflare deploy hooks","Start the dependent build after the upstream Worker reaches production.",[1369,1371],{"type":177,"relationship":188,"name":28,"description":1370},"Rebuild after infrastructure or personal website content changes.",{"type":185,"relationship":188,"name":44,"description":1372},"Rebuild after new talk metadata reaches production.",{"type":185,"name":44,"description":1374},"Request an API rebuild after publishing personal website content or infrastructure documentation.",{"type":185,"name":862,"description":1376},"Request a personal website rebuild after publishing talk metadata.",{"type":786,"name":787,"description":1378},"Route `redeploy.soubiran.dev` to the Worker.",{},"---\ncontentId: 867adb28-d1d1-4017-adca-ffe1972b5f19\ntitle: redeploy.soubiran.dev\ndescription: >-\n  The deployment coordinator that waits for an upstream Cloudflare Worker to\n  reach production before it triggers a dependent build.\nurl: 'https:\u002F\u002Fredeploy.soubiran.dev'\nrepository: 'https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fredeploy.soubiran.dev'\necosystem:\n  - type: auth\n    name: Cloudflare One\n    description: Authenticate deployment requests before they reach the Worker.\n    ecosystem:\n      - type: deployment\n        id: redeploy-soubiran-dev\n        name: Cloudflare Workers\n        description: Validate each request and start its deployment workflow.\n        ecosystem:\n          - type: repository\n            id: redeploy.soubiran.dev\n            name: GitHub\n            description: Host the public Worker source and deployment configuration.\n            href: 'https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fredeploy.soubiran.dev'\n            ecosystem:\n              - type: stack\n                name: Cloudflare SDK\n                description: Read Worker build and production deployment state from the Cloudflare API.\n                href: 'https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fcloudflare-typescript'\n              - type: stack\n                name: Evlog\n                description: Correlate the incoming request with its Workflow execution.\n                href: 'https:\u002F\u002Fevlog.dev'\n              - type: stack\n                name: Wrangler\n                description: Configure and deploy the Worker and Workflow binding.\n                href: 'https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fwrangler\u002F'\n          - type: workflows\n            relationship: consumer\n            name: Cloudflare Workflows\n            description: Wait for the upstream deployment and invoke the dependent deploy hook.\n            ecosystem:\n              - type: ci\u002Fcd\n                relationship: consumer\n                name: Cloudflare deploy hooks\n                description: Start the dependent build after the upstream Worker reaches production.\n                ecosystem:\n                  - type: service\n                    relationship: consumer\n                    name: api.soubiran.dev\n                    description: Rebuild after infrastructure or personal website content changes.\n                  - type: website\n                    relationship: consumer\n                    name: soubiran.dev\n                    description: Rebuild after new talk metadata reaches production.\n  - type: website\n    name: soubiran.dev\n    description: Request an API rebuild after publishing personal website content or infrastructure documentation.\n  - type: website\n    name: talks.soubiran.dev\n    description: Request a personal website rebuild after publishing talk metadata.\n  - type: domain\n    name: Cloudflare Domains\n    description: Route `redeploy.soubiran.dev` to the Worker.\n---\n\n[redeploy.soubiran.dev](https:\u002F\u002Fredeploy.soubiran.dev) coordinates builds that depend on files published by another Cloudflare Worker. A GitHub Actions workflow sends the upstream Worker name and a downstream deploy hook. The service waits for the upstream deployment to reach production, then calls the hook.\n\nThis keeps build-time dependencies in order across separate repositories. [api.soubiran.dev](\u002Finfra\u002Fservices\u002Fapi-soubiran-dev) must read current metadata from [soubiran.dev](\u002Finfra\u002Fwebsites\u002Fsoubiran-dev), while the personal website must read current talk metadata from [talks.soubiran.dev](\u002Finfra\u002Fwebsites\u002Ftalks-soubiran-dev).\n\n## Why coordination happens outside GitHub Actions\n\nA push starts GitHub Actions and Cloudflare Builds independently. The source workflow knows that a commit reached `main`, but it does not know when Cloudflare has promoted the resulting Worker version to production. Calling the dependent deploy hook immediately could start a build against the previous metadata.\n\nI put that wait in one service instead of copying Cloudflare API checks into each repository. This fits projects that deploy independently but share a build-time data contract. Each source repository only declares what Worker must finish and which build should follow.\n\nCloudflare Workflows owns the long-running part. The request handler validates the input, creates a Workflow instance, and responds without holding the HTTP request open. The Workflow can retry deployment checks and retain its execution state independently of the caller.\n\n## How a redeployment flows\n\nThe [`POST \u002Furl` handler](https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fredeploy.soubiran.dev\u002Fblob\u002Fmain\u002Fsrc\u002Findex.ts) accepts a deploy hook URL and an optional Worker name. When the Worker name is absent, the Workflow calls the hook without waiting. Production callers include it because they need deployment ordering.\n\nFor a coordinated request, the Workflow first checks for another running instance with the same Worker and deploy hook. It hashes the hook URL when it builds the instance identifier, so it can reject duplicate work without putting the secret URL in that identifier.\n\nThe [`waitForLatestWorkersDeployment` check](https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fredeploy.soubiran.dev\u002Fblob\u002Fmain\u002Fsrc\u002Fworkers.ts) compares two views from the Cloudflare API. It reads the latest build for the Worker and the build attached to its latest production deployment. The step succeeds only when the latest build completed successfully and both records point to the same build. Until then, Cloudflare Workflows retries the step.\n\nOnce those records match, the Workflow sends a `POST` request to the supplied deploy hook. The current flows are:\n\n- A push to `soubiran.dev` waits for its Worker, then rebuilds `api.soubiran.dev` so website content, infrastructure documentation, and API data stay aligned.\n- A push to `talks.soubiran.dev` waits for its Worker, then rebuilds `soubiran.dev` with the new talk catalog.\n\nThe initial `OK` response confirms that the Workflow started. The Workflow execution records whether the later deployment check and deploy hook succeeded.\n\n## Access and operations\n\nCloudflare Access protects the endpoint with service tokens stored as GitHub Actions secrets. The Worker does not duplicate that authentication check. Callers also send an `x-service` header, which identifies the source repository in logs but does not grant access.\n\nThe deploy hook URL stays inside the Workflow payload. Structured events record its host and a redacted path, then connect the incoming request ID, caller name, Workflow instance, checked deployment, and hook result. This gives each cross-project deployment one trace without writing the hook secret to logs.\n\nThe [Wrangler configuration](https:\u002F\u002Fgithub.com\u002Fbarbapapazes\u002Fredeploy.soubiran.dev\u002Fblob\u002Fmain\u002Fwrangler.jsonc) maps the custom domain to the Worker and binds the `RedeploySoubiranDev` Workflow class. Wrangler deploys both pieces together. GitHub Actions runs ESLint on pushes and pull requests. Cloudflare stores Workflow execution state and exposes the resulting events through its observability tools.\n\n## Ecosystem\n\n::infra-ecosystem\n::\n",{"title":119,"description":1340},{"loc":118},"infra\u002Fservices\u002Fredeploy-soubiran-dev","IEM-ieE7kGruOuiR7UP0bljK4-xBRb_h3uCCT9jhiOI",1795016708781]