Use Tanzahost from Cursor and Claude Code
Connect Cursor or Claude Code to Tanzahost, then ask your AI to deploy an app, find why a build failed, set variables and read the logs.
Updated 22 Oct 20264 min read
Your AI coding tool can deploy to Tanzahost for you. Copy one prompt from the dashboard into Cursor or Claude Code, and it connects itself to Tanzahost's MCP server, with nothing to install. Then ask in plain words: "deploy this", "why did the build fail?", "set MAIL_FROM". The AI does it with the token's permissions, and can never delete anything, change DNS or spend your money.
This guide follows Asha. Her Laravel shop duka already runs in her project duka, in UK-01 · United Kingdom. She wants a small promotion page beside it, made with her AI tool, and she wants the AI to look after her shop's deploys.
Step 1: make your prompt
In the dashboard, open your account, then Developers. Only an account's owners see it.
Find Connect your AI coding tool.
Under What it may do, keep Deploy, and choose the project duka.
Choose Make my prompt, then Copy the prompt.
The prompt holds a new token, shown once and ending after 90 days. A token limited to duka can't see or touch any other project. With Deploy, the AI can add apps to duka, deploy them and set their variables, but can't create projects.
Step 2: paste it into your AI tool
Asha opens Claude Code in her promotion page's folder and pastes the prompt. Claude Code runs the one command the prompt gives it, claude mcp add, for her user, so Tanzahost is there in every project. In Cursor, the AI adds the server to ~/.cursor/mcp.json in her home folder instead.
The prompt tells the AI never to write the token into the project's files or commit it. It ends by listing her projects, to check that the connection works. In Claude Code, /mcp shows tanzahost as connected; in Cursor, it's in the MCP settings with its tools.
Rather set it up yourself, or using another tool? Every config format is in AI coding tools.
Step 3: check the connection
Ask:
Which Tanzahost account am I connected to, and what can you do there?The AI calls whoami and list_projects. It answers with the account, the token's scope (deploy), and the project duka with its apps.
Step 4: deploy a new app
Asha has her AI make a one-page promotion site in a folder called promo, with an index.html and a stylesheet. Then she asks:
Add an app called promo to my Tanzahost project duka, deploy the promo folder to it,
and tell me its address when it's live.The AI calls create_app, then deploy_files with the folder's files, then deploy_status until the deploy is live. We detect that it's a static site and build it. The AI gives her the app's free address on tanzahost.co.
deploy_files takes up to 8 MB and 2,000 files. That's plenty for a small site, but not for a big app with its packages. For those, deploy from GitHub or from the dashboard, then let the AI rebuild with deploy.
Step 5: find why a build failed
A change to duka doesn't go live. Asha asks:
The last deploy of duka didn't go live. Find out why and tell me how to fix it.The AI calls deploy_status to find the failed build or deploy, then build_log or deploy_log to read its output. If the build failed, the log shows the command and its error, like a missing PHP extension or a package that didn't install. If the deploy failed, the log shows the health check: what the new version answered, and why it didn't go live. Meanwhile the version before keeps serving, so her shop stays up.
Once the code is fixed, she asks it to "deploy duka again", and it calls deploy. To go back instead, she asks it to "roll duka back to the build before", and it calls deploy with that build.
Step 6: variables and logs
Set MAIL_FROM_ADDRESS to orders@duka.co.tz on duka, and apply it.The AI calls set_variables, then restart_app with redeploy, so the new value applies without downtime. It can list variables' names with list_variables, but never sees their values.
Show me duka's errors from its logs, and explain the most common one.The AI calls read_logs with the error level, and reads up to 200 of the newest lines.
What your AI can't do
If Asha asks the AI to delete the promo app, empty a database, change a DNS record or top up the wallet, it can't: there's no tool for it, and Tanzahost refuses those calls from AI tools anyway. She does those in the dashboard. Removing a variable is in the dashboard too.
To see what the AI did, she opens Activity: each change says "Asha, through an AI tool". The token's Calls list under Developers shows every call of the last 90 days. To stop the AI at once, she chooses Revoke on its token.
Next
The Tanzahost API: tokens, scopes and webhooks.
The command-line tool: deploy from your terminal or from CI.
Deploying and rolling back: what happens in each build and deploy.