Skip to content

How to provision a server with an AI agent

How-to

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#

How the flow works#

Agent-driven provisioning loopYou prompt your assistant. The assistant calls the get_template tool on the Quake AI MCP server, which returns the simple-vm OpenTofu template. The assistant returns the generated configuration to you. You review the HCL, then run tofu apply against your own project to provision the server and its floating IP.Your Quake AIprojectQuake AI MCPserverAI assistantYouYour Quake AIprojectQuake AI MCPserverAI assistantYou"Provision a public web server"get_template (service:compute)simple-vm OpenTofugenerated configurationreview the HCLtofu applyrunning server + floating IPClick to zoom
The agent-driven provisioning loop: you prompt, the assistant retrieves the template, you review, you apply

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 PublicStatic external 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.small flavor by default).
  • A floating IP from the PublicStatic pool, associated with the instance.

Confirm two values before applying:

  • key_name matches 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.small and Ubuntu-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:

bash
tofu init
tofu plan
tofu apply

Review 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:

bash
ssh ubuntu@FLOATING_IP

Replace 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:

bash
tofu destroy

Type 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.

Was this page helpful?