Skip to content

Blog / Guides

Connect an agent to Opsline over MCP

Let Claude Code, Cursor, or your own agent start workflows and follow them. People still decide the approvals.

Opsline · November 20, 2026 · 1 min read

Opsline runs an MCP server, so an agent can list your workflows, start runs, and check on them with the same API key a script would use.

1. Create an API key

In Settings, under API keys, create a key for the agent. It's shown once, so copy it somewhere safe.

2. Add the server to your client

{
  "mcpServers": {
    "opsline": {
      "url": "https://your-opsline.example/api/mcp",
      "headers": { "Authorization": "Bearer opslk_..." }
    }
  }
}

3. What the agent can do

  • list_workflows returns each workflow and the inputs it accepts.
  • start_run starts a workflow, checking the input against its request form.
  • get_run returns the run's state, each step's latest result, and any approvals it's waiting on.
  • list_runs and list_pending_approvals show recent runs and what's waiting on people.

What it can't do

There is no tool for deciding an approval. When a run waits on a person, get_run says who it's waiting on and links to the run, so the agent can tell the user.

Plain HTTP works too

The same operations are available at /api/v1. Start a run with POST /api/v1/runs and a body of { "workflow": "<slug>", "input": { ... } }, then follow it at GET /api/v1/runs/<id>.