<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by CloudHike Team on Medium]]></title>
        <description><![CDATA[Stories by CloudHike Team on Medium]]></description>
        <link>https://medium.com/@cloudhike?source=rss-7d765af62d23------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*esciMc-503RiYtwCcvzRTA.png</url>
            <title>Stories by CloudHike Team on Medium</title>
            <link>https://medium.com/@cloudhike?source=rss-7d765af62d23------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 02:13:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cloudhike/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Send email from your own domain: DKIM, SPF and DMARC, reply-to, and scheduled reminders]]></title>
            <link>https://medium.com/@cloudhike/send-email-from-your-own-domain-dkim-spf-and-dmarc-reply-to-and-scheduled-reminders-8efe22103037?source=rss-7d765af62d23------2</link>
            <guid isPermaLink="false">https://medium.com/p/8efe22103037</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[email-marketing]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[CloudHike Team]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 20:44:09 GMT</pubDate>
            <atom:updated>2026-11-16T20:50:02.318Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ivZTQmyT7M3F9Sub.png" /></figure><p><em>This is week 6 of </em><strong><em>Build with CloudHike</em></strong><em>, a weekly series where we build a small, real-world app with an AI coding agent and let </em><a href="https://cloudhike.dev?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w6"><em>CloudHike</em></a><em> handle the backend.</em></p><p>New here? <a href="https://dev.to/cloudhike/build-a-referral-waitlist-with-your-ai-agent-postgres-auth-redis-and-email-over-one-mcp-1o5f">Week 1</a> built a referral waitlist, <a href="https://dev.to/cloudhike/build-an-ai-summarizer-with-background-jobs-retries-signed-webhooks-and-postgres-over-one-mcp-1c3k">week 2</a> moved slow AI work into background jobs, <a href="https://dev.to/cloudhike/build-a-file-sharing-app-with-presigned-uploads-storage-auth-and-postgres-over-one-mcp-connection-lbo">week 3</a> built a file-sharing app with presigned uploads, <a href="https://dev.to/cloudhike/same-backend-any-agent-connect-codex-vs-code-windsurf-and-gemini-cli-to-one-cloudhike-project-1khp">week 4</a> connected every major AI editor to one project, and <a href="https://dev.to/cloudhike/build-a-members-only-saas-with-real-auth-flows-email-verification-password-reset-github-and-1j2c">week 5</a> built a members-only SaaS with verified sign-up, password reset, and GitHub and Google sign-in. Each post stands on its own, so you can start right here.</p><p>Week 1 already sent a “you’re #N” confirmation from a CloudHike address. That’s the easy case: one API call, no SMTP, and mail goes out. The moment those messages are part of a real product, the list gets longer. The From line should be your domain, not &lt;project&gt;@cloudhike.dev. Replies should land in an inbox you actually read. A reminder should go out later, and you should be able to cancel it if the person already finished. And when something bounces, you need a log that shows what happened, without storing the body of every message.</p><p>Usually that list means an ESP account, a DNS worksheet, and a second provider if you also want to schedule sends. This week your agent deploys <strong>CloudHike Email</strong> over MCP, you verify a subdomain under <strong>Email → Domains</strong>, and you build the rest with copy-paste prompts.</p><p>Every endpoint, field and setting below comes from the live <a href="https://cloudhike.dev/docs/email?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w6">Email docs</a>, <a href="https://cloudhike.dev/docs/mcp?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w6">MCP docs</a> and <a href="https://cloudhike.dev/legal/email-policy?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w6">email acceptable use policy</a>.</p><h4>What we’re building</h4><p>A Next.js app called receipt-desk that sends transactional mail from a domain you own:</p><ul><li><strong>A receipt form</strong>: type an address and send a short “thanks for your order” email from server code</li><li><strong>A first send from CloudHike.dev</strong>, with replyTo set, so you can test before any DNS work</li><li><strong>A verified subdomain</strong> such as mail.yourdomain.com, with the DKIM, SPF and DMARC records the Email page lists</li><li><strong>The same receipt, from your domain</strong>, using from, fromName and replyTo</li><li><strong>A scheduled reminder</strong> with scheduledAt (an ISO time up to 7 days ahead), which answers <strong>202</strong> and an id you can cancel</li><li><strong>The Logs and Overview tabs</strong>, so you can see who each message went to and what happened</li><li><strong>An optional hook-up to Auth</strong>: once the domain is verified, verification and password-reset emails can come from an address on it</li></ul><p>Here’s how it maps to CloudHike:</p><ul><li><strong>Email</strong> (EMAIL_API_URL, EMAIL_API_KEY). A plain HTTP API for transactional sends, scheduled sends and cancellations. Keep the key on your server: anyone with it can send as your project</li><li><strong>Your own domain</strong>, verified under Email → Domains, or, if you leave from out, mail from &lt;project&gt;@cloudhike.dev</li><li><strong>No SMTP</strong> to configure, and no message bodies stored (a scheduled message is held only until it is sent or cancelled)</li></ul><h4>What you need</h4><ul><li>A CloudHike account. Every new account gets <strong>$10 in free credits</strong> (eligible accounts, once per inbox, valid for 90 days), plus an extra $5 with the code <strong>TUBEGURUJI5</strong>, and no card is needed. The Free plan allows 2 projects, 1 custom email domain, 100 emails per 24 hours and 3,000 a month, which is plenty for this.</li><li>Cursor or Claude Code (Codex, VS Code, Windsurf and Gemini CLI work too; see <a href="https://dev.to/cloudhike/same-backend-any-agent-connect-codex-vs-code-windsurf-and-gemini-cli-to-one-cloudhike-project-1khp">week 4</a>).</li><li>Node.js, for a Next.js app.</li><li>A domain you own or are authorized to use, so you can add the DNS records the Email page shows.</li><li>An inbox you can read, to receive the test receipt and reminder, and a reply-to address you actually check.</li></ul><h4>Step 1: Connect CloudHike to your agent (once)</h4><p>In the CloudHike dashboard, open <strong>Connect MCP</strong> in the sidebar ( https://cloudhike.dev/dashboard/coding-agent), pick your editor and click <strong>Copy with key</strong>. That creates your workspace API key the first time and gives you a snippet with the key already filled in. The server is remote (Streamable HTTP), so there&#39;s nothing to install.</p><p><strong>Claude Code</strong></p><pre>claude mcp add --transport http --scope user cloudhike https://cloudhike.dev/api/mcp \<br>  --header &quot;Authorization: Bearer icu_your_api_key&quot;</pre><p>Run /mcp inside Claude Code to check that it&#39;s connected.</p><p><strong>Cursor (~/.cursor/mcp.json)</strong></p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;cloudhike&quot;: {<br>      &quot;url&quot;: &quot;https://cloudhike.dev/api/mcp&quot;,<br>      &quot;headers&quot;: {<br>        &quot;Authorization&quot;: &quot;Bearer icu_your_api_key&quot;<br>      }<br>    }<br>  }<br>}</pre><p>Open Cursor Settings → MCP and look for the green dot. Snippets for Codex, VS Code, Windsurf, Gemini CLI and Claude Desktop are in the <a href="https://cloudhike.dev/docs/mcp?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w6">MCP docs</a>.</p><p>Treat the key like a password: keep it in your home folder, not the repo. <strong>Revoke</strong> on the Connect MCP page disconnects every editor at once.</p><h4>Step 2: Scaffold the app</h4><pre>npx create-next-app@latest receipt-desk<br>cd receipt-desk</pre><p>Open the folder in Cursor, or run claude in it.</p><h4>Step 3: Let the agent deploy Email</h4><p>Paste:</p><blockquote><em>Use the cloudhike MCP tools to set up the backend for this app. It’s a Next.js app that sends transactional email: a receipt and a scheduled reminder.</em></blockquote><blockquote><em>Create a CloudHike project called “receipt-desk”. Deploy email and wait until it’s ready. Put the .env into .env.local, make sure it’s git-ignored, and don’t show me any secret values. Then call get_docs for “email” and summarise the send API, the request fields, how scheduledAt and cancel work, and how to send from a verified domain. Don’t write app code yet. Tell me which services are running and which variable names are in .env.local.</em></blockquote><p>Behind the scenes that’s create_project, deploy_services with email, wait_for_services, get_environment written straight into .env.local, and get_docs for the Email page as Markdown. You should end up with EMAIL_API_URL and EMAIL_API_KEY.</p><p>The Email service is for transactional mail only, and deploying it means you agree to CloudHike’s <a href="https://cloudhike.dev/legal/email-policy?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w6">email acceptable use policy</a>. The docs also describe ticking the box on the Email card and clicking <strong>Deploy</strong>. If the agent says Email couldn’t be deployed, do that in the dashboard and ask the agent to fetch the .env again.</p><p>What those two values are for, straight from the docs:</p><ul><li>EMAIL_API_URL: the base address of your project&#39;s email API. <strong>Server only.</strong></li><li>EMAIL_API_KEY: sent as the x-api-key header. <strong>Server only.</strong> Anyone with it can send as your project.</li></ul><h4>Step 4: Send a first receipt from cloudhike.dev</h4><p>You can send before any DNS work. Left out, from is &lt;project&gt;@cloudhike.dev. The docs say to set replyTo when you send from that shared domain, so replies have somewhere to go.</p><p>Here’s the send call from the docs, which we’ll wrap in a small form:</p><pre>const res = await fetch(`${process.env.EMAIL_API_URL}/send`, {<br>  method: &quot;POST&quot;,<br>  headers: {<br>    &quot;content-type&quot;: &quot;application/json&quot;,<br>    &quot;x-api-key&quot;: process.env.EMAIL_API_KEY!,<br>  },<br>  body: JSON.stringify({<br>    to: &quot;customer@example.com&quot;,<br>    subject: &quot;Your receipt&quot;,<br>    html: &quot;&lt;p&gt;Thanks for your order.&lt;/p&gt;&quot;,<br>    text: &quot;Thanks for your order.&quot;,<br>    from: &quot;receipts@acme.com&quot;,   // optional, needs acme.com verified<br>    fromName: &quot;Acme&quot;,<br>    replyTo: &quot;support@acme.com&quot;,<br>  }),<br>});<br>const { results } = await res.json(); // [{ to, id, status }]</pre><p>For this step, leave from out so the project address is used. Paste:</p><blockquote><em>Using only what the email page from get_docs describes, build a receipt form in this Next.js app, with every CloudHike call in server code:</em></blockquote><ul><li>lib/email.ts: a sendEmail helper that POSTs to {EMAIL_API_URL}/send with the header x-api-key set to EMAIL_API_KEY and content-type application/json. It accepts to, subject, html, text, and optional from, fromName, replyTo and scheduledAt. It returns the JSON body and the HTTP status. Do not log or return EMAIL_API_KEY.</li><li>A page at / with to, subject and a short message, plus a reply-to field that defaults to a REPLY_TO env variable (add REPLY_TO to .env.local, and the name only to .env.example). Posting the form calls POST /api/send-receipt, which uses sendEmail. For now, do not send a from address, so mail goes from the project’s CloudHike.dev address. Always set replyTo. Send both html and text. If the API answers 429, read the Retry-After header, do not retry in a loop, and show that the send was rate limited.</li><li>After a send, show the id and status from results (the docs describe results as [{ to, id, status }]). Keep EMAIL_API_URL and EMAIL_API_KEY out of any client bundle: no NEXT_PUBLIC_ prefix.</li></ul><p>Try it with an inbox you can read. You should see the mail come from &lt;project&gt;@cloudhike.dev, and a reply should go to the address you set as replyTo. Then open the project, click the Email card, and check the <strong>Logs</strong> tab: it shows who each message went to and what happened. Message bodies are never stored.</p><p>The fields you’re allowed to send, still from the docs:</p><ul><li>to: one address or an array. Each recipient counts as one email.</li><li>subject: up to 200 characters, no line breaks.</li><li>html and text: send either or both, up to 256 KB each.</li><li>from: any address on one of the project&#39;s verified domains. Left out, mail goes from &lt;project&gt;@cloudhike.dev.</li><li>fromName: display name, 1 to 60 characters, with no address or link in it.</li><li>replyTo: where replies go. Set it when sending from cloudhike.dev.</li><li>scheduledAt: ISO time up to 7 days ahead. Answers 202. We&#39;ll use this in Step 6.</li></ul><h4>Step 5: Verify a subdomain under Email → Domains</h4><p>Sending from mail.yourdomain.com (or any domain you add) is a dashboard and DNS step, not an MCP tool. A subdomain such as mail.acme.com keeps email reputation apart from your main domain, which is what the docs recommend.</p><p>Open the project, open the <strong>Email</strong> page, go to <strong>Domains</strong> and add your domain. Then:</p><ol><li>Add the records it lists at your DNS provider: <strong>three DKIM CNAME records</strong> (required), an <strong>MX</strong> and an <strong>SPF TXT</strong> record on bounce.&lt;domain&gt;, and a <strong>DMARC TXT</strong> record (recommended). Use the values on that page, not a guess.</li><li>Click <strong>Verify now</strong>, or wait: CloudHike checks every few minutes for 72 hours. Each record shows whether it was found.</li><li>Once the domain shows <strong>Verified</strong>, you can send with from set to any address on it, such as receipts@mail.yourdomain.com if you verified mail.yourdomain.com.</li></ol><p>Free accounts can add 1 domain, Pro accounts 5 and Scale accounts 20, across all projects. If the DKIM records are removed later, the domain is marked failed and sending from it stops until you verify it again. Removing the records or the domain also stops scheduled email from that domain.</p><p>Add the address you’ll send from to .env.local as FROM_EMAIL (and the name only to .env.example), then paste:</p><blockquote><em>The domain is now verified. Update /api/send-receipt so it sends from FROM_EMAIL when that env variable is set, and sets fromName to a short display name with no address or link in it (for example “Receipt Desk”, at most 60 characters). Keep replyTo. If FROM_EMAIL is missing, leave from out and still set replyTo, as in Step 4. Don’t put FROM_EMAIL in the browser bundle.</em></blockquote><p>Send another receipt to yourself. The From line should now be your domain. Replies still go to replyTo.</p><h4>Step 6: Schedule a reminder, then cancel it</h4><p>scheduledAt is an ISO time up to 7 days ahead. The send call answers <strong>202</strong>, and the usual results array still gives you an id. To cancel that send: POST {EMAIL_API_URL}/emails/&lt;id&gt;/cancel. A scheduled message&#39;s body is held only until it is sent or cancelled; everything else still follows the rule that bodies aren&#39;t stored.</p><p>Paste:</p><blockquote><em>Add a reminder flow using only the scheduledAt and cancel behaviour from the email docs:</em></blockquote><ul><li>On the same form, a second action: “Schedule reminder”. It calls POST /api/schedule-reminder, which uses sendEmail with scheduledAt set to an ISO time the user picks, no more than 7 days ahead. Subject and body should be a short transactional reminder about the same order, with html and text, from/fromName as in Step 5, and replyTo set. Show the HTTP status (the docs say a scheduled send answers 202) and the id from results.</li><li>A cancel field: paste that id and post to POST /api/cancel-reminder, which calls POST {EMAIL_API_URL}/emails/&lt;id&gt;/cancel from server code, with the same x-api-key header as /send. Show whatever status the API returns. Never accept an id from the client and then cancel it from browser code.</li></ul><p>Try it in two passes. First, schedule a reminder a few minutes ahead, wait, and see it arrive. Second, schedule another and cancel it before that time. Then check the <strong>Logs</strong> tab again for both ids.</p><h4>Step 7: Read the delivery logs, and stay transactional</h4><p>You don’t need a logs API for this. On the Email page:</p><ul><li>The <strong>Logs</strong> tab shows who each message went to and what happened. CloudHike keeps the sender, recipient, subject and delivery status so you can see them there. It does not store message bodies, except that a scheduled message is held until it is sent or cancelled.</li><li>The <strong>Overview</strong> tab charts each day’s delivered, bounced and failed mail, and your bounce and complaint rates.</li></ul><p>A few rules from the docs and the policy are worth treating as part of the build, not as fine print:</p><ul><li><strong>Transactional only.</strong> Sign-in links, password resets, receipts, alerts, invoices, and notifications someone turned on are in bounds. Marketing, newsletters, promotions or any bulk mail are not, even to people who opted in.</li><li><strong>Each recipient counts as one email.</strong> to can be one address or an array, but Free allows 3 recipients per request (50 on Pro).</li><li><strong>Over a limit</strong>, the API answers <strong>429</strong> with a Retry-After header. That&#39;s why the form in Step 4 doesn&#39;t retry in a loop.</li><li><strong>Addresses that bounce for good or report spam are never mailed again.</strong></li><li><strong>Sending pauses</strong> for a project whose mail bounces 3% or is reported as spam 0.3% of the time over 7 days. A pause holds email for every project on the account, including new ones, until support reviews it.</li><li><strong>A monthly spend cap</strong> under Settings limits what you can spend. On Pro, emails sent above the monthly allowance are charged from your credits every hour; refused, failed and cancelled messages are free.</li></ul><h4>Step 8 (optional): Send Auth emails from the same domain</h4><p>If you already have Auth in this project from <a href="https://dev.to/cloudhike/build-a-members-only-saas-with-real-auth-flows-email-verification-password-reset-github-and-1j2c">week 5</a>, you don’t need a second email provider for verification and password-reset mail. On the Auth page’s <strong>Emails</strong> tab you can change the sender name, <strong>send from an address on a domain you have verified under Email → Domains</strong>, set a reply-to address, and edit the wording of those emails with a live preview and a test send.</p><p>That’s the same verified domain as Step 5. Auth still sends those messages itself; you don’t call /send for them.</p><h4>Step 9: Ship it</h4><p>On Vercel (or any host), add EMAIL_API_URL, EMAIL_API_KEY, REPLY_TO and FROM_EMAIL in the project settings. In the CloudHike dashboard, <strong>Environment → Copy as .env</strong> gives you the whole file. Then:</p><ul><li><strong>Keep the API key on the server.</strong> Don’t prefix it with NEXT_PUBLIC_, don&#39;t ship it to a mobile app, and don&#39;t commit .env.local.</li><li><strong>Leave the DNS records in place.</strong> If the DKIM records disappear, the domain is marked failed and sending from it stops, including scheduled mail, until you verify it again.</li><li><strong>Stay transactional</strong> in production the same way you did in development. The acceptable use policy you agreed to when Email was deployed still applies on your own domain.</li><li><strong>Set a monthly spend cap</strong> under Settings if you want a hard ceiling, or an alert amount if you only want a warning.</li><li><strong>Testing without touching production.</strong> Every project can add a development environment from the switcher under the project name, with its own services, keys and .env. MCP tools take an environment argument for it.</li></ul><h4>What CloudHike handled</h4><p>Look back at what you didn’t do: you didn’t open an ESP account, write raw DKIM records from memory, stand up SMTP, or store a copy of every message body. One MCP connection and one Email page gave you:</p><ul><li><strong>transactional sends</strong> as a plain HTTP API, from &lt;project&gt;@cloudhike.dev with no setup,</li><li><strong>your own domain</strong>, verified with the DKIM, SPF and DMARC records listed under Email → Domains,</li><li><strong>from, </strong><strong>fromName and </strong><strong>replyTo</strong>, so the message looks like it comes from you and replies land in your inbox,</li><li><strong>scheduledAt reminders</strong> up to 7 days ahead, with a cancel call for an id,</li><li><strong>Logs and Overview</strong>, with bodies left out of storage,</li><li>a hard line that this is <strong>transactional mail only</strong>, with bounce and complaint pauses that protect the shared sending reputation.</li></ul><p>On cost: Free includes 100 emails per 24 hours, 3,000 a month, 10 a minute, 3 recipients per request and 1 custom domain. Pro has no daily or monthly cap, 300 emails a minute, 50 recipients per request and 5 custom domains; Scale has 1,000 emails a minute and 20 custom domains. On Pro and Scale, 3,000 emails a month per project are included, then $0.40 per 1,000 (each recipient counts as one). Everything comes out of one credit balance. If you outgrow Free, <strong>Pro is $10/month with $10 of usage credits included every month and 10 projects</strong>, and Scale is $29.99/month with unlimited projects. The details are on the <a href="https://cloudhike.dev/docs/plans-and-billing?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w6">plans and billing page</a>.</p><h4>Your turn</h4><p>Run the prompts in order: Step 3 to deploy, Step 4 to send from cloudhike.dev, the Step 5 DNS clicks, then Steps 6 and 7 for reminders and logs. Then try to break it: send a receipt to yourself and hit reply, schedule a reminder and cancel it, remove FROM_EMAIL temporarily and confirm mail falls back to the CloudHike.dev address, open Logs and Overview after each send.</p><p>👉 <a href="https://cloudhike.dev/?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w6"><strong>Start free at cloudhike.dev</strong></a>. You get $10 in credits at signup, plus $5 more with code TUBEGURUJI5, no card required.</p><p>Next week: <strong>let your agent explore your data safely</strong>. We’ll use the database explorer, list_tables, describe_table and read-only query_database, look at Pro&#39;s execute_sql with editor approval and the audit log, and go over nightly backups and restore. Follow along so you don&#39;t miss it.</p><p>If you try this one, tell me in the comments whether the first send from your own domain landed, and whether scheduling or cancel was the step that needed a second prompt. I read every comment.</p><p><em>Originally published at </em><a href="https://cloudhike.hashnode.dev/send-email-from-your-own-domain-dkim-spf-and-dmarc-reply-to-and-scheduled-reminders"><em>https://cloudhike.hashnode.dev</em></a><em> on November 16, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8efe22103037" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a members-only SaaS with real auth flows: email verification, password reset, GitHub and…]]></title>
            <link>https://medium.com/@cloudhike/build-a-members-only-saas-with-real-auth-flows-email-verification-password-reset-github-and-0ca8a5f65455?source=rss-7d765af62d23------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ca8a5f65455</guid>
            <category><![CDATA[model-context-protocol]]></category>
            <category><![CDATA[ai-coding]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[authentication]]></category>
            <dc:creator><![CDATA[CloudHike Team]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 14:28:26 GMT</pubDate>
            <atom:updated>2026-11-16T14:38:05.802Z</atom:updated>
            <content:encoded><![CDATA[<h3>Build a members-only SaaS with real auth flows: email verification, password reset, GitHub and Google sign-in</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*1lVQZBT6VSYcOgAw.png" /></figure><p><em>This is week 5 of</em> <strong><em>Build with CloudHike</em></strong><em>, a weekly series where we build a small, real-world app with an AI coding agent and let </em><a href="https://cloudhike.dev?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=build_series_w5"><em>CloudHike</em></a><em> handle the backend.</em></p><p>New here? <a href="https://dev.to/cloudhike/build-a-referral-waitlist-with-your-ai-agent-postgres-auth-redis-and-email-over-one-mcp-1o5f">Week 1</a> built a referral waitlist, <a href="https://dev.to/cloudhike/build-an-ai-summarizer-with-background-jobs-retries-signed-webhooks-and-postgres-over-one-mcp-1c3k">week 2</a> moved slow AI work into background jobs, <a href="https://dev.to/cloudhike/build-a-file-sharing-app-with-presigned-uploads-storage-auth-and-postgres-over-one-mcp-connection-lbo">week 3</a> built a file-sharing app with presigned uploads, and <a href="https://dev.to/cloudhike/same-backend-any-agent-connect-codex-vs-code-windsurf-and-gemini-cli-to-one-cloudhike-project-1khp">week 4</a> connected every major AI editor to one project. Each post stands on its own, so you can start right here.</p><p>Week 1 used Auth for exactly one person: you, on an admin page. That’s the easy case. The moment strangers can sign up, “login” turns into a list: confirm the email is real, let people reset a forgotten password, offer “Continue with GitHub” because nobody wants another password, keep the session token away from page scripts, and make sure every email link and OAuth redirect lands back on <em>your</em> site and nowhere else.</p><p>Usually that list means an auth library, an SMTP provider, and two OAuth apps registered in two developer consoles. This week your agent deploys <strong>CloudHike Auth</strong> over MCP, you flip a few switches on the Auth page, and you build all of it with copy-paste prompts.</p><p>Every endpoint, header and setting below comes from the live <a href="https://cloudhike.dev/docs/auth?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=build_series_w5">Auth docs</a> and <a href="https://cloudhike.dev/docs/mcp?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=build_series_w5">MCP docs</a>.</p><h3>What we’re building</h3><p>A Next.js app called members-club with a private /members area:</p><ul><li><strong>Email and password sign-up</strong> that requires a <strong>verified email</strong> before the first sign-in</li><li><strong>A “resend verification email” button</strong> for people who lost the first one</li><li><strong>Forgot password</strong>: a reset link by email, and a page to set a new password</li><li><strong>Continue with GitHub</strong> and <strong>Continue with Google</strong>, using CloudHike’s <strong>shared OAuth app</strong> (no OAuth app of your own to register)</li><li><strong>HTTP-only cookie sessions</strong>: the token lives in a cookie your server sets, and server code checks it on every request</li><li><strong>Sites users can return to</strong>: every verification link, reset link and OAuth redirect only goes back to sites you listed</li><li><strong>An optional </strong><strong>/admin page</strong> that lists members with the server-only secret key</li></ul><p>Here’s how it maps to CloudHike, all in one project:</p><ul><li><strong>Postgres 16</strong> (DATABASE_URL). Deployed first, so Auth keeps its users in the project&#39;s own database, in the auth schema</li><li><strong>Auth</strong> (AUTH_URL, AUTH_PUBLISHABLE_KEY, AUTH_SECRET_KEY). A plain HTTP API for sign-up, sign-in, sessions, verification, resets and social sign-in</li><li><strong>Verification and reset emails</strong> sent by CloudHike’s own sender, so there’s no SMTP to configure</li></ul><h3>What you need</h3><ul><li>A CloudHike account. Every new account gets <strong>$10 in free credits</strong> (eligible accounts, once per inbox, valid for 90 days), plus an extra $5 with the code <strong>TUBEGURUJI5</strong>, and no card is needed. The Free plan allows 2 projects and up to 10,000 registered auth users per project, which is plenty for this.</li><li>Cursor or Claude Code (Codex, VS Code, Windsurf and Gemini CLI work too; see <a href="https://dev.to/cloudhike/same-backend-any-agent-connect-codex-vs-code-windsurf-and-gemini-cli-to-one-cloudhike-project-1khp">week 4</a>).</li><li>Node.js, for a Next.js app.</li><li>A GitHub and/or Google account to test social sign-in, and an inbox you can read for the verification and reset emails.</li></ul><h3>Step 1: Connect CloudHike to your agent (once)</h3><p>In the CloudHike dashboard, open <strong>Connect MCP</strong> in the sidebar (https://cloudhike.dev/dashboard/coding-agent), pick your editor and click <strong>Copy with key</strong>. That creates your workspace API key the first time and gives you a snippet with the key already filled in. The server is remote (Streamable HTTP), so there&#39;s nothing to install.</p><p><strong>Claude Code</strong></p><pre>claude mcp add --transport http --scope user cloudhike https://cloudhike.dev/api/mcp \<br>  --header &quot;Authorization: Bearer icu_your_api_key&quot;</pre><p>Run /mcp inside Claude Code to check that it&#39;s connected.</p><p><strong>Cursor</strong> (~/.cursor/mcp.json)</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;cloudhike&quot;: {<br>      &quot;url&quot;: &quot;https://cloudhike.dev/api/mcp&quot;,<br>      &quot;headers&quot;: {<br>        &quot;Authorization&quot;: &quot;Bearer icu_your_api_key&quot;<br>      }<br>    }<br>  }<br>}</pre><p>Open Cursor Settings → MCP and look for the green dot. Snippets for Codex, VS Code, Windsurf, Gemini CLI and Claude Desktop are in the <a href="https://cloudhike.dev/docs/mcp?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=build_series_w5">MCP docs</a>.</p><p>Treat the key like a password: keep it in your home folder, not the repo. <strong>Revoke</strong> on the Connect MCP page disconnects every editor at once.</p><h3>Step 2: Scaffold the app</h3><pre>npx create-next-app@latest members-club<br>cd members-club</pre><p>Open the folder in Cursor, or run claude in it.</p><h3>Step 3: Let the agent deploy Postgres and Auth</h3><p>Paste:</p><blockquote><em>Use the cloudhike MCP tools to set up the backend for this app. It’s a members-only Next.js app: people sign up, verify their email, and then see a private /members area.</em></blockquote><blockquote><em>Create a CloudHike project called “members-club”. Deploy postgres first and wait until it’s ready, then deploy auth and wait again, so Auth keeps its users in the project’s Postgres. Put the .env into .env.local, make sure it’s git-ignored, and don’t show me any secret values. Then call get_docs for “auth” and summarise the endpoints and headers it describes. Don’t write app code yet. Tell me which services are running and which variable names are in .env.local.</em></blockquote><p>Behind the scenes that’s create_project, deploy_services (twice), wait_for_services, get_environment written straight into .env.local, and get_docs for the Auth page as Markdown. You should end up with DATABASE_URL, AUTH_URL, AUTH_PUBLISHABLE_KEY and AUTH_SECRET_KEY.</p><p>What those three Auth values are for, straight from the docs:</p><ul><li>AUTH_URL: the base address of your project&#39;s auth API. Safe in browser code.</li><li>AUTH_PUBLISHABLE_KEY: identifies your project, sent as the x-api-key header on every request. Safe in browser code.</li><li>AUTH_SECRET_KEY: unlocks the admin endpoints. <strong>Server only.</strong> Never ship it to a browser or mobile app.</li></ul><h3>Step 4: Switch on the flows in the dashboard</h3><p>Provider and email settings live on the Auth page, not in MCP. Open the project, then <strong>Open Auth</strong> on the Auth card:</p><ol><li><strong>Providers tab → Require a verified email before sign-in.</strong> Turn it on. Sign-up now sends a verification link, and sign-in returns <strong>403</strong> until the user opens it.</li><li><strong>Sites users can return to.</strong> Add each site your app runs on, one per line: your local dev address now, your production domain later. Verification links, reset links and social sign-in only ever send users back to these sites.</li><li><strong>Sign in with GitHub or Google.</strong> For each provider, pick the credential source <strong>Shared</strong>, which uses CloudHike’s own OAuth app. Later you can switch to <strong>Your own</strong> and paste the client ID and secret of an OAuth app you registered, with the callback URL shown on the card (&lt;AUTH_URL&gt;/callback/github or /callback/google).</li><li><strong>Emails tab (optional).</strong> Change the sender name, set a reply-to address, and edit the wording of the verification and password reset emails with a live preview and a test send. If you’ve verified a domain under Email → Domains, you can send from an address on it.</li></ol><p>That’s the whole “auth provider setup”. No SMTP credentials, no OAuth console, no redirect URI juggling for the shared app.</p><h3>Step 5: Email sign-up, sign-in and HTTP-only cookie sessions</h3><p>One detail from the docs shapes the whole design: <strong>the Auth API itself uses no cookies.</strong> Sign-up and sign-in return { token, user }, and you send the token as authorization: Bearer &lt;token&gt;. That&#39;s why it works from any site, a mobile app or a server. For a web app, the docs recommend storing the token <strong>in an HTTP-only cookie that your own server sets</strong>, then calling get-session from server code on each request, which keeps the token away from page scripts.</p><p>Paste:</p><blockquote><em>Using only what the auth page from get_docs describes, build email and password auth for this Next.js app, with all CloudHike calls in server code:</em></blockquote><ul><li>lib/auth.ts: small helpers that call AUTH_URL with the header x-api-key set to AUTH_PUBLISHABLE_KEY: signUp (POST /sign-up/email with name, email, password), signIn (POST /sign-in/email with email, password), getSession (GET /get-session with authorization: Bearer ) and signOut (POST /sign-out with the same bearer header). Errors come back as { message } with a status code; pass the status and message through.</li><li>Route handlers: POST /api/auth/sign-up, POST /api/auth/sign-in and POST /api/auth/sign-out. Sign-in stores the returned token in an HTTP-only cookie named “session” (Secure in production, SameSite=Lax, path /). Never return the token to page scripts. Sign-out calls /sign-out and deletes the cookie.</li><li>Email verification is required, so sign-up must NOT set the cookie. After a successful sign-up, send the user to /check-email.</li><li>lib/current-user.ts: read the “session” cookie and call get-session from server code on every request. Return the user, or null when there’s no cookie or the session is null.</li><li>Pages: /sign-up (name, email, password, at least 8 characters), /sign-in, /check-email (“we sent you a link”), and /members, which redirects to /sign-in when there’s no user and otherwise greets the user by name and email, with a sign-out button.</li><li>Do not import AUTH_SECRET_KEY anywhere in this step.</li></ul><p>Why server-side get-session on every request instead of trusting the cookie? Because sign-out, a deleted user, or an expired session are decided by Auth, not by the cookie. The check is one GET, and the answer is the session and user, or null.</p><h3>Step 6: Email verification, including “resend”</h3><p>With verification on, the first sign-in after sign-up returns 403. Turn that into a friendly screen:</p><blockquote><em>Handle unverified emails. When POST /sign-in/email returns 403, show “Please verify your email first” on /sign-in with a “Resend verification email” button. The button calls a new server route, POST /api/auth/resend-verification, which calls POST {AUTH_URL}/send-verification-email with { email, callbackURL } and the x-api-key header, where callbackURL is this site’s origin + “/sign-in?verified=1”. On /sign-in, show “Email verified, you can sign in now” when verified=1 is in the URL. Add the same resend button to /check-email.</em></blockquote><p>Try it: sign up with a real inbox, try to sign in before clicking the link (403, friendly message), click the link, land back on your site, sign in, reach /members.</p><h3>Step 7: Forgot password</h3><p>The docs describe a two-call reset. Paste:</p><blockquote><em>Add a forgotten-password flow following the “Email and password” section of the auth docs:</em></blockquote><ul><li>/forgot-password: an email field that posts to POST /api/auth/forgot-password. That server route calls POST {AUTH_URL}/request-password-reset with { email, redirectTo } and the x-api-key header, where redirectTo is this site’s origin + “/reset-password”. Whatever happens, show the same message: “If that address has an account, a reset link is on its way.”</li><li>/reset-password: read token from the query string. Ask for the new password twice (at least 8 characters, must match) and post to POST /api/auth/reset-password, which calls POST {AUTH_URL}/reset-password with { newPassword, token } and the publishable key as x-api-key. On success, redirect to /sign-in?reset=1 and show “Password updated, sign in with your new password”. If there’s no token in the URL, show a link back to /forgot-password.</li><li>Add a “Forgot your password?” link on /sign-in.</li></ul><p>The reset email comes from CloudHike’s sender with the wording you set on the Emails tab, and the link sends the user back to redirectTo with a token in the query. Same rule as verification: redirectTo has to be on your <strong>Sites users can return to</strong> list.</p><h3>Step 8: Continue with GitHub and Google (shared OAuth app)</h3><p>Social sign-in is a <strong>browser navigation</strong>, not a fetch: the start link can’t carry the x-api-key header, and calling POST {AUTH_URL}/sign-in/social from code is refused. The provider sends the user back to the to address with the token in the URL <strong>fragment</strong> (#token=...), which browsers never send to a server, so the token stays out of logs. Here&#39;s the snippet from the docs:</p><pre>// Send the browser to the provider. It returns to `to` with the token in the fragment.<br>const to = location.origin + &quot;/&quot;;<br>window.location.href = `${AUTH_URL}/social/github?to=${encodeURIComponent(to)}`;// On your page after sign-in: take the token from the fragment, then clear it.<br>const params = new URLSearchParams(location.hash.slice(1));<br>const token = params.get(&quot;token&quot;);          // send it as authorization: Bearer &lt;token&gt;<br>const error = params.get(&quot;error&quot;);          // set when sign-in was not completed<br>history.replaceState(null, &quot;&quot;, location.pathname);</pre><p>We’ll land on a dedicated callback page and hand the token to our server, so it ends up in the same HTTP-only cookie as email sign-in. Paste:</p><blockquote><em>Add “Continue with GitHub” and “Continue with Google” buttons to /sign-in and /sign-up, following the “GitHub and Google sign-in” section of the auth docs:</em></blockquote><ul><li>Each button is a plain link (a page navigation) to {AUTH_URL}/social/github?to= (and /social/google for Google). AUTH_URL is browser-safe, but build the href in server code so no new env variable is needed. Do not call POST /sign-in/social from code.</li><li>/auth/callback is a client page: read token and error from location.hash, clear the fragment right away with history.replaceState, then POST the token to /api/auth/session. If error is set, show it with a link back to /sign-in.</li><li>POST /api/auth/session verifies the token by calling get-session from server code. Only when it returns a user, set the same HTTP-only “session” cookie as email sign-in and respond OK. The page then navigates to /members. Never put the token in localStorage.</li></ul><p>Users who sign in with a provider show up in the same Users list as email users, with the email their provider gives (for GitHub, a verified primary address). Because the credential source is <strong>Shared</strong>, there’s nothing else to register. Switch a provider to <strong>Your own</strong> whenever you want your own OAuth app on the consent screen.</p><h3>Step 9 (optional): A members list for you</h3><p>The admin endpoints need AUTH_SECRET_KEY, so they&#39;re strictly server-side. Paste:</p><blockquote><em>Add an /admin page, visible only when the signed-in user’s email equals an ADMIN_EMAIL env variable (add it to .env.local, and the name only to .env.example). Server code calls GET {AUTH_URL}/admin/users?search=&amp;limit=50&amp;offset=0 with the header x-api-key set to AUTH_SECRET_KEY and shows the users and total it returns, with a search box that fills the search parameter. AUTH_SECRET_KEY must only be read in server-only code and never reach the browser bundle.</em></blockquote><p>For hands-on user management, <strong>Open Auth</strong> on the Auth card lets you search and delete users. The API also has DELETE {AUTH_URL}/admin/users/&lt;id&gt; with the secret key, if you ever want a delete button of your own. Your agent&#39;s MCP connection, as week 4 covered, can&#39;t delete anything.</p><h3>Step 10: Check it from the agent, read-only</h3><p>If you deployed Postgres first, Auth keeps its users in the project database’s auth schema. Ask the agent to look without touching anything:</p><blockquote><em>Use get_project for members-club and tell me whether postgres and auth are ready. Then use list_tables to show the schemas, and the tables in the auth schema. Don’t run any query that prints emails or other personal data, and don’t change anything.</em></blockquote><p>list_tables, describe_table and query_database are read-only on every plan (query_database runs one statement in a READ ONLY transaction), so this is safe to run any time you want to know what Auth is doing with your data.</p><h3>Step 11: Ship it</h3><p>On Vercel (or any host), add AUTH_URL, AUTH_PUBLISHABLE_KEY, AUTH_SECRET_KEY and ADMIN_EMAIL (only if you built /admin) in the project settings. In the CloudHike dashboard, <strong>Environment → Copy as .env</strong> gives you the whole file. Then:</p><ul><li><strong>Add your production domain to Sites users can return to.</strong> Otherwise verification links, reset links and social sign-in won’t send users back to it.</li><li><strong>Secure cookies.</strong> The prompt above sets Secure in production, so the session cookie only travels over HTTPS.</li><li><strong>If the secret key leaks,</strong> click <strong>Reset keys</strong> on the Auth card. Users stay signed in, because sessions are signed with a separate per-project secret.</li><li><strong>Keep the database awake if Auth uses it.</strong> When Auth stores users in your project database, that database must stay running, and a Free database with no connections for 6 hours is stopped until you click <strong>Wake</strong>. Pro databases are always on. If you’d rather decouple them, the <strong>Store users in project database</strong> toggle on the Auth page moves users and sessions to managed storage (sign-in pauses briefly during the move).</li><li><strong>Testing without touching production.</strong> Every project can add a development environment from the switcher under the project name, with its own services, keys and .env. MCP tools take an environment argument for it.</li></ul><h3>What CloudHike handled</h3><p>Look back at what you didn’t do: you didn’t install an auth library, configure SMTP, write email templates from scratch, register OAuth apps in the GitHub and Google consoles, or invent a redirect allow-list. One MCP connection and one Auth card gave you:</p><ul><li><strong>Email and password</strong> sign-up, sign-in, sessions and sign-out as a plain HTTP API,</li><li><strong>email verification</strong> with a resend endpoint, and <strong>password reset</strong> with a token link,</li><li>verification and reset emails from <strong>CloudHike’s sender</strong>, with editable wording, a live preview and test sends,</li><li><strong>GitHub and Google sign-in</strong> through the <strong>shared OAuth app</strong>, with the token delivered in the URL fragment,</li><li>an <strong>allow-list of return sites</strong> for every link and redirect,</li><li><strong>admin endpoints</strong> behind a server-only key, and a key reset that doesn’t sign anyone out,</li><li>users in <strong>your own Postgres</strong>, inspectable with read-only MCP tools.</li></ul><p>On cost: Free holds up to 10,000 registered users per project and Pro has no limit. On both, the first 10,000 monthly active users per project are free, and additional active users cost $0.003 each per month. Everything comes out of one credit balance. If you outgrow Free, <strong>Pro is $10/month with $10 of usage credits included every month and 10 projects</strong>, and Scale is $29.99/month with unlimited projects. The details are on the <a href="https://cloudhike.dev/docs/plans-and-billing?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=build_series_w5">plans and billing page</a>.</p><h3>Your turn</h3><p>Run the prompts in order: Step 3 to deploy, the Step 4 clicks, then Steps 5 to 8 for the flows. Then try to break it: sign in before verifying, open /members in a private window, sign out and press Back, request a reset for an address that has no account.</p><p>👉 <a href="https://cloudhike.dev/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=build_series_w5"><strong>Start free at cloudhike.dev</strong></a>. You get $10 in credits at signup, plus $5 more with code TUBEGURUJI5, no card required.</p><p>Next week: <strong>send email from your own domain</strong>. We’ll verify a subdomain with DKIM, SPF and DMARC under Email → Domains, set replyTo, schedule reminders with scheduledAt, read the delivery logs, and keep it all transactional. Follow along so you don&#39;t miss it.</p><p>If you try this one, tell me in the comments which flow your agent got right first time, and which one needed a second prompt. I read every comment.</p><p>Originally published on <a href="https://dev.to/cloudhike/build-a-members-only-saas-with-real-auth-flows-email-verification-password-reset-github-and-1j2c">DEV</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ca8a5f65455" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Same backend, any agent: connect Codex, VS Code, Windsurf and Gemini CLI to one CloudHike project]]></title>
            <link>https://medium.com/@cloudhike/same-backend-any-agent-connect-codex-vs-code-windsurf-and-gemini-cli-to-one-cloudhike-project-d2212c0c75d5?source=rss-7d765af62d23------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2212c0c75d5</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[CloudHike Team]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 00:17:19 GMT</pubDate>
            <atom:updated>2026-11-10T00:54:58.893Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*A5YZ8bCVjdOUZbrf.png" /></figure><p><em>This is week 4 of</em> <strong><em>Build with CloudHike</em></strong><em>, a weekly series where we build a small, real-world app with an AI coding agent and let the agent set up the backend. Disclosure: I built</em> <em>, so keep that in mind.</em></p><p>New here? <a href="https://dev.to/cloudhike/build-a-referral-waitlist-with-your-ai-agent-postgres-auth-redis-and-email-over-one-mcp-1o5f">Week 1</a> built a referral waitlist, <a href="https://dev.to/cloudhike/build-an-ai-summarizer-with-background-jobs-retries-signed-webhooks-and-postgres-over-one-mcp-1c3k">week 2</a> moved slow AI work into background jobs with signed webhooks, and <a href="https://dev.to/cloudhike/build-a-file-sharing-app-with-presigned-uploads-storage-auth-and-postgres-over-one-mcp-connection-lbo">week 3</a> built a file-sharing app with presigned uploads. Each post stands on its own, so you can start right here.</p><p>The earlier weeks mostly used Cursor or Claude Code. That’s fine when you stick to one editor. The moment you open the same repo in VS Code one day, Codex the next, and Windsurf on a teammate’s machine, you suddenly have three places to paste keys, three slightly different MCP configs, and a quiet fear that an agent with deploy access might also be able to wipe the project.</p><p>This week is about that problem. We’ll connect <strong>Codex, VS Code, Windsurf and Gemini CLI</strong> (plus the Cursor and Claude Code setups from earlier weeks) to <strong>one CloudHike workspace</strong>, point them all at the <strong>same project</strong>, run the built-in setup_backend prompt, pull the real docs with get_docs, and look at the safety model that makes this sane: the key can create and deploy, and <strong>nothing can be deleted through MCP</strong>.</p><p>Every config snippet and prompt below comes from the live <a href="https://cloudhike.dev/docs/mcp?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w4">MCP docs</a> and <a href="https://cloudhike.dev/docs/build-with-ai?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w4">Build with AI</a> pages.</p><p>Not a new product this week. A small Next.js app called multi-agent-notes, one CloudHike project behind it, and the same backend reachable from every editor you actually use:</p><ul><li><strong>One workspace API key</strong> from Connect MCP, shared across editors</li><li><strong>Editor configs</strong> for Codex, VS Code (secret-input), Windsurf and Gemini CLI, with the Cursor and Claude Code snippets for anyone catching up</li><li><strong>The built-in</strong> setup_backend <strong>prompt</strong> to provision Postgres (and only what the app needs) in one go</li><li>get_docs so the agent reads CloudHike&#39;s Markdown docs before it writes code</li><li><strong>A proof pass</strong> from a second editor: same project id, same tables, same .env variable names, no secrets printed in chat</li><li><strong>The delete rule</strong>: create and deploy are allowed; deleting a project or service stays in the dashboard</li></ul><p>Here’s how the pieces map:</p><ul><li><strong>One remote MCP server</strong> at https://cloudhike.dev/api/mcp (Streamable HTTP, nothing to install)</li><li><strong>One workspace key</strong> (icu_...) as Authorization: Bearer ...</li><li><strong>One project</strong> with the services your app needs, paid from one credit balance</li></ul><p>Normally every AI editor is its own silo: its own secrets file, its own half-remembered setup, and no shared view of what was deployed. Here the editors are different; the backend is not.</p><ul><li>A CloudHike account. Every new account gets <strong>$10 in free credits</strong> (eligible accounts, once per inbox, valid for 90 days), plus an extra $5 with the code <strong>TUBEGURUJI5</strong>, and no card is needed. The Free plan allows 2 projects, which is plenty for this.</li><li>At least one of: Codex, VS Code (Copilot Chat in Agent mode), Windsurf or Gemini CLI. Cursor and Claude Code work too if that’s what you already have from weeks 1 to 3.</li><li>Node.js, for a small Next.js app.</li></ul><p>In the CloudHike dashboard, open <strong>Connect MCP</strong> in the sidebar ( https://cloudhike.dev/dashboard/coding-agent). Pick an editor and click <strong>Copy with key</strong>. The first time, that creates your workspace API key and gives you a snippet with the key already filled in.</p><p>A few things the docs make clear about this key:</p><ul><li>It is a <strong>workspace</strong> key, not a single-project token. The same key works in every editor you configure.</li><li><strong>Revoke</strong> on that page disconnects every editor at once. <strong>New key</strong> means pasting the new snippet again.</li><li>Treat it like a password. Keep it out of files you commit.</li><li>The same key can also drive the <a href="https://cloudhike.dev/docs/build-with-ai?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w4">workspace prompt</a> flow for tools that don’t speak MCP yet. Prefer MCP when the editor supports it.</li></ul><p>You only do this step once per workspace. The rest of the article is pasting the right shape of config into each editor.</p><pre>npx create-next-app@latest multi-agent-notes<br>cd multi-agent-notes</pre><p>Open that folder in whichever editor you’re starting with. We want a real repo so setup_backend has somewhere to write .env.local, and so a second editor can open the same files and prove it&#39;s the same backend.</p><p>Replace icu_your_api_key with your key, or use <strong>Copy with key</strong> in the dashboard, which fills it in. The server name is cloudhike everywhere.</p><p>Codex keeps the secret in an environment variable instead of the config file:</p><pre># 1. Add this line to your shell profile (~/.zshrc or ~/.bashrc):<br>#    export CLOUDHIKE_API_KEY=&quot;icu_your_api_key&quot;<br># 2. Add this to ~/.codex/config.toml:<br>[mcp_servers.cloudhike]<br>url = &quot;https://cloudhike.dev/api/mcp&quot;<br>bearer_token_env_var = &quot;CLOUDHIKE_API_KEY&quot;</pre><p>Open a new terminal so the variable is set, then run codex mcp list to check it.</p><p>VS Code is the odd one out in a good way. It asks for the key the first time and keeps it in <strong>secret storage</strong>, so the config file itself is safe to commit:</p><pre>{<br>  &quot;inputs&quot;: [<br>    {<br>      &quot;type&quot;: &quot;promptString&quot;,<br>      &quot;id&quot;: &quot;cloudhike-key&quot;,<br>      &quot;description&quot;: &quot;CloudHike.dev API key&quot;,<br>      &quot;password&quot;: true<br>    }<br>  ],<br>  &quot;servers&quot;: {<br>    &quot;cloudhike&quot;: {<br>      &quot;type&quot;: &quot;http&quot;,<br>      &quot;url&quot;: &quot;https://cloudhike.dev/api/mcp&quot;,<br>      &quot;headers&quot;: {<br>        &quot;Authorization&quot;: &quot;Bearer ${input:cloudhike-key}&quot;<br>      }<br>    }<br>  }<br>}</pre><p>Use Copilot Chat in Agent mode after it prompts for the key.</p><p>Windsurf uses serverUrl instead of url:</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;cloudhike&quot;: {<br>      &quot;serverUrl&quot;: &quot;https://cloudhike.dev/api/mcp&quot;,<br>      &quot;headers&quot;: {<br>        &quot;Authorization&quot;: &quot;Bearer icu_your_api_key&quot;<br>      }<br>    }<br>  }<br>}</pre><p>Gemini CLI uses httpUrl:</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;cloudhike&quot;: {<br>      &quot;httpUrl&quot;: &quot;https://cloudhike.dev/api/mcp&quot;,<br>      &quot;headers&quot;: {<br>        &quot;Authorization&quot;: &quot;Bearer icu_your_api_key&quot;<br>      }<br>    }<br>  }<br>}</pre><h3>Cursor and Claude Code (if you’re catching up)</h3><p><strong>Claude Code</strong></p><pre>claude mcp add --transport http --scope user cloudhike https://cloudhike.dev/api/mcp \<br>  --header &quot;Authorization: Bearer icu_your_api_key&quot;</pre><p>Run /mcp inside Claude Code to check that it&#39;s connected.</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;cloudhike&quot;: {<br>      &quot;url&quot;: &quot;https://cloudhike.dev/api/mcp&quot;,<br>      &quot;headers&quot;: {<br>        &quot;Authorization&quot;: &quot;Bearer icu_your_api_key&quot;<br>      }<br>    }<br>  }<br>}</pre><p>Open Cursor Settings → MCP and look for the green dot.</p><p>Notice the small differences: Cursor uses url, Windsurf uses serverUrl, Gemini CLI uses httpUrl, Codex uses bearer_token_env_var, and VS Code uses ${input:cloudhike-key}. Same server, same key, different client shapes. After saving, restart or reload the editor so the tools show up.</p><p>In the editor you just configured, ask:</p><blockquote><em>List the cloudhike MCP tools you can see. For each one, say whether it changes anything. Do not call any tool yet.</em></blockquote><p>You should see the set from the <a href="https://cloudhike.dev/docs/mcp?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w4">MCP docs</a>. Grouped the useful way:</p><p><strong>Read-only</strong></p><ul><li>list_projects - your projects and their ids</li><li>get_project - a project and the status of each service</li><li>wait_for_services - waits up to 50 seconds, then reports status</li><li>get_environment - the project&#39;s .env (or format: &quot;names&quot; for names only, no secrets)</li><li>list_tables / describe_table / query_database - schema and read-only SQL (one statement, READ ONLY transaction, up to 500 rows, 10 second timeout)</li><li>list_storage_files - folders and files in the project&#39;s bucket</li><li>get_docs - any docs page as Markdown</li></ul><p><strong>Can change things</strong></p><ul><li>create_project - 2 to 40 characters, follows your plan&#39;s project limit</li><li>deploy_services - postgres, auth, storage, redis, jobs or email, with the same plan and billing checks as the dashboard (already-deployed services come back as exists)</li><li>execute_sql - <strong>Pro only</strong>, marked destructive, so your editor asks before running it; whole script in one transaction</li></ul><p>What you will not see is anything that deletes a project or a service. That’s the point of Step 8.</p><p>If the editor shows no cloudhike tools: restart or reload after saving the config. In Claude Code run /mcp, in Codex run codex mcp list, in Cursor check Settings → MCP. A 401 means the key was replaced or revoked - copy the snippet again from the Coding agent page.</p><h3>Step 5: Run setup_backend (or the equivalent prompt)</h3><p>In editors that show MCP prompts as slash commands, CloudHike offers a built-in setup_backend prompt. Run it and point it at this app.</p><p>If your editor doesn’t surface MCP prompts, paste this instead (it’s the setup prompt from the MCP docs):</p><blockquote><em>Use the cloudhike MCP tools to set up CloudHike.dev as the backend for this app.</em></blockquote><blockquote><em>Read the app first and deploy only the services it needs. Put the .env into the app’s git-ignored env file without showing me the values, then read the matching docs with get_docs and write the code that connects each service.</em></blockquote><p>For this notes app, be specific so it doesn’t deploy everything:</p><blockquote><em>Use the cloudhike MCP tools to set up the backend for this app. It’s a tiny personal notes app with a title and body per note.</em></blockquote><blockquote><em>Create a CloudHike project called “multi-agent-notes” and deploy postgres only. Wait until it’s ready. Put the .env into .env.local, make sure it’s git-ignored, and don’t show me any secret values. Then call get_docs for the postgres page so you know how to use it. Don’t write app code yet. Just tell me which services are running and which variable names are in .env.local.</em></blockquote><p>Behind the scenes that walks the same tools the earlier weeks used by hand:</p><ol><li>create_project (or list_projects if it already exists)</li><li>deploy_services for Postgres</li><li>wait_for_services</li><li>get_environment written into .env.local (ask for format: &quot;names&quot; when you only want names)</li><li>get_docs for the Postgres page as Markdown</li></ol><p>The server also exposes each docs page as a resource ( cloudhike://docs/...), so some editors can attach the page directly instead of calling the tool.</p><h3>Step 6: Let get_docs drive the code</h3><p>Now that Postgres is up, paste:</p><blockquote><em>Call get_docs for “postgres”. Using node-postgres and only what that page describes, add a migration script in this repo that creates a notes table: id (uuid, default gen_random_uuid()), title (text), body (text), created_at. Create the pool once in lib/db.ts from DATABASE_URL, keep it on globalThis so hot reloads reuse it, and use max 5 connections. Run the migration with DIRECT_URL if .env.local has it, otherwise DATABASE_URL. Then use describe_table to show me the notes table. Do not print any secret values.</em></blockquote><p>Why get_docs instead of &quot;you know how Postgres works&quot;? Because the page the agent pulls is <strong>your</strong> CloudHike Postgres page: connection pooler vs DIRECT_URL, the recommended pool size, SSL, the Free-plan idle behaviour. The code that follows matches the product you actually deployed, not a generic tutorial the model memorised.</p><p>Same safety model as weeks 1 to 3: query_database is always read-only, execute_sql is Pro-only and needs approval, and schema changes belong in repo migrations so they&#39;re reviewed and repeatable.</p><p>Optional UI so there’s something to click:</p><blockquote><em>Add a /notes page that lists notes newest first and a small form to create one (title + body) through a POST /api/notes route that inserts with node-postgres. Keep it minimal.</em></blockquote><p>This is the week-4 payoff. Close the first editor (or leave it), open multi-agent-notes in a different one you configured in Step 3, and ask:</p><blockquote><em>Use list_projects to find the project named multi-agent-notes. Then get_project on it, get_environment with format “names”, list_tables, and describe_table for notes. Tell me the project id, which services are ready, which env variable names exist, and the notes columns. Do not print secret values. Do not deploy or create anything.</em></blockquote><p>You should get the <strong>same project id</strong>, the <strong>same ready services</strong>, the <strong>same variable names</strong>, and the <strong>same notes columns</strong>. That is the whole idea: Codex, VS Code, Windsurf, Gemini CLI, Cursor and Claude Code are different agents; CloudHike is one backend.</p><p>If the second editor can’t see the tools, you’re usually one reload away. If it can see tools but not the project, you’re on a different workspace key — go back to Connect MCP and make sure every editor got the current key.</p><p>The <a href="https://cloudhike.dev/docs/mcp?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w4">MCP security section</a> is short and worth reading in full. The rules that matter when several agents share one key:</p><ul><li>The key can <strong>create projects, deploy services and read keys</strong>. <strong>Nothing can be deleted through MCP.</strong> Deleting projects and services stays in the dashboard.</li><li>get_environment returns secrets so the agent can write your env file. The server tells agents to write them only to the git-ignored env file and never to repeat them in chat. Every fetch is written to the audit log as environment.agent-fetch.</li><li>All tools follow your plan limits and rate limits, exactly like the dashboard (requests limited to 120 per minute; database tools to 60 per 10 minutes).</li><li>VS Code’s secret-input config is safe to commit; the other examples live in your home folder.</li><li>On every plan, query_database runs in a READ ONLY transaction. On Pro, execute_sql can change data or schema, runs in one transaction, is marked destructive so the editor asks first, and every run is audited as postgres.sql-write.</li></ul><p>There’s a parallel story on the non-MCP path: the per-project agent token from <strong>Copy prompt</strong> on the Overview tab can only download that project’s .env. It cannot deploy, delete or change anything. Reset or revoke it from the dashboard when a pasted prompt might have leaked. Prefer MCP with the workspace key when your editor supports it; keep the project token for tools that only paste prompts.</p><p>So “any agent” does not mean “any blast radius.” Several editors can build on the same project. None of them can remove it over MCP.</p><p>Look back at what you didn’t do: you didn’t make a new backend per editor, you didn’t copy connection strings between machines by hand, and you didn’t give any agent a delete button.</p><p>One workspace key gave every editor:</p><ul><li>the same remote MCP server and the same project,</li><li>setup_backend (or the equivalent prompt) to deploy and write .env.local without printing secrets,</li><li>get_docs so the code followed the real Postgres page,</li><li>read-only tools (list_projects, get_project, list_tables, describe_table, query_database) to prove the second editor was looking at the first editor&#39;s work,</li><li>a hard line that <strong>deletes stay in the dashboard</strong>.</li></ul><p>Everything shows up in one dashboard and comes out of one credit balance. If you outgrow Free, <strong>Pro is $10/month with $10 of usage credits included every month and 10 projects</strong>, and Scale is $29.99/month with unlimited projects. The details are on the <a href="https://cloudhike.dev/docs/plans-and-billing?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w4">plans and billing page</a>.</p><p>Pick the two editors you actually switch between. Paste the configs from Step 3, run the setup_backend flow once, then do the proof pass from the second editor. If you want a longer checklist, the MCP docs also show how to poke the server with npx @modelcontextprotocol/inspector over Streamable HTTP.</p><p>👉 <a href="https://cloudhike.dev/?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w4"><strong>Start free at cloudhike.dev</strong></a>. You get $10 in credits at signup, plus $5 more with code TUBEGURUJI5, no card required.</p><p>Next week: <strong>members-only SaaS with real auth flows</strong>. Email verification, password reset, GitHub/Google sign-in through the shared OAuth app, HTTP-only cookie sessions, and the sites users can return to. Follow along so you don’t miss it.</p><p>If you try this one, tell me in the comments which pair of editors you connected, or where a config file bit you. I read every comment.</p><p><em>Originally published at </em><a href="https://cloudhike.hashnode.dev/same-backend-any-agent-connect-codex-vs-code-windsurf-and-gemini-cli-to-one-cloudhike-project"><em>https://cloudhike.hashnode.dev</em></a><em> on November 10, 2026.s”: {</em></p><p>“Authorization”: “Bearer icu_your_api_key”</p><p>}</p><p>}</p><p>}</p><p>}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2212c0c75d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a file-sharing app with presigned uploads: Storage, Auth and Postgres over one MCP connection]]></title>
            <link>https://medium.com/@cloudhike/build-a-file-sharing-app-with-presigned-uploads-storage-auth-and-postgres-over-one-mcp-connection-736dd6198ef2?source=rss-7d765af62d23------2</link>
            <guid isPermaLink="false">https://medium.com/p/736dd6198ef2</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[CloudHike Team]]></dc:creator>
            <pubDate>Mon, 09 Nov 2026 14:21:10 GMT</pubDate>
            <atom:updated>2026-11-09T14:51:13.701Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*nw-hA1i8Y9Cz8xlc.png" /></figure><p><em>This is week 3 of</em> <strong><em>Build with CloudHike</em></strong><em>, a weekly series where we build a small, real-world app with an AI coding agent and let the agent set up the backend. Disclosure: I built </em><a href="https://cloudhike.dev?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=build_series_w3"><em>CloudHike</em></a><em>, so keep that in mind.</em></p><p>New here? <a href="https://dev.to/cloudhike/build-a-referral-waitlist-with-your-ai-agent-postgres-auth-redis-and-email-over-one-mcp-1o5f">Week 1</a> built a referral waitlist with Postgres, Auth, Redis and email, and <a href="https://dev.to/cloudhike/build-an-ai-summarizer-with-background-jobs-retries-signed-webhooks-and-postgres-over-one-mcp-1c3k">week 2</a> moved a slow AI call into background jobs with retries and signed webhooks. Each post stands on its own, so you can start right here.</p><p>Every app that takes uploads starts the same way: a form, a multipart/form-data POST, and an API route that receives the file and pushes it on to a bucket. It works with a small PNG on your laptop. Then someone uploads a big video, your serverless function runs into its host&#39;s request size limit, and every byte that does get through has passed through your server twice: once in, once out.</p><p>Then come the other questions. Where do the files live? Who is allowed to see them? How do you share one without making the whole bucket public? Which keys go where, and which ones must never reach the browser?</p><p>This week we’ll build a small <strong>file-sharing and image-upload app</strong> where the browser uploads straight to a <strong>private CloudHike Storage bucket</strong> with presigned URLs, each signed-in user sees only their own files, and sharing works through links that expire. As always, the agent sets up the backend over <strong>one MCP connection</strong>, and every prompt is below.</p><h4>What we’re building</h4><p>A “my files” app, like a tiny personal Drive:</p><ul><li><strong>Sign up and sign in</strong> with email and password. The session token lives in an HTTP-only cookie.</li><li><strong>Upload from the browser.</strong> The server signs a one-off upload URL, and the browser PUTs the file straight to the bucket. The file never passes through your server.</li><li><strong>Per-user files.</strong> Every file is stored under its owner’s folder and recorded in Postgres with an owner id, and every route checks ownership.</li><li><strong>Image previews and downloads</strong> through presigned links that expire, so the bucket stays private.</li><li><strong>Share links.</strong> A file’s owner can create a link anyone can open. Your server checks it and hands out a fresh short-lived download URL each time, and the owner can turn it off.</li><li><strong>Your agent can look inside the bucket</strong> with the list_storage_files tool, without leaving the editor.</li></ul><p>Here’s the flow for one upload:</p><ol><li>Browser → POST /api/uploads with the file&#39;s name, type and size → your server checks the session, saves a pending row and answers with a presigned PUT URL</li><li>Browser → PUT the file straight to the bucket with that URL</li><li>Browser → POST /api/uploads/:id/complete → your server checks the object is really there and marks the row ready</li><li>The file list asks your server for presigned GET URLs to show thumbnails and downloads</li></ol><p>And here’s how each piece maps to CloudHike, all in one project:</p><ul><li><strong>Storage</strong> is a private S3-compatible bucket for the files (S3_ENDPOINT, S3_REGION, S3_BUCKET, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY)</li><li><strong>Auth</strong> handles sign-up, sign-in and sessions (AUTH_URL, AUTH_PUBLISHABLE_KEY, AUTH_SECRET_KEY)</li><li><strong>Postgres 16</strong> keeps the file records and share links (DATABASE_URL)</li></ul><p>Normally that’s an S3 provider with its own IAM policies and CORS settings, an auth provider and a database host: three accounts and three sets of keys. Here it’s one project, one .env and one credit balance. The bucket&#39;s access key can only list, read, write and delete in that one bucket, so it can&#39;t touch anything else.</p><h4>What you need</h4><ul><li>A CloudHike account. Every new account gets <strong>$10 in free credits</strong> (eligible accounts, valid for 90 days), plus an extra $5 with the code <strong>TUBEGURUJI5</strong>, and no card is needed. The Free plan allows 2 projects and includes 500 MB of storage per project, which is plenty for this.</li><li>Cursor or Claude Code (Codex, VS Code, Windsurf and Gemini CLI work too).</li><li>Node.js, for a Next.js app.</li></ul><h4>Step 1: Connect CloudHike to your agent (once)</h4><p>If you did week 1 or week 2, you’re already connected; skip to Step 2.</p><p>In the CloudHike dashboard, open <strong>Connect MCP</strong> in the sidebar, pick your editor and click <strong>Copy with key</strong>. That creates your workspace API key and gives you a snippet with the key already filled in. The server is remote (Streamable HTTP), so there’s nothing to install.</p><p><strong>Claude Code</strong></p><pre>claude mcp add --transport http --scope user cloudhike https://cloudhike.dev/api/mcp \<br>  --header &quot;Authorization: Bearer icu_your_api_key&quot;</pre><p>Run /mcp inside Claude Code to check that it&#39;s connected.</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;cloudhike&quot;: {<br>      &quot;url&quot;: &quot;https://cloudhike.dev/api/mcp&quot;,<br>      &quot;headers&quot;: {<br>        &quot;Authorization&quot;: &quot;Bearer icu_your_api_key&quot;<br>      }<br>    }<br>  }<br>}</pre><p>Open Cursor Settings → MCP and look for the green dot. Snippets for the other editors are in the <a href="https://cloudhike.dev/docs/mcp?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=build_series_w3">MCP docs</a>.</p><p>Treat that key like a password. It lives in your home folder, not in the repo, and you can revoke it from the same page.</p><h4>Step 2: Scaffold the app</h4><pre>npx create-next-app@latest file-share<br>cd file-share<br>npm install @aws-sdk/client-s3 @aws-sdk/s3-request-presigner pg</pre><p>Those two AWS packages are the ones the <a href="https://cloudhike.dev/docs/storage?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=build_series_w3">Storage docs</a> use: CloudHike Storage is S3-compatible, so the standard SDK just works. Open the folder in Cursor, or run claude in it.</p><h4>Step 3: Let the agent provision the backend</h4><p>Paste this prompt:</p><blockquote><em>Use the cloudhike MCP tools to set up the backend for this app. It’s a file-sharing app where signed-in users upload files from the browser.</em></blockquote><blockquote><em>Create a CloudHike project called “file-share”. Deploy postgres first, then auth and storage. Wait until they’re ready. Put the .env into .env.local, make sure it’s git-ignored, and don’t show me any secret values. Then read the storage, auth and postgres docs with get_docs so you know how to use them. Don’t write app code yet. Just tell me which services are running and which variable names are in .env.local.</em></blockquote><p>Behind the scenes, the agent works through CloudHike’s MCP tools:</p><ol><li>create_project makes the project (or list_projects finds it if it already exists).</li><li>deploy_services deploys Postgres, Auth and Storage, with the same plan and billing checks as the dashboard.</li><li>wait_for_services waits until each one reports ready.</li><li>get_environment returns the project&#39;s .env, which the agent writes into .env.local. It can also ask for format: &quot;names&quot; to list just the variable names with no secrets.</li><li>get_docs pulls the Storage, Auth and Postgres pages as Markdown, so the code it writes next follows the real API instead of a guess.</li></ol><p>Why Postgres first? Auth keeps its users in your project’s Postgres when there is one (in an auth schema), so your users sit next to your file records and there&#39;s still nothing new to host. Storage gets a private bucket named proj-&lt;slug&gt; and an access key scoped to that bucket alone.</p><p>In editors that show MCP prompts as slash commands, CloudHike also offers a built-in setup_backend prompt that does this step in one go.</p><h4>Step 4: The tables</h4><blockquote><em>Read </em><a href="https://cloudhike.dev/docs/md/postgres"><em>https://cloudhike.dev/docs/md/postgres</em></a><em>. Using node-postgres, add a migration script to this repo that creates two tables:</em></blockquote><ul><li>files: id (uuid, default gen_random_uuid()), owner_id (text, the Auth user id), object_key (text, unique), file_name, content_type, size_bytes (bigint), status (‘pending’ or ‘ready’), created_at. Add an index on (owner_id, created_at).</li><li>shares: token (text primary key, long and random), file_id (uuid, references files(id) on delete cascade), created_at, revoked_at (nullable). Run the migration with DIRECT_URL if .env.local has it, otherwise DATABASE_URL. Create the app’s pool once in lib/db.ts from DATABASE_URL, keep it on globalThis so hot reloads reuse it, and use max 5 connections. Then use the cloudhike describe_table tool to show me both tables.</li></ul><p>The bucket holds the bytes; Postgres holds who owns what. That split is what makes “per-user files” something you can check in SQL instead of guessing from folder names. The migration goes through DIRECT_URL because DATABASE_URL goes through a connection pooler (PgBouncer), and the <a href="https://cloudhike.dev/docs/postgres?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=build_series_w3">Postgres docs</a> recommend the direct address for migrations.</p><p>Same safety model as the earlier weeks: CloudHike’s query_database tool always runs one statement in a READ ONLY transaction, execute_sql (for writes) is Pro-only and your editor asks before running it, and <strong>no MCP tool can delete a project or service</strong>. Schema changes live in your repo as migrations.</p><h4><em>Step 5: Sign-in with CloudHike Auth</em></h4><blockquote><em>Read </em><a href="https://cloudhike.dev/docs/md/auth"><em>https://cloudhike.dev/docs/md/auth</em></a><em>. Add authentication with my CloudHike Auth service: /signup and /login pages (email and password), and server routes that call sign-up/email and sign-in/email with the x-api-key header set to AUTH_PUBLISHABLE_KEY and store the returned token in an HTTP-only cookie. Add lib/session.ts with a getUser() helper that reads the cookie and calls get-session from server code, returning the user or null. Add a sign-out route that calls sign-out and clears the cookie. Protect the home page so signed-out visitors go to /login. Never send AUTH_SECRET_KEY to the browser.</em></blockquote><p>CloudHike Auth is a plain HTTP API: sign-up and sign-in return { token, user }, and you send the token as authorization: Bearer &lt;token&gt; on later calls. The API itself uses no cookies, so the <a href="https://cloudhike.dev/docs/auth?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=build_series_w3">Auth docs</a> recommend storing the token in an HTTP-only cookie that your own server sets, then calling get-session from server code on each request. That keeps the token away from page scripts, and it gives every route in the next steps a trusted user.id to check ownership against.</p><p>Want GitHub or Google sign-in too? The Auth card has a shared OAuth app you can switch on, so you don’t have to register one yourself.</p><h4>Step 6: Presigned uploads from the browser</h4><p>This is the heart of the app.</p><blockquote><em>Read </em><a href="https://cloudhike.dev/docs/md/storage"><em>https://cloudhike.dev/docs/md/storage</em></a><em>. Add lib/s3.ts following the S3 SDK example in the storage docs: an S3Client from S3_ENDPOINT, S3_REGION, S3_ACCESS_KEY_ID and S3_SECRET_ACCESS_KEY with forcePathStyle: true, the bucket from S3_BUCKET, and uploadUrl(key, contentType) and downloadUrl(key) helpers using getSignedUrl from @aws-sdk/s3-request-presigner. Use expiresIn 600 for uploads and 3600 for downloads. Server code only.</em></blockquote><blockquote><em>Then add:</em></blockquote><ul><li>POST /api/uploads: require a signed-in user with getUser(). Take { name, type, size } as JSON. Allow only image/png, image/jpeg, image/webp, image/gif and application/pdf, and at most 10 MB. Build the key as users/&lt;user id&gt;/&lt;new uuid&gt;-&lt;file name with anything except letters, numbers, dots and dashes replaced&gt;. Insert a files row with status ‘pending’ and answer { id, url } with a presigned PUT URL for that key and content type.</li><li>POST /api/uploads/[id]/complete: require the owner. Run a HeadObjectCommand on the key. If it’s missing, answer 404. If ContentLength is over 10 MB, delete the object with DeleteObjectCommand, delete the row and answer 413. Otherwise save the real size, set status ‘ready’ and answer the file.</li><li>On the home page, an upload area (a file picker plus drag and drop) that calls /api/uploads, PUTs the file to the returned url with the content-type header set to the file’s type, then calls the complete route and refreshes the list. Show an error if any step fails.</li></ul><p>This is the pattern the Storage docs describe: create the presigned upload URL on your server and have the browser PUT the file to it. A few details make it safe:</p><ul><li><strong>The secret never leaves your server.</strong> The presigned URL is signed with your access key, but it doesn’t contain it. It only works for that one key and content type, and only until it expires. The docs say it plainly: do not put the access key in browser code.</li><li><strong>Your server decides the key.</strong> The browser never picks where a file goes. Keys start with users/&lt;user id&gt;/, so one user can&#39;t overwrite another&#39;s files, and the random id means two files called photo.png never collide.</li><li><strong>Trust, then verify.</strong> The size the browser sends is only a claim, so the complete route asks the bucket for the real size with HeadObjectCommand before the file counts. A pending row that never completes is just an upload that was abandoned.</li><li><strong>Plan limits are enforced for you.</strong> Per the docs, uploads that would go over your plan’s storage limit are refused up front.</li></ul><p>One note from the docs: browser uploads need a CORS rule on the bucket, and new buckets get one automatically on AWS. If the browser’s PUT ever fails with a CORS error, that&#39;s the first thing to check.</p><h4><em>Step 7: Per-user lists, previews and share links</em></h4><blockquote><em>Add:</em></blockquote><ul><li>GET /api/files: require a signed-in user and return only their files with status ‘ready’, newest first, each with a presigned download URL from downloadUrl(object_key). On the home page, show them as a grid: a thumbnail for images, a file icon for PDFs, the name, size and date, and Download, Share and Delete buttons.</li><li>DELETE /api/files/[id]: require the owner. Delete the object with DeleteObjectCommand, then the row (its shares go with it).</li><li>POST /api/files/[id]/share: require the owner and create a shares row with a random token of at least 32 bytes, base64url. Answer the link APP_URL + “/s/” + token, where APP_URL is a new env variable with the app’s public address. Add DELETE on the same route to set revoked_at on that file’s shares.</li><li>GET /s/[token]: no sign-in needed. Find the share with revoked_at null and its ready file, then redirect to a fresh presigned download URL with expiresIn 300. If there’s no such share, answer 404. Every route that takes a file id must check that files.owner_id matches the signed-in user and answer 404 otherwise, so other people’s file ids look the same as missing ones.</li></ul><p>The rule from the Storage docs that shapes all of this: <strong>buckets are private</strong>. You share files with presigned links, which expire, or serve them through your own server. So nothing in the bucket is ever public:</p><ul><li><strong>Thumbnails and downloads</strong> use presigned GET links created per request, for the owner only.</li><li><strong>Share links point at your app, not the bucket.</strong> /s/&lt;token&gt; checks Postgres every time and hands out a link that expires in a few minutes. Turning a share off takes effect on the next click, and a leaked bucket URL stops working on its own.</li><li><strong>Ownership lives in one place.</strong> Every query filters by owner_id, so &quot;see only your own files&quot; is a WHERE clause you can read, not a convention.</li></ul><h4>Step 8: Let the agent look inside the bucket</h4><p>Upload a few files, then ask:</p><blockquote><em>Use the cloudhike list_storage_files tool to show me what’s in my bucket under users/, with sizes. Then use query_database to count the files rows by status, and tell me whether every ‘ready’ row has a matching object in the bucket.</em></blockquote><p>list_storage_files lists folders and files in the project&#39;s bucket, or searches them, and like query_database it only reads. That makes it a safe way for the agent to check its own work: did the upload land under the right user folder, is the key what the code says it is, and do the bucket and the files table agree?</p><p>You can also click <strong>Open storage</strong> on the Storage card for the dashboard’s storage browser. It shows folders and files with size, type and date, previews images, video, audio and PDFs inline, and has Stats with space used against your limit, a breakdown by type and the largest files. Handy for spotting a stray upload or checking you’re nowhere near the Free plan’s 500 MB.</p><h4>Step 9: Deploy to Vercel</h4><p>CloudHike doesn’t host apps yet (app hosting is coming soon), so the Next.js app goes on Vercel and the backend stays on CloudHike:</p><ol><li>Push the repo to GitHub. Check that .env.local is <strong>not</strong> in the commit.</li><li>Import the repo in Vercel.</li><li>Add the variables from .env.local under the project&#39;s Environment Variables. In the CloudHike dashboard, <strong>Environment → Copy as .env</strong> gives you the whole file. Add APP_URL with your Vercel production address.</li><li>Deploy, sign up, and upload a photo.</li></ol><p>Because uploads go straight from the browser to the bucket, your Vercel functions only ever handle small JSON requests, whatever the size of the file.</p><p>A few production notes from the docs:</p><ul><li><strong>Storage limits.</strong> Free includes 500 MB per project. A Free bucket over its limit for 3 days is paused: uploads and new folders are refused, while deleting still works. Pro has no size limit and is billed at $0.08 per GB-month stored.</li><li><strong>Backups share the bucket.</strong> Database backups live in the bucket under _backups/postgres/ and count toward its size, so don&#39;t be surprised to see that folder in list_storage_files.</li><li><strong>Keys can be rotated.</strong> If a storage secret leaks, <strong>Reset keys</strong> on the Storage card creates a new access key and secret. Update your env variables on Vercel afterwards. The same goes for <strong>Reset keys</strong> on the Auth card, and users stay signed in when you do it.</li><li><strong>Auth limits.</strong> Free holds up to 10,000 registered users per project, and the first 10,000 monthly active users per project are free on every plan.</li><li><strong>Keep the database pool small</strong> (max: 5), since each serverless instance opens its own. And a Free database with no connections for 6 hours is stopped until you click <strong>Wake</strong> on the card; Pro databases are always on. Auth uses that database too, so wake it if sign-in starts answering 503.</li></ul><h4>What CloudHike handled</h4><p>Look back at what you didn’t do: you didn’t open an S3 account, write an IAM policy, set up an auth provider, or copy keys between three dashboards. One MCP connection gave the agent:</p><ul><li>a project with <strong>Postgres, Auth and Storage</strong> deployed and the .env written without showing secrets in chat,</li><li>a <strong>private S3-compatible bucket</strong> with an access key that only works in that bucket, ready for the standard AWS SDK and presigned URLs,</li><li><strong>sign-up, sign-in and sessions</strong> as a plain HTTP API, with users stored in your own Postgres,</li><li>the real docs for each service before writing code,</li><li>read-only tools to check the work: describe_table and query_database for the data, list_storage_files for the bucket.</li></ul><p>Everything shows up in one dashboard and comes out of one credit balance. If you outgrow Free, <strong>Pro is $10/month with $10 of usage credits included every month and 10 projects</strong>, and Scale is $29.99/month with unlimited projects. The details are on the <a href="https://cloudhike.dev/docs/plans-and-billing?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=build_series_w3">plans and billing page</a>.</p><h4>Your turn</h4><p>The whole build is the five prompts from Step 3 to Step 7, plus the bucket check in Step 8. Run them, then make it yours: allow videos, add folders, or show a “shared with you” page.</p><p><a href="https://cloudhike.dev/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=build_series_w3">👉 <strong>Start free at cloudhike.dev</strong></a>. You get $10 in credits at signup, plus $5 more with code TUBEGURUJI5, no card required.</p><p>Next week: <strong>same backend, any agent</strong>. We’ll connect Codex, VS Code, Windsurf and Gemini CLI to one CloudHike project, use the built-in setup_backend prompt and get_docs, and look at why no MCP tool can delete anything. Follow along so you don&#39;t miss it.</p><p>If you try this one, tell me in the comments what your agent built, or where it got stuck. I read every comment.</p><p><em>Originally published at </em><a href="https://cloudhike.hashnode.dev/build-a-file-sharing-app-with-presigned-uploads-storage-auth-and-postgres-over-one-mcp-connection"><em>https://cloudhike.hashnode.dev</em></a><em> on November 9, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=736dd6198ef2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build an AI summarizer with background jobs: retries, signed webhooks and Postgres over one MCP…]]></title>
            <link>https://medium.com/@cloudhike/build-an-ai-summarizer-with-background-jobs-retries-signed-webhooks-and-postgres-over-one-mcp-9c91a463f84b?source=rss-7d765af62d23------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c91a463f84b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[CloudHike Team]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 19:48:11 GMT</pubDate>
            <atom:updated>2026-11-02T20:30:38.403Z</atom:updated>
            <content:encoded><![CDATA[<h3>Build an AI summarizer with background jobs: retries, signed webhooks and Postgres over one MCP connection</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*lVeq88efwtyLLr7x.png" /></figure><p><em>This is week 2 of</em> <strong><em>Build with CloudHike</em></strong><em>, a weekly series where we build a small, real-world app with an AI coding agent and let the agent set up the backend. Disclosure: I built </em><a href="https://cloudhike.dev/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=build_series_w2"><em>CloudHike</em></a><em>, so keep that in mind.</em></p><p>Every AI feature starts the same way: one await on a model call inside an API route. It works on your laptop. Then real users paste long documents, the model takes its time, the provider answers 429 now and then, and your request sits there waiting while the browser spinner keeps spinning. A failed call means the user clicks again, and you pay for the same work twice.</p><p>The usual fix is a job queue: a queue service, a worker process somewhere to run it, retry logic, and a way to get the result back to your app. That’s a small piece of infrastructure before you’ve improved anything for the user.</p><p>This week we’ll build an <strong>AI summarizer</strong> that moves the slow model call into a <strong>CloudHike background job</strong>, with retries, a signed webhook for the result, and duplicate protection. As always, the agent sets up the backend over <strong>one MCP connection</strong>, and every prompt is below.</p><p>A “paste text, get a summary” app:</p><ul><li><strong>A page</strong> with a big text box and a Summarize button.</li><li><strong>An API route that answers at once.</strong> It saves the request in Postgres as queued and starts a background job run, so the user never waits on the model.</li><li><strong>A worker route</strong> that the job calls. It does the slow part: one call to an AI model.</li><li><strong>Retries</strong> on network errors, 429s and 5xx answers, handled by CloudHike instead of your code.</li><li><strong>A webhook route</strong> that receives the finished run, checks the x-cloudhike-signature header, skips run ids it has already handled, and saves the summary.</li></ul><p>Here’s the flow:</p><ol><li>Browser → POST /api/summaries → a row in Postgres plus a new run, answered right away</li><li>CloudHike Jobs → POST /api/jobs/summarize (your worker) → AI model → summary as JSON</li><li>CloudHike Jobs → POST /api/jobs-webhook → signature check → duplicate check → summary saved</li><li>The page polls its own GET /api/summaries/:id until the summary is there</li></ol><p>And here’s how each piece maps to CloudHike, all in one project:</p><ul><li><strong>Postgres 16</strong> stores the summaries and the run ids we’ve handled (DATABASE_URL)</li><li><strong>Background jobs</strong> call the worker, retry it and deliver the result (JOBS_API_URL, JOBS_API_KEY)</li><li><strong>AI models</strong> write the summary through one OpenAI-compatible key (AI_BASE_URL, AI_API_KEY)</li></ul><p>Normally that’s a database host, a queue, a worker host and an AI provider account: four places to sign up and four sets of keys. Here it’s one project, one .env and one credit balance. You don&#39;t need an OpenAI, Anthropic or Google account; you pick a model by name, such as openai/gpt-5-mini or anthropic/claude-sonnet-4.5.</p><ul><li>A CloudHike account. Every new account gets <strong>$10 in free credits</strong> (eligible accounts, valid for 90 days), plus an extra $5 with the code <strong>TUBEGURUJI5</strong>, and no card is needed. The Free plan allows 2 projects, and background jobs are free on Free within its limits (500 runs a day).</li><li>Cursor or Claude Code (Codex, VS Code, Windsurf and Gemini CLI work too).</li><li>Node.js, for a Next.js app.</li><li>Somewhere public to run it, such as Vercel. The job worker calls <strong>public URLs only</strong>: localhost, private networks and cloud metadata addresses are refused. We’ll deploy before the first real test.</li></ul><p>If you did week 1, you’re already connected; skip to Step 2.</p><p>In the CloudHike dashboard, open <strong>Connect MCP</strong> in the sidebar, pick your editor and click <strong>Copy with key</strong>. That creates your workspace API key and gives you a snippet with the key already filled in. The server is remote (Streamable HTTP), so there’s nothing to install.</p><p><strong>Claude Code</strong></p><pre>claude mcp add --transport http --scope user cloudhike https://cloudhike.dev/api/mcp \<br>  --header &quot;Authorization: Bearer icu_your_api_key&quot;</pre><p>Run /mcp inside Claude Code to check that it&#39;s connected.</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;cloudhike&quot;: {<br>      &quot;url&quot;: &quot;https://cloudhike.dev/api/mcp&quot;,<br>      &quot;headers&quot;: {<br>        &quot;Authorization&quot;: &quot;Bearer icu_your_api_key&quot;<br>      }<br>    }<br>  }<br>}</pre><p>Open Cursor Settings → MCP and look for the green dot. Snippets for the other editors are in the <a href="https://cloudhike.dev/docs/mcp?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w2">MCP docs</a>.</p><p>Treat that key like a password. It lives in your home folder, not in the repo, and you can revoke it from the same page.</p><pre>npx create-next-app@latest summarizer<br>cd summarizer</pre><p>Open the folder in Cursor, or run claude in it.</p><p>Paste this prompt:</p><blockquote><em>Use the cloudhike MCP tools to set up the backend for this app. It’s an AI summarizer that runs the model call in a background job.</em></blockquote><blockquote><em>Create a CloudHike project called “summarizer” and deploy postgres and jobs. Wait until they’re ready. Put the .env into .env.local, make sure it’s git-ignored, and don’t show me any secret values. Then read the jobs, postgres and ai docs with get_docs so you know how to use them. Don’t write app code yet. Just tell me which services are running and which variable names are in .env.local.</em></blockquote><p>Behind the scenes, the agent works through CloudHike’s MCP tools:</p><ol><li>create_project makes the project (or list_projects finds it if it already exists).</li><li>deploy_services deploys Postgres and Jobs, with the same plan and billing checks as the dashboard.</li><li>wait_for_services waits until each one reports ready.</li><li>get_environment returns the project&#39;s .env, which the agent writes into .env.local. It can also ask for format: &quot;names&quot; to list just the variable names with no secrets.</li><li>get_docs pulls the Jobs, Postgres and AI pages as Markdown, so the code it writes next follows the real API instead of a guess.</li></ol><p><strong>One click for the AI models.</strong> deploy_services covers Postgres, Auth, Storage, Redis, Jobs and Email, so the AI service is the one you deploy yourself: open the project in the dashboard and click <strong>Deploy</strong> on the <strong>AI</strong> card. Then ask:</p><blockquote><em>Use the cloudhike get_environment tool again and update .env.local, keeping any keys I added. Show me only the variable names and confirm AI_BASE_URL and AI_API_KEY are there.</em></blockquote><blockquote><em>Read </em><a href="https://cloudhike.dev/docs/md/postgres"><em>https://cloudhike.dev/docs/md/postgres</em></a><em>. Using node-postgres, add a migration script to this repo that creates two tables:</em></blockquote><ul><li>summaries: id (uuid, default gen_random_uuid()), input_text, status (‘queued’, ‘done’ or ‘failed’), summary (nullable), run_id (nullable, unique), error (nullable), created_at and updated_at.</li><li>handled_runs: run_id (text primary key) and handled_at. Run the migration with DIRECT_URL if .env.local has it, otherwise DATABASE_URL. Create the app’s pool once in lib/db.ts from DATABASE_URL, keep it on globalThis so hot reloads reuse it, and use max 5 connections. Then use the cloudhike describe_table tool to show me both tables.</li></ul><p>handled_runs is our duplicate guard, and we&#39;ll come back to it in Step 7. The migration goes through DIRECT_URL because DATABASE_URL goes through a connection pooler (PgBouncer), and the <a href="https://cloudhike.dev/docs/postgres?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w2">Postgres docs</a> recommend the direct address for migrations.</p><p>Same safety model as week 1: CloudHike’s query_database tool always runs one statement in a READ ONLY transaction, execute_sql (for writes) is Pro-only and your editor asks before running it, and <strong>no MCP tool can delete a project or service</strong>. Schema changes live in your repo as migrations.</p><p>This is the route CloudHike Jobs will call. It holds the slow part, so nothing user-facing waits on it.</p><blockquote><em>Read </em><a href="https://cloudhike.dev/docs/md/jobs"><em>https://cloudhike.dev/docs/md/jobs</em></a><em> and </em><a href="https://cloudhike.dev/docs/md/ai"><em>https://cloudhike.dev/docs/md/ai</em></a><em>. Add lib/jobs-signature.ts with a verify(rawBody, header) function based on the x-cloudhike-signature example in the jobs docs: HMAC-SHA256 of “.” with JOBS_API_KEY, compared with timingSafeEqual, refusing timestamps more than 300 seconds old.</em></blockquote><blockquote><em>Then add POST /api/jobs/summarize:</em></blockquote><ul><li>Read the raw body with request.text() and answer 401 if verify fails.</li><li>Parse { summaryId } and load that row’s input_text from summaries.</li><li>Call the AI service with the OpenAI SDK, baseURL AI_BASE_URL and apiKey AI_API_KEY, model “openai/gpt-5-mini”, asking for a short summary in plain text.</li><li>Answer 200 with JSON { summary }.</li><li>If the AI call fails with a 429 or 5xx, or the network fails, answer 503 so the job retries. For any other error, answer 422 with a short message, so the run fails without retrying. Server code only. Never send JOBS_API_KEY or AI_API_KEY to the browser.</li></ul><p>A few details from the <a href="https://cloudhike.dev/docs/jobs?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w2">Jobs docs</a> shape this route:</p><ul><li><strong>Every request CloudHike sends is signed</strong>, both to your job url and to your callbackUrl. The x-cloudhike-signature header looks like t=&lt;unix seconds&gt;,v1=&lt;hex&gt;, where v1 is an HMAC-SHA256 of &lt;t&gt;.&lt;raw body&gt; with your JOBS_API_KEY. That&#39;s why the worker verifies it: the route is public, and this is how it knows the call came from your job and not from a stranger.</li><li><strong>Retries are by status code.</strong> A run is retried after a network error, a 429 or a 5xx, up to retries extra tries (0 to 5, default 3). A timeout or any other answer, such as 400, is final. So the worker decides: 503 means &quot;try again&quot;, 422 means &quot;don&#39;t bother&quot;.</li><li><strong>A run succeeds on any 2xx</strong>, and CloudHike keeps the first 256 KB of what you answer, parsed as JSON when you answer JSON. That { summary } is exactly what the webhook will receive.</li></ul><blockquote><em>Add POST /api/summaries. Validate that the text isn’t empty and is at most 20,000 characters. Insert a summaries row with status ‘queued’. Then, from server code, start a CloudHike job run: POST to JOBS_API_URL/runs with the x-api-key header set to JOBS_API_KEY and the body { url: APP_URL + “/api/jobs/summarize”, method: “POST”, body: { summaryId }, retries: 3, timeoutSeconds: 300, callbackUrl: APP_URL + “/api/jobs-webhook” }. APP_URL is a new env variable with the app’s public address. Save the returned run id in the row’s run_id and answer 202 with the summary id. If starting the run answers 429, mark the row failed with “Busy, try again in a minute”.</em></blockquote><blockquote><em>Add GET /api/summaries/[id] that returns status, summary and error from Postgres. Then build the home page: a textarea, a Summarize button, and a result area that polls GET /api/summaries/[id] every 3 seconds until the status is done or failed.</em></blockquote><p>Starting a run is one fetch. CloudHike answers at once with the run&#39;s id and status queued, then its worker calls your URL and waits for the answer, for up to 5 minutes on Free and 60 on Pro ( timeoutSeconds goes up to 300 on Free and 3600 on Pro). Your API route is done in the time it takes to insert a row and make that one call.</p><p>We pass the summary id in the job body rather than the whole text, which keeps the job small (bodies can be up to 256 KB) and keeps the text in your own database.</p><blockquote><em>Add POST /api/jobs-webhook, following the Next.js webhook example in the jobs docs:</em></blockquote><ul><li>Read the raw body with request.text() and verify x-cloudhike-signature with lib/jobs-signature.ts before parsing anything. Answer 401 if it fails.</li><li>Read the run id from the x-cloudhike-run-id header.</li><li>In one transaction: INSERT the run id into handled_runs with ON CONFLICT DO NOTHING. If no row was inserted, we’ve already handled this run, so commit and answer 200 “already handled”.</li><li>Otherwise find the summaries row with that run_id. If the run’s status is succeeded, save response.body.summary and set status ‘done’. If it’s failed or cancelled, set status ‘failed’ and save the run’s error. Commit.</li><li>If no summary has that run id, log it and answer 200. Answer 200 whenever the request was handled.</li></ul><p>Two lines in the docs make this route worth the care:</p><ul><li><strong>Runs are delivered at least once.</strong> In rare cases, such as a worker restart mid-run, your URL can be called twice for the same run. The docs’ answer is to use x-cloudhike-run-id to skip a run you&#39;ve already handled, and a primary key on handled_runs does exactly that, without a race between two deliveries.</li><li><strong>The webhook itself is retried.</strong> Answer with any 2xx; any other answer is retried 6 times over about 15 minutes. That’s why a duplicate gets a 200 too: it tells CloudHike to stop, and the transaction makes sure a run is only marked handled once its summary is saved.</li></ul><p>The webhook receives the same JSON you’d get by polling GET JOBS_API_URL/runs/&lt;id&gt;: status, attempts, error, durationMs and response.body. If you&#39;d rather not pass callbackUrl on every run, set a webhook URL once under <strong>Jobs → Manage → Webhook</strong> in the dashboard. A run&#39;s own callbackUrl wins over it.</p><p>CloudHike doesn’t host apps yet (app hosting is coming soon), so the Next.js app goes on Vercel and the backend stays on CloudHike. Because the job calls your worker and webhook over the internet, this is also where the app comes alive:</p><ol><li>Push the repo to GitHub. Check that .env.local is <strong>not</strong> in the commit.</li><li>Import the repo in Vercel.</li><li>Add the variables from .env.local under the project&#39;s Environment Variables. In the CloudHike dashboard, <strong>Environment → Copy as .env</strong> gives you the whole file. Add APP_URL with your Vercel production address.</li><li>Deploy, open the app, paste a long article and click Summarize.</li></ol><p>Want to test the webhook on its own first? <strong>Jobs → Manage → Webhook</strong> can send a <strong>signed test event</strong> to your URL. If it doesn’t match a summary, your route logs it and answers 200, and either way you’ve seen the signature check pass.</p><p>To see what happened without leaving the editor, ask:</p><blockquote><em>Use the cloudhike query_database tool to show the 10 newest summaries with their status, run_id and error, and how many rows are in handled_runs.</em></blockquote><p>That runs read-only, so it’s safe to let the agent explore. The <strong>Runs</strong> page in the dashboard shows the last 100 runs, and GET JOBS_API_URL/runs?limit=20&amp;status=failed lists recent failures if you want an admin view.</p><p>A few production notes from the docs:</p><ul><li><strong>Jobs limits.</strong> On Free: 500 runs a day, 30 a minute, 5 in progress at once (more wait their turn), and a 5-minute timeout. On Pro: no daily limit, 600 a minute, 25 at once, a 60-minute timeout, and 50,000 run-seconds a month per project included, then $0.01 per 1,000 run-seconds. Run time is the time CloudHike waits on your URL, so each retried attempt counts. Over a limit, starting a run answers 429, which our route already handles.</li><li><strong>Runs are kept for 7 days</strong>, results included. The summary you care about lives in your own Postgres.</li><li><strong>Not everything should retry.</strong> If a job isn’t safe to run twice (say, it charges a card), set retries: 0. A summary is safe to redo, so 3 retries is fine here.</li><li><strong>AI limits.</strong> On Free, AI models allow 20 requests a minute and up to $2.00 a month on models; on Pro it’s 300 a minute, within your credits and spend cap. Each request costs the provider’s price plus 5%, and prompts and answers are never stored.</li><li><strong>Your host’s limits still apply.</strong> The job waits up to timeoutSeconds, but your worker route also has to be allowed to run that long on your host. Check its function duration setting.</li><li><strong>Keep the database pool small</strong> (max: 5), since each serverless instance opens its own. And a Free database with no connections for 6 hours is stopped until you click <strong>Wake</strong> on the card; Pro databases are always on.</li></ul><p>Look back at what you didn’t do: you didn’t set up a queue, run a worker server, write retry loops, build a webhook signing scheme or open an AI provider account. One MCP connection, and one click on the AI card, gave the agent:</p><ul><li>a project with <strong>Postgres and background jobs</strong> deployed and the .env written without showing secrets in chat,</li><li>a job runner that calls your URL, <strong>retries</strong> 429s, 5xx answers and network errors, and <strong>waits up to 5 minutes on Free or 60 on Pro</strong>,</li><li><strong>signed requests</strong> to your worker and webhook, with a run id for de-duplication,</li><li><strong>hundreds of AI models</strong> (GPT, Claude, Gemini, Grok, DeepSeek, Qwen and more) behind one OpenAI-compatible key, billed from the same credits,</li><li>the real docs for each service before writing code, and read-only tools to check the data.</li></ul><p>Everything shows up in one dashboard and comes out of one credit balance. If you outgrow Free, <strong>Pro is $10/month with $10 of usage credits included every month</strong>. The details are on the <a href="https://cloudhike.dev/docs/plans-and-billing?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w2">plans and billing page</a>.</p><p>The whole build is the five prompts from Step 3 to Step 7, plus the env refresh and the optional query. Run them, swap the model, change the prompt to extract action items instead of summaries, and see how far your agent gets.</p><p>👉 <a href="https://cloudhike.dev/?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w2"><strong>Start free at cloudhike.dev</strong></a>. You get $10 in credits at signup, plus $5 more with code TUBEGURUJI5, no card required.</p><p>Next week: a <strong>file-sharing and image-upload app</strong> with Storage, Auth and Postgres. Users upload straight from the browser with presigned URLs, each user sees only their own files, and your agent can list the bucket without leaving the editor. Follow along so you don’t miss it.</p><p>If you try this one, tell me in the comments what your agent built, or where it got stuck. I read every comment.</p><p><em>Originally published at </em><a href="https://cloudhike.hashnode.dev/build-an-ai-summarizer-with-background-jobs-retries-signed-webhooks-and-postgres-over-one-mcp-connection"><em>https://cloudhike.hashnode.dev</em></a><em> on November 2, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c91a463f84b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a referral waitlist with your AI agent: Postgres, Auth, Redis and email over one MCP…]]></title>
            <link>https://medium.com/@cloudhike/build-a-referral-waitlist-with-your-ai-agent-postgres-auth-redis-and-email-over-one-mcp-bf8cda1e9ec8?source=rss-7d765af62d23------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf8cda1e9ec8</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[CloudHike Team]]></dc:creator>
            <pubDate>Mon, 26 Oct 2026 22:04:28 GMT</pubDate>
            <atom:updated>2026-11-02T20:28:10.513Z</atom:updated>
            <content:encoded><![CDATA[<h3>Build a referral waitlist with your AI agent: Postgres, Auth, Redis and email over one MCP connection</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*CCjwrftYr87MVOuG.png" /></figure><p><em>This is week 1 of </em><strong><em>Build with CloudHike</em></strong><em>, a weekly series where we build a small, real-world app with an AI coding agent and let the agent set up the backend. Disclosure: I built </em><a href="https://cloudhike.dev?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w1"><em>CloudHike</em></a><em>, so keep that in mind.</em></p><p>Every side project starts the same way: “I’ll put up a waitlist first.” Then the waitlist turns into a project of its own. You need a database for the signups, a way to stop bots, a confirmation email, some way to reward people who share it, and a private page where you can see who joined. That’s four services before you’ve written a line of your actual product.</p><p>This week we’ll build that waitlist with Cursor or Claude Code, and let the agent provision the whole backend through <strong>one MCP connection</strong>. Every prompt is below, so you can run it yourself.</p><p>A launch waitlist with referrals:</p><ul><li><strong>A landing page</strong> with an email form. Each signup gets a personal referral link like /?ref=abc123.</li><li><strong>A “you’re #N” confirmation email</strong> with that link in it.</li><li><strong>A live referral leaderboard</strong>: every friend who joins with your link moves you up.</li><li><strong>Rate limiting</strong>, so one IP can’t flood the list.</li><li><strong>A private admin page</strong> behind a login, showing every signup and the top referrers.</li></ul><p>Here’s how each piece maps to CloudHike, all in one project:</p><ul><li><strong>Postgres 16</strong> stores the signups (DATABASE_URL)</li><li><strong>Redis 7</strong> runs the leaderboard and the rate limiter (REDIS_URL)</li><li><strong>Email</strong> sends the confirmation (EMAIL_API_URL, EMAIL_API_KEY, EMAIL_FROM)</li><li><strong>Auth</strong> protects the admin page (AUTH_URL, AUTH_PUBLISHABLE_KEY, AUTH_SECRET_KEY)</li></ul><p>Normally that’s a database host, a Redis provider, an email provider and an auth provider: four accounts, four sets of keys, four bills. Here it’s one project, one .env and one credit balance, and the agent sets it up.</p><ul><li>A CloudHike account. New accounts get <strong>$10 in free credits</strong> (eligible accounts, once per inbox, valid for 90 days), no card needed. The Free plan allows 2 projects, which is plenty for this.</li><li>Cursor or Claude Code (Codex, VS Code, Windsurf and Gemini CLI work too).</li><li>Node.js, for a Next.js app.</li></ul><p>In the CloudHike dashboard, open <strong>Connect MCP</strong> in the sidebar, pick your editor and click <strong>Copy with key</strong>. That creates your workspace API key and gives you a snippet with the key already filled in. The server is remote (Streamable HTTP), so there’s nothing to install.</p><p><strong>Claude Code</strong></p><pre>claude mcp add --transport http --scope user cloudhike https://cloudhike.dev/api/mcp \<br>  --header &quot;Authorization: Bearer icu_your_api_key&quot;</pre><p>Run /mcp inside Claude Code to check that it&#39;s connected.</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;cloudhike&quot;: {<br>      &quot;url&quot;: &quot;https://cloudhike.dev/api/mcp&quot;,<br>      &quot;headers&quot;: {<br>        &quot;Authorization&quot;: &quot;Bearer icu_your_api_key&quot;<br>      }<br>    }<br>  }<br>}</pre><p>Open Cursor Settings → MCP and look for the green dot. Snippets for the other editors are in the <a href="https://cloudhike.dev/docs/mcp?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w1">MCP docs</a>.</p><p>Treat that key like a password. It lives in your home folder, not in the repo, and you can revoke it from the same page.</p><pre>npx create-next-app@latest waitlist<br>cd waitlist</pre><p>Open the folder in Cursor, or run claude in it.</p><p>This is the step that usually takes an evening of dashboards. Paste this prompt:</p><blockquote><em>Use the cloudhike MCP tools to set up the backend for this app. It’s a launch waitlist with referrals.</em></blockquote><blockquote><em>Create a CloudHike project called “waitlist” and deploy postgres, redis, email and auth. Wait until they’re ready. Put the .env into .env.local, make sure it’s git-ignored, and don’t show me any secret values. Then read the docs for each service with get_docs so you know how to use them. Don’t write app code yet. Just tell me which services are running and which variable names are in .env.local.</em></blockquote><p>Behind the scenes, the agent works through CloudHike’s MCP tools:</p><ol><li>create_project makes the project (or list_projects finds it if it already exists).</li><li>deploy_services deploys Postgres, Redis, Email and Auth, with the same plan and billing checks as the dashboard.</li><li>wait_for_services waits until each one reports ready.</li><li>get_environment returns the project&#39;s .env, which the agent writes into .env.local. It can also ask for format: &quot;names&quot; to list just the variable names with no secrets.</li><li>get_docs pulls the Postgres, Redis, Email and Auth pages as Markdown, so the code it writes next follows the real API instead of a guess.</li></ol><p>One note: the Email service asks you to accept CloudHike’s <a href="https://cloudhike.dev/legal/email-policy?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w1">email acceptable use policy</a>, because it’s for transactional mail only. If the agent says Email couldn’t be deployed, open the project in the dashboard, tick the box on the Email card, click <strong>Deploy</strong>, and ask the agent to fetch the .env again.</p><p>In editors that show MCP prompts as slash commands, CloudHike also offers a built-in setup_backend prompt that does this step in one go.</p><blockquote><em>Read </em><a href="https://cloudhike.dev/docs/md/postgres"><em>https://cloudhike.dev/docs/md/postgres</em></a><em>. Using node-postgres, create a signups table with a migration script in this repo: id, email (unique), referral_code (unique, short and random), referred_by (nullable referral code), ip, and created_at. Create the pool once in lib/db.ts, keep it on globalThis so hot reloads reuse it, and use max 5 connections. Run the migration, then use the cloudhike describe_table tool to show me the table.</em></blockquote><p>Why a migration in the repo and not SQL straight through MCP? On the Free plan, CloudHike’s database tools are <strong>read-only</strong>: query_database always runs one statement in a READ ONLY transaction. Writing SQL over MCP ( execute_sql) is a Pro-only tool, runs in a single transaction, and is marked destructive, so your editor asks before running it. The docs recommend migrations in your code for schema changes anyway, so they&#39;re reviewed and repeatable. And <strong>no MCP tool can delete a project or service</strong>. Your agent gets enough access to build, and no way to wipe your backend.</p><blockquote><em>Read </em><a href="https://cloudhike.dev/docs/md/redis"><em>https://cloudhike.dev/docs/md/redis</em></a><em>. Add a POST /api/join route that:</em></blockquote><ul><li>Rate limits by IP with Redis using INCR and EXPIRE: at most 5 joins per IP per 10 minutes, answering 429 when over.</li><li>Validates the email and inserts it into signups with a new referral_code. If the email already exists, return the existing referral code instead of an error.</li><li>If a valid ?ref code came with the request, saves it as referred_by and runs ZINCRBY on a Redis sorted set called “leaderboard” for that code.</li><li>Returns the user’s position in the list and their referral link. Use one shared ioredis connection from lib/redis.ts, server code only.</li></ul><p>The rate limiter is the same INCR and EXPIRE pattern the <a href="https://cloudhike.dev/docs/redis?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w1">Redis docs</a> show, and a sorted set is a natural fit for a leaderboard. One thing worth knowing: CloudHike&#39;s Redis runs with noeviction (32 MB on Free), so a full Redis refuses writes instead of silently dropping keys. That&#39;s why the rate-limit keys get an expiry and the leaderboard stays small.</p><blockquote><em>Read </em><a href="https://cloudhike.dev/docs/md/email"><em>https://cloudhike.dev/docs/md/email</em></a><em>. After a new signup in /api/join, send a confirmation email from server code: POST to EMAIL_API_URL/send with the x-api-key header set to EMAIL_API_KEY, from EMAIL_FROM, with fromName “Waitlist” and replyTo set to my support address from a SUPPORT_EMAIL env variable. Subject “You’re on the list (#N)”. Include their referral link in both html and text. If the API answers 429, still save the signup and log the error. Don’t send anything for duplicate signups.</em></blockquote><p>There’s no SMTP to configure and no separate email account. Mail goes out from a CloudHike address straight away, and you can switch to your own domain later by verifying it under <strong>Email → Domains</strong> in the project. Once it’s verified, fetching the .env again picks the domain up. The Logs tab shows who each message went to and whether it was delivered. Message bodies aren&#39;t stored.</p><p>Keep it transactional: a “you’re on the list” confirmation is fine, while a launch-day blast to the whole list would be marketing mail, which the Email service doesn’t allow.</p><blockquote><em>Read </em><a href="https://cloudhike.dev/docs/md/auth"><em>https://cloudhike.dev/docs/md/auth</em></a><em>. Add an admin area with my CloudHike Auth service: a /login page (email and password sign-in), a server route that stores the returned token in an HTTP-only cookie, and a protected /admin page. On /admin, call get-session from server code and allow access only when the user’s email matches an ADMIN_EMAIL env variable. Show the total number of signups, the newest 50, and the top 10 referrers from the Redis leaderboard. Add a sign-out button. Never send AUTH_SECRET_KEY to the browser.</em></blockquote><p>Sign up once with your admin email (a tiny /signup page or the sign-up/email endpoint from the <a href="https://cloudhike.dev/docs/auth?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w1">Auth docs</a> works). Because the project already has Postgres, Auth uses its auth schema by default, so your users sit next to your signups and there&#39;s still nothing new to host. If you&#39;d rather sign in with GitHub or Google, the Auth card has a shared OAuth app you can switch on.</p><p>To check the data without leaving the editor, ask:</p><blockquote><em>Use the cloudhike query_database tool to show the 10 most recent signups and how many came from a referral.</em></blockquote><p>That runs read-only, so it’s safe to let the agent explore. You can also open the <strong>database explorer</strong> in the dashboard to browse the rows.</p><p>CloudHike doesn’t host apps yet (app hosting is coming soon), so we deploy the Next.js app to Vercel and keep the backend on CloudHike:</p><ol><li>Push the repo to GitHub. Check that .env.local is <strong>not</strong> in the commit.</li><li>Import the repo in Vercel.</li><li>Add the variables from .env.local under the project&#39;s Environment Variables, plus ADMIN_EMAIL and SUPPORT_EMAIL. In the CloudHike dashboard, <strong>Environment → Copy as .env</strong> gives you the whole file, so you don&#39;t have to retype it.</li><li>Deploy.</li></ol><p>A few production notes from the docs:</p><ul><li><strong>Keep the database pool small.</strong> DATABASE_URL already goes through a connection pooler (PgBouncer), but each serverless instance opens its own pool, so max: 5 matters.</li><li><strong>Free databases sleep.</strong> A Free database with no connections for 6 hours is stopped until you click <strong>Wake</strong> on the card. Pro databases are always on and run in their own container.</li><li><strong>Email limits.</strong> Free sends 100 emails a day and 3,000 a month. On Pro there’s no daily limit, 3,000 a month are included per project, and more cost $0.40 per 1,000. If your launch goes viral, that’s the limit you’ll hit first.</li><li><strong>Auth return sites.</strong> If you turn on “Require a verified email” or social sign-in, add your Vercel domain under <strong>Sites users can return to</strong> on the Auth card.</li></ul><p>Look back at what you didn’t do: you didn’t sign up for a Redis provider, configure SMTP, set up an auth service or copy connection strings between tabs. One MCP connection let the agent:</p><ul><li>create the project and deploy <strong>four services</strong>,</li><li>write the .env without showing secrets in chat,</li><li>read the real docs for each service before writing code,</li><li>inspect the schema and data with read-only tools.</li></ul><p>Everything shows up in one dashboard and comes out of one credit balance. If you outgrow Free, <strong>Pro is $10/month with $10 of usage credits included every month and 10 projects</strong>, and Scale is $29.99/month with unlimited projects. The details are on the <a href="https://cloudhike.dev/docs/plans-and-billing?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w1">plans and billing page</a>.</p><p>The whole build is the five prompts above, plus the optional query. Run them, tweak them, and see how far your agent gets.</p><p>👉 <a href="https://cloudhike.dev/?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=build_series_w1"><strong>Start free at cloudhike.dev</strong></a>. You get $10 in credits, no card required.</p><p>Next week: we put <strong>background jobs</strong> to work and build an AI app that runs slow work outside the request with retries and webhooks. Follow along so you don’t miss it.</p><p>If you try this one, tell me in the comments what your agent built, or where it got stuck. I read every comment.</p><p><em>Originally published on </em><a href="https://dev.to/cloudhike/build-a-referral-waitlist-with-your-ai-agent-postgres-auth-redis-and-email-over-one-mcp-1o5f"><em>DEV</em></a><em>.</em></p><p><em>Originally published at </em><a href="https://cloudhike.hashnode.dev/build-a-referral-waitlist-with-your-ai-agent-postgres-auth-redis-and-email-over-one-mcp-connection"><em>https://cloudhike.hashnode.dev</em></a><em> on October 26, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf8cda1e9ec8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CloudHike vs Supabase: the backend built for AI coding agents]]></title>
            <link>https://medium.com/@cloudhike/cloudhike-vs-supabase-the-backend-built-for-ai-coding-agents-e2fc99b4b2c4?source=rss-7d765af62d23------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2fc99b4b2c4</guid>
            <category><![CDATA[supabase]]></category>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[CloudHike Team]]></dc:creator>
            <pubDate>Mon, 26 Oct 2026 20:24:22 GMT</pubDate>
            <atom:updated>2026-10-26T20:27:15.979Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yzUXUpNGnlKAhEF0.png" /></figure><p><em>Disclosure: I built </em><a href="https://cloudhike.dev"><em>CloudHike</em></a><em>, so read this with that in mind. Supabase details come from Supabase’s own docs and pricing pages and were checked on October 26, 2026.</em></p><p>Your coding agent can write a whole app in an afternoon. Then it hits the backend and hands the work back to you: create a database, set up a bucket, find a Redis instance, pick an email provider, wire up a job runner, and paste a dozen secrets into .env.local without committing them.</p><p>Supabase and CloudHike both have MCP servers now, so in both cases the agent can help. But they were built for different jobs. Supabase is a mature Postgres platform that added MCP. <strong>CloudHike was designed from day one for the agent to set up the whole backend itself, in one prompt, with guardrails that keep it safe.</strong></p><ul><li><strong>Pick CloudHike</strong> if you build with Cursor, Claude Code or Codex and want your agent to set up Postgres, S3-compatible storage, Redis, auth, transactional email and background jobs in one go, write your .env for you, and keep it all on one dashboard and one bill.</li><li><strong>Pick Supabase</strong> if you need realtime, edge functions, social login, self-hosting or a long track record at scale.</li></ul><p><strong>1. One copy-paste and your agent is connected.</strong> Open <strong>Connect MCP</strong> in the dashboard, click <strong>Copy with key</strong>, paste the snippet into your editor. The server is remote (Streamable HTTP), so there’s nothing to install.</p><p><strong>2. The whole backend in one project.</strong> Every CloudHike project can deploy:</p><ul><li><strong>Postgres 16</strong> → DATABASE_URL</li><li><strong>S3-compatible storage</strong> (a private bucket with a key scoped to it)</li><li><strong>Auth</strong> (email and password, users stored in your project’s Postgres)</li><li><strong>Transactional email</strong> with custom domains and delivery logs</li><li><strong>Background jobs</strong> with retries and webhooks</li></ul><p>With Supabase, Redis isn’t built in ( <a href="https://supabase.com/docs/guides/functions">its own examples use Upstash</a>), and production email means <a href="https://supabase.com/docs/guides/auth/auth-smtp">bringing your own SMTP provider</a>. That’s more accounts, more keys and more bills for your agent (or you) to wire together. On CloudHike it’s one project, one dashboard, one credit balance.</p><p><strong>3. The agent writes your </strong><strong>.env.</strong> The get_environment tool returns the project&#39;s env values so the agent can write them straight into your git-ignored env file, without repeating them in chat. No more copying connection strings across five browser tabs.</p><p><strong>4. Guardrails that make agent access safe.</strong></p><ul><li>query_database <strong>always</strong> runs in a read-only transaction (one statement, 500 rows, 10 s timeout), on every plan.</li><li>Writing SQL (execute_sql) is Pro-only, runs in a single transaction, and is marked destructive, so your editor asks you first.</li><li><strong>No MCP tool can delete anything.</strong> Deleting projects and services only happens in the dashboard.</li><li>Every .env fetch and every SQL write goes to the audit log, and you can revoke the key with one click.</li></ul><p>Your agent gets enough power to build, and no way to wipe your data.</p><p><strong>5. Pricing you can explain in one line.</strong> New accounts get <strong>$10 in credits</strong> (eligible accounts, once per inbox, valid for 90 days), no card needed. <strong>Pro is $10/month with $10 of usage credits included every month and unlimited projects.</strong></p><p>Here’s the actual flow. Connect the server once.</p><p><strong>Claude Code</strong></p><pre>claude mcp add --transport http --scope user cloudhike https://cloudhike.dev/api/mcp \ --header &quot;Authorization: Bearer icu_your_api_key&quot;</pre><pre>{ &quot;mcpServers&quot;: { &quot;cloudhike&quot;: { &quot;url&quot;: &quot;https://cloudhike.dev/api/mcp&quot;, &quot;headers&quot;: { &quot;Authorization&quot;: &quot;Bearer icu_your_api_key&quot; } } } }</pre><p>Snippets for Codex, VS Code, Windsurf, Gemini CLI and Claude Desktop are in the <a href="https://cloudhike.dev/docs/mcp">MCP docs</a>.</p><p>Then open your app’s folder and paste this prompt (it’s straight from the docs):</p><blockquote><em>Use the cloudhike MCP tools to set up CloudHike.dev as the backend for this app.</em></blockquote><blockquote><em>Read the app first and deploy only the services it needs. Put the .env into the app’s git-ignored env file without showing me the values, then read the matching docs with get_docs and write the code that connects each service.</em></blockquote><p>What the agent does next:</p><ol><li>Reads your code and works out what the app needs, say Postgres, Auth, Storage and Redis.</li><li>Calls list_projects or create_project to get a project.</li><li>Calls deploy_services for exactly those services, then wait_for_services until they&#39;re ready.</li><li>Calls get_environment and writes the values to .env.local, making sure the file is git-ignored.</li><li>Calls get_docs for each service and writes the connection code, for example a pg pool for DATABASE_URL and a Redis client for REDIS_URL.</li></ol><p>You review the diff and run the app. One prompt, no dashboards. If your tool doesn’t support MCP, there’s also a <a href="https://cloudhike.dev/docs/build-with-ai">one-prompt flow</a> that points the agent at https://cloudhike.dev/prompt.md with a token that can only download that project&#39;s .env.</p><p>CloudHike vs Supabase at a glance:</p><ul><li>Agent setup over MCP: both have a remote MCP server; CloudHike is one copy-paste snippet with your key filled in.</li><li>Postgres, storage, auth: both include them (Supabase auth has more login options like social OAuth, MFA and SSO).</li><li>Redis: built into CloudHike (Redis 7); not built into Supabase.</li><li>Transactional email: built into CloudHike with custom domains and delivery logs; Supabase sends auth emails only and needs your own SMTP for production.</li><li>Background jobs: CloudHike Jobs with retries and webhooks; Supabase uses Queues + Cron + Edge Functions.</li><li>Safety over MCP: CloudHike SQL is always read-only and no MCP tool can delete anything; Supabase read-only is optional.</li><li>Paid plan: CloudHike Pro is $10/mo with $10 usage credits and unlimited projects; Supabase Pro starts at $25/month with $10 compute credits.</li><li>Where Supabase leads: realtime, Edge Functions, open source and self-hosting.</li></ul><p>CloudHike’s model is simple: everything (Postgres, storage, Redis, email, jobs) runs from one credit balance, billed by the hour. Sign up and you get <strong>$10 in credits</strong>, no card. Free covers 2 projects with a 500 MB database, 500 MB of storage, 32 MB of Redis, 100 emails a day and 500 job runs a day.</p><p><strong>Pro is $10/month</strong> and includes <strong>$10 of usage credits every month</strong>, <strong>unlimited projects</strong>, a dedicated Postgres container per project, no idle sleep and up to 30 days of backups. Usage beyond the included credits is metered at the rates on the <a href="https://cloudhike.dev/docs/plans-and-billing">plans and billing page</a>, and you can set a monthly spend cap. If you hit it, services pause. <strong>Nothing is deleted.</strong></p><p>The bigger saving is what you don’t have to add. On Supabase ( <a href="https://supabase.com/pricing">pricing</a>), Pro starts at $25/month, and Redis and production email are separate services with their own accounts, keys and bills. On CloudHike they’re already in the project your agent just created.</p><p>To be fair, Supabase is excellent and is the better choice if you need:</p><ul><li><strong>Realtime and Edge Functions</strong>, which CloudHike doesn’t offer today.</li><li><strong>Broader auth</strong>: social logins, magic links, MFA, SSO.</li><li><strong>Open source and self-hosting.</strong></li><li><strong>Maturity and ecosystem</strong>: compliance options, bigger compute, branching, and a larger MCP toolset (migrations, advisors, type generation).</li></ul><p>Supabase pricing and MCP tools are from their pages as of October 26, 2026, and both change often. I didn’t benchmark performance or latency here.</p><p>If you build with Cursor, Claude Code or Codex, the fastest way to see the difference is to try it: sign up, copy the MCP snippet, and paste the prompt above into your agent. You start with <strong>$10 in free credits</strong>, no credit card required.</p><p>👉 <a href="https://cloudhike.dev/?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=vs_supabase"><strong>Get started at cloudhike.dev</strong></a></p><p>CloudHike is new and I’m building it in public. If you try it, tell me in the comments what your agent built, or where it got stuck. I read every comment.</p><p><em>Originally published on </em><a href="https://dev.to/cloudhike/cloudhike-vs-supabase-the-backend-built-for-ai-coding-agents-3pjp"><em>DEV</em></a><em>.</em></p><p><em>Originally published at </em><a href="https://cloudhike.hashnode.dev/cloudhike-vs-supabase-the-backend-built-for-ai-coding-agents"><em>https://cloudhike.hashnode.dev</em></a><em> on October 26, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2fc99b4b2c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I built CloudHike: a backend your AI coding agent can set up over MCP]]></title>
            <link>https://medium.com/@cloudhike/i-built-cloudhike-a-backend-your-ai-coding-agent-can-set-up-over-mcp-9dce076e6f89?source=rss-7d765af62d23------2</link>
            <guid isPermaLink="false">https://medium.com/p/9dce076e6f89</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[CloudHike Team]]></dc:creator>
            <pubDate>Mon, 26 Oct 2026 19:29:04 GMT</pubDate>
            <atom:updated>2026-10-26T19:34:04.588Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*URt-AMhyULsLPq8G.jpg" /></figure><p>My AI agent can write a whole Next.js app in an afternoon. Then it stops and hands the hard part back to me: make a Postgres database, set up a storage bucket, find a Redis instance, add auth, pick an email provider, and copy a dozen connection strings into .env.local without committing any of them.</p><p>That’s five dashboards, five sets of keys and five bills, and the agent can’t help with any of it. I kept losing my momentum at exactly that point, so I built <strong>CloudHike</strong>.</p><p>I run the <a href="https://www.youtube.com/@tubeguruji">TubeGuruji</a> YouTube channel, where I make full-stack tutorials. A big part of every tutorial is the “now go sign up for these services” section. Lately most of my building happens with Cursor and Claude Code, and the backend setup has become the slowest part of the whole process. CloudHike is my attempt to fix that for myself, and hopefully for you. I’m building it solo.</p><p><a href="https://cloudhike.dev">CloudHike</a> is a backend-as-a-service built for people who code with AI agents. Each project can have:</p><ul><li><strong>Postgres</strong> (Postgres 16) → DATABASE_URL</li><li><strong>S3-compatible storage</strong> (a private bucket with a key scoped to that bucket) → S3_ENDPOINT, S3_BUCKET, ...</li><li><strong>Redis</strong> (Redis 7) for caching, queues and rate limits → REDIS_URL</li><li><strong>Auth</strong>: email and password sign-up and login, with the users stored in your project’s Postgres</li><li><strong>Transactional email</strong> with custom domains and delivery logs</li><li><strong>Background jobs</strong> with retries and webhooks</li></ul><p>It all lives in one dashboard and comes out of one credit balance. Each project is isolated, so one project can never reach another. App hosting is coming soon, but it isn’t live yet.</p><p>The part I care about most is the remote MCP server. Once you add it to your editor, your agent can do the backend setup itself.</p><p>You get the workspace API key from <strong>Connect MCP</strong> in the dashboard sidebar. Click <strong>Copy with key</strong> and the snippet comes with your key already filled in.</p><p>Server URL: <a href="https://cloudhike.dev/api/mcp">https://cloudhike.dev/api/mcp</a></p><p>Transport: Streamable HTTP (remote, nothing to install)</p><p>Auth: Authorization: Bearer &lt;workspace API key&gt;</p><p><strong>Claude Code</strong></p><pre>claude mcp add --transport http --scope user cloudhike https://cloudhike.dev/api/mcp \ --header &quot;Authorization: Bearer icu_your_api_key&quot;</pre><p>Then run /mcp inside Claude Code to check that it&#39;s connected.</p><pre>{ &quot;mcpServers&quot;: { &quot;cloudhike&quot;: { &quot;url&quot;: &quot;https://cloudhike.dev/api/mcp&quot;, &quot;headers&quot;: { &quot;Authorization&quot;: &quot;Bearer icu_your_api_key&quot; } } } }</pre><p>Open Cursor Settings → MCP and look for the green dot. The <a href="https://cloudhike.dev/docs/mcp">MCP docs</a> also have snippets for Codex, VS Code, Windsurf, Gemini CLI and Claude Desktop.</p><h3>What the agent can actually do</h3><p>These are the tools the server exposes:</p><ul><li>list_projects, create_project, get_project: find or create a project</li><li>deploy_services: deploy postgres, auth, storage, redis, jobs or email, with the same plan and billing checks as the dashboard</li><li>wait_for_services: wait until the services are ready before writing any code against them</li><li>get_environment: get the project&#39;s .env so the agent can write it to your git-ignored env file</li><li>list_tables, describe_table, query_database: look at your schema and run read-only SQL</li><li>list_storage_files: browse the bucket</li><li>get_docs: read any CloudHike docs page as Markdown</li></ul><p>There are a few guardrails I cared about. query_database always runs in a read-only transaction. Writing SQL ( execute_sql) is Pro-only, runs in a single transaction, and is marked destructive so your editor asks you first. <strong>Nothing can be deleted through MCP.</strong> Deleting projects and services only happens in the dashboard. Every .env fetch and every SQL write goes to the audit log, and you can revoke the key with one click.</p><p>With the server connected, open your app’s folder and paste this prompt (it’s from the docs):</p><blockquote><em>Use the cloudhike MCP tools to set up CloudHike.dev as the backend for this app.</em></blockquote><blockquote><em>Read the app first and deploy only the services it needs. Put the .env into the app’s git-ignored env file without showing me the values, then read the matching docs with get_docs and write the code that connects each service.</em></blockquote><p>Here’s what the agent then does:</p><ol><li>Reads your code and works out what the app needs, say Postgres, Auth and Storage.</li><li>Calls list_projects or create_project to get a project.</li><li>Calls deploy_services for those three, then wait_for_services until they&#39;re ready.</li><li>Calls get_environment and writes the values to .env.local, making sure the file is git-ignored.</li><li>Calls get_docs for the matching pages and writes the connection code, for example a pg pool for DATABASE_URL.</li></ol><p>You review the diff and run the app. You still own the code, so read what it changed. The point is that you no longer need five browser tabs.</p><p>If your tool doesn’t support MCP, there’s also a <a href="https://cloudhike.dev/docs/build-with-ai">one-prompt flow</a>. You paste a prompt that points the agent at https://cloudhike.dev/prompt.md, together with a token that can only download that project&#39;s .env.</p><p>I wanted this to be simple:</p><ul><li><strong>Free</strong>: every new account gets <strong>$10 in credits</strong> at signup, no credit card required. The credits last 90 days, and Free includes 2 projects.</li><li><strong>Pro</strong>: <strong>$10/month</strong>, which includes <strong>$10 in usage credits</strong> every month and <strong>unlimited projects</strong>, plus a dedicated Postgres container per project, live-resizable Redis and no database sleep.</li></ul><p>Services are billed by the hour from credits. You can set a monthly spend cap in Settings, and if you run out of credits, nothing gets deleted. The full meter rates are on the <a href="https://cloudhike.dev/docs/plans-and-billing">Plans and billing page</a>.</p><p>App hosting (deploy from GitHub, Docker or a template, with an HTTPS address) is the next big piece. CloudHike is new and I’m building it in public, so I’d really like your feedback:</p><ul><li>Does the MCP flow work in your editor? Where does it break?</li><li>Which tool is missing that your agent keeps asking for?</li><li>Is the pricing clear?</li></ul><p>Try it at <a href="https://cloudhike.dev"><strong>cloudhike.dev</strong></a> and tell me in the comments what you built, or what got in your way. I read every comment.</p><p><em>Originally published on </em><a href="https://dev.to/cloudhike/i-built-cloudhike-a-backend-your-ai-coding-agent-can-set-up-over-mcp-4lco"><em>DEV</em></a><em>.</em></p><p><em>Originally published at </em><a href="https://cloudhike.hashnode.dev/i-built-cloudhike-a-backend-your-ai-coding-agent-can-set-up-over-mcp"><em>https://cloudhike.hashnode.dev</em></a><em> on October 26, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dce076e6f89" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>