Run your own server
Most people use the Vitals for AI service and never need this page. If you would rather keep your encrypted health summaries in your own Cloudflare account, you can deploy your own copy of the server and point the app at it. The server is open source, and the free plan is enough for one person.
What you need
- A Cloudflare account. The free plan is enough.
- A GitHub account: one-click deploy copies the code into it.
- Vitals for AI from the App Store.
Step 1: Deploy the server
Use the button below, sign in to Cloudflare, connect GitHub when asked, and keep the default names. Cloudflare creates the database and key-value store and deploys the server.
Deploy to Cloudflare View source
Or deploy from a terminal:
git clone https://github.com/mengchangfeng/vitals-for-ai-server
cd vitals-for-ai-server
npm install
npx wrangler login
npm run deploy
When it finishes you have an address like the one below. Open it in a browser: a page titled “Vitals for AI” that names the MCP endpoint means it worked.
https://vitals-for-ai.<your-subdomain>.workers.dev
Step 2: Point the app at your server
- In the app, open Settings › Server and choose “Your own server”. If you are not signed in yet, tap “Use your own server” on the sign-in screen.
- Enter the address from step 1, tap “Connect to this server”, and confirm.
- Sign in with Apple. The first person to sign in becomes the owner; after that no other Apple Account can create an account on it.
- Wait for the first sync to finish.
Step 3: Connect your AI apps
Exactly as with the hosted service, but with your own address: add a custom MCP server in the AI app using your server address followed by /mcp, choose OAuth, then scan the code with the app to approve. The Connections tab in the app shows this address and lets you copy it.
https://vitals-for-ai.<your-subdomain>.workers.dev/mcp
What switching servers does
- Switching signs you out.
- Nothing moves: data and connections on the server you left stay there, and are usable again when you switch back and sign in.
- Each server has its own encryption key, kept in your iPhone’s keychain.
- To erase what is on a server, switch to it, sign in, and use Settings › Delete account and data.
Keeping it up to date
A newer app may need a newer server; the app tells you when the server is too old. To update, bring the latest changes from the source repository into your copy and deploy again. If you used the button, Cloudflare redeploys whenever your GitHub copy changes. The database upgrades itself on first use.
Security notes
- This is not end-to-end encryption. The server stores ciphertext only, but while answering an AI app it decrypts, in memory, the categories you shared. On your own server that happens on your infrastructure instead of ours.
- Whoever controls the Cloudflare account controls the server. Turn on two-factor sign-in for it.
- Only enter the address of a server you control in the app.
- Leave DEV_AUTH_SECRET unset. It enables a sign-in route meant only for local testing.
- By default only one person can use the server. To share it with family, set SINGLE_USER to "false" in the configuration and deploy again.
Who is responsible
When you use your own server, your health data is not sent to Nagakaze, and you are responsible for the server’s security, availability and the data on it. We cannot see, restore or delete anything stored there. Report security problems to support@nagakaze.com.