How to provision a server with an AI agent
How to provision a server with an AI agent
This guide provisions a public server on Quake AI by driving an AI coding assistant, rather than clicking through the Console. It reaches the same result as the Quickstart: a running instance you can reach over SSH at a public IP. The difference is the path. You prompt your assistant, it retrieves an OpenTofu template from the hosted MCP server, you review the generated configuration, and you apply it with your own credentials.
You stay in control of every change to your cloud. The assistant drafts the infrastructure code; you read it and run tofu apply yourself.
Before you start#
- An AI coding assistant with the Quake AI MCP server connected. Follow How to connect AI tools to Quake AI docs first. Cursor, Claude Desktop, Claude Code, and VS Code (Copilot agent mode) all work.
- OpenTofu (or Terraform) installed on your workstation.
- A Quake AI account with app credentials generated and sourced in your shell.
- An SSH keypair already uploaded to your project. You pass its name to the template.
How the flow works#
The assistant does not reach your cloud. It retrieves a template and generates configuration text. The connection to your project happens only when you run tofu apply against your sourced credentials.
1. Prompt your assistant#
In your assistant's chat, ask it to provision a server. A direct request is enough:
Provision a public web server on Quake AI using OpenTofu. Pull the template from the Quake AI MCP server.
The assistant calls the MCP server's get_template tool for the compute service. The server returns the simple-vm template, which the assistant uses to write a working OpenTofu configuration into your project. For the tool's inputs and return shape, see the AI tools reference.
2. Review the generated configuration#
The simple-vm template provisions:
- A private network, subnet, and router connected to the
PublicStaticexternal network. - A security group that allows inbound SSH (TCP 22) and HTTP (TCP 80) from any address.
- A boot-from-volume instance (20 GiB volume,
Ubuntu-24.04,s1a.smallflavor by default). - A floating IP from the
PublicStaticpool, associated with the instance.
Confirm two values before applying:
key_namematches an SSH keypair that already exists in your project. The template requires it and has no default.- The flavor and image suit your needs. The defaults are
s1a.smallandUbuntu-24.04; ask the assistant to change them if you want something else.
If you want a tighter SSH rule, ask the assistant to restrict the security group's SSH source to your workstation's public address instead of 0.0.0.0/0.
3. Apply the configuration#
With your credentials sourced, initialize and apply from the template directory:
tofu init
tofu plan
tofu applyReview the plan output, then type yes to confirm. OpenTofu prints the instance's public address as the floating_ip output when the apply completes.
4. Connect to the server#
Use the floating_ip value to connect:
ssh ubuntu@FLOATING_IPReplace FLOATING_IP with the address from the apply output. Type yes to accept the host key. Your prompt changes to the instance hostname, which confirms the server is up and reachable. To serve a page from it, follow step 5 of the Quickstart.
5. Clean up#
A public server should not run unattended. Remove everything the template created:
tofu destroyType yes to confirm. OpenTofu removes the instance, floating IP, security group, router, subnet, and network.
Next steps#
- Launch handoff: declare an application in
quake.yaml, validate it through the MCP server, and produce a handoff packet for deployment. - Quickstart: the same outcome by hand, through the Console, CLI, or OpenTofu.
- Simple VM template: the full reference for the template the assistant retrieves.
- Automation how-tos: IaC patterns, CI integration, and template usage.
Usage Guidelines
The sample code, software libraries, command line tools, proofs of concept, templates, and other related technology on this page (including any of the foregoing that is provided by Quake AI personnel) is provided to you as Quake AI Content under the Quake AI Customer Agreement, or the relevant written agreement between you and Quake AI (whichever applies). Do not use this Quake AI Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the Quake AI Content (such as sample code) as appropriate for production grade use based on your specific quality control practices and standards. Deploying Quake AI Content may incur Quake AI charges for creating or using Quake AI chargeable resources, such as running Compute instances or storing data in Object Storage. Your use is also subject to the Acceptable Use Policy.
For the full policy, see Usage Guidelines.