Use Case
Host MCP servers on self-provisioned VMs.
MCP (Model Context Protocol) servers give AI agents access to tools, data, and services. Most MCP hosting guides focus on serverless platforms like Cloud Run or Cloudflare Workers. But many MCP servers need full system access — and agents need to provision and manage them autonomously.
Agent Cloud gives you both: full Linux VMs where any MCP server can run, provisioned by the agent itself via API.
Why host MCP servers on VMs
- Full system access. MCP servers that interact with filesystems, databases, system tools, or local processes need more than a serverless function. A VM gives you root access to install anything.
- Persistent connections. MCP uses long-lived connections between client and server. VMs maintain state across requests without cold start penalties or connection timeouts.
- Multiple MCP servers on one host. Run several MCP servers on a single VM — filesystem, database, search, custom tools — all accessible to the same agent session.
- Agent-managed lifecycle. The agent provisions the VM, installs the MCP server, uses it, and tears it down when done. No human infra management required.
The flow
An agent can set up its own MCP server infrastructure in three steps:
1. Provision a VM
# Agent provisions a VM for the MCP server
curl -X POST https://api-agentcloud.asitest.dev/v1/instances \
-H "authorization: Bearer ${API_KEY}" \
-H "content-type: application/json" \
-d '{
"project_id": "prj_123",
"name": "mcp-server",
"region": "akl1",
"image": "ubuntu-24.04",
"size": "micro"
}'2. Install MCP servers
# SSH into the VM and install your MCP server
ssh root@203.0.113.10
# Example: install a filesystem MCP server
npm install -g @anthropic/mcp-server-filesystem
# Or any MCP server from the registry
npx @anthropic/mcp-server-github
npx @anthropic/mcp-server-postgres
npx @anthropic/mcp-server-brave-search3. Connect and use
Point your MCP client at the VM's IP address. The agent can now use the MCP server's tools directly. When the task is done, the agent deletes the instance via API.
MCP servers that work well on VMs
| MCP Server Type | Why a VM Helps |
|---|---|
| Filesystem servers | Full disk access, persistent storage, no sandboxing restrictions |
| Database servers (Postgres, SQLite) | Run the database on the same VM as the MCP server |
| Browser automation (Puppeteer, Playwright) | Headless browsers need real system resources |
| Code execution servers | Install any language runtime, compiler, or tool |
| Custom/private MCP servers | Deploy proprietary tools without exposing source to a third party |
Compared to serverless MCP hosting
| Factor | Serverless (Cloud Run, Workers) | Agent Cloud VMs |
|---|---|---|
| Boot time | Fast cold starts | Minutes (full VM) |
| System access | Limited (container or isolate) | Full root, SSH, any binary |
| Persistent state | External storage required | Local disk on the VM |
| Multiple servers | One function per deployment | Run many MCP servers on one VM |
| Agent self-provisioning | Not supported | Agent provisions via API |
| Cost model | Per-request / per-second | Per-VM, predictable |
Serverless is great for lightweight, stateless MCP servers. VMs are better when MCP servers need system access, persistent state, or agent-managed lifecycle.
Get started
The Agent Cloud sandbox is free and requires no credit card. Your agent (or you) can provision a VM, install MCP servers, and start using them in minutes.