Skip to main content

Agentic DevOps

This tutorial shows how to let an AI agent (Claude, Cursor, VS Code, …) operate Pergola for you: inspect Projects, deploy, read logs, manage configuration and more. It uses two pieces:

  • The Pergola MCP server, started by pergola mcp serve, which exposes Pergola operations as Model Context Protocol tools.
  • The Pergola Skills, a set of instructions that teach your agent how and when to use those tools.
Experimental

The MCP server is experimental. The set of tools and their behaviour may still change.

Preparation

What you need:

  • The Pergola CLI installed and logged in (pergola login). The MCP server reuses the active CLI configuration and authenticates non-interactively, so you must be logged in first.
  • An MCP-capable agent, e.g. Claude (Desktop / Code), Cursor or the VS Code MCP integration.

Step 1: Register the MCP server with your agent

The server speaks JSON-RPC over stdio and is launched as pergola mcp serve. Most MCP clients are configured with a JSON block like the following:

{
"mcpServers": {
"pergola": {
"command": "pergola",
"args": ["mcp", "serve"]
}
}
}

The exact location of this configuration depends on your client (for example a mcp.json / settings file). Refer to your client's documentation for where to put it.

Once registered, your agent can call the pergola tools. You do not run pergola mcp serve yourself, the client starts and stops it as needed.

Step 2: Install the Pergola Skills

The Skills give the agent the workflows and guard-rails for Pergola, so it picks the right tool and follows the recommended procedure. Download them from:

https://get.pergo.la/ai/agent-skills

The bundle contains three skills:

  • pergola-mcp — operate Pergola via the MCP tools (read, inspect, deploy, mutate). Preferred whenever the MCP tools are available.
  • pergola-cli — for tasks that need the shell binary, e.g. pergola login, access keys, CLI profiles, private-repo credentials.
  • pergola-manifest — author, validate and debug pergola.yaml Project Manifests.

Install or copy the skill directories into your agent's skills directory (the location depends on your agent).

Step 3: Let the agent work

With the MCP server registered and the Skills installed, just ask your agent in plain language. For example:

Use the pergola-mcp init tool to pergolize this project
Use the pergola-mcp to list my projects and show the status of the components on my dev stage
Use the pergola-mcp skill to deploy the latest build of my-project to the dev stage and wait until the release is healthy
Use the pergola-manifest skill to create another pergola.yaml for this repository and then validate it
info

Often, it is enough to tell the agent once, to use the pergola MCP and after that, the agent understands the context when you ask for projects, stages, builds etc.

The agent will call the corresponding pergola MCP tools (for example to list Projects, push a Build, trigger a Release, or read logs) and report back.

See also