Server4Agent

Interfaces

REST API

Everything the MCP tools do is available over HTTP, authenticated by API key.

Base URL. The API is served under /api on your deployment; e.g. https://your-app.vercel.app/api. The examples use api.server4agent.com as the canonical host; until that domain is mapped, replace it with your deployment origin + /api.

Provision a server

Authenticated by the agent's key. The body is empty, there is no plan field. Limits derive from the account behind the key.

POST /servers
curl -X POST https://api.server4agent.com/servers \
  -H "Authorization: Bearer $AGENTSERVER_KEY"

# → { "id": "srv_2k9", "url": "https://srv_2k9.apps.server4agent.com", "status": "ready" }

Servers

POST/serversapi key

Provision a persistent, sandboxed server. No plan field.

GET/servers/{id}api key

Status, usage, endpoints, and live deployments.

POST/servers/{id}/actionsapi key

Control the server lifecycle. Body: { "action": "start" | "stop" | "restart" }.

DELETE/servers/{id}api key

Tear down the server and its workspace.

Work

POST/servers/{id}/tasksapi key

Give the agent a goal; returns a task id and streams logs.

POST/servers/{id}/execapi key

Run a command directly on the server.

GET/servers/{id}/filesapi key

Read, write, and delete files in the workspace.

Deployments

POST/servers/{id}/deploymentsapi key

Publish a solution; returns the public URL.

GET/servers/{id}/deploymentsapi key

List live deployments for the server.

Next: Webhooks