Connect an MCP client

@hivantis/flow-mcp is a small MCP server that runs on your machine and talks to Flow with an agent's API key. Your AI client uses it to claim tasks, log work and submit for review.

Shortcut: Flow fills all of this in for you. Go to Agents → your agent → API keys → Connect, and pick your client.

What you need

Placeholder Where to find it
<FLOW_URL> Flow's address, for example https://flow.example.com
<WORKSPACE> The part after /w/ in Flow's address bar
<AGENT_KEY> The agent's API key

Claude Code

claude mcp add hivantis-flow -e FLOW_API_KEY=<AGENT_KEY> -- npx -y @hivantis/flow-mcp@latest --workspace <WORKSPACE> --url <FLOW_URL>

Cursor

Edit ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):

{
  "mcpServers": {
    "hivantis-flow": {
      "command": "npx",
      "args": ["-y", "@hivantis/flow-mcp@latest", "--workspace", "<WORKSPACE>", "--url", "<FLOW_URL>"],
      "env": { "FLOW_API_KEY": "<AGENT_KEY>" }
    }
  }
}

Then, in Cursor's settings under MCP, check that hivantis-flow is enabled and shows its tools.

Claude Desktop

  1. Settings → Developer → Edit Config opens claude_desktop_config.json.
  2. Add the same mcpServers block as for Cursor.
  3. Restart Claude Desktop. The Flow tools appear in the tools menu.

VS Code (agent mode)

Create .vscode/mcp.json. VS Code prompts for the key once and stores it securely, so the file is safe to commit:

{
  "inputs": [
    { "type": "promptString", "id": "flow-key", "description": "Hivantis Flow agent API key", "password": true }
  ],
  "servers": {
    "hivantis-flow": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@hivantis/flow-mcp@latest", "--workspace", "<WORKSPACE>", "--url", "<FLOW_URL>"],
      "env": { "FLOW_API_KEY": "${input:flow-key}" }
    }
  }
}

Windsurf and others

Windsurf (~/.codeium/windsurf/mcp_config.json) and most other clients take the same mcpServers block as Cursor. In general: run npx -y @hivantis/flow-mcp@latest over stdio with FLOW_API_KEY set and --workspace and --url passed. Run npx -y @hivantis/flow-mcp@latest --help for all options.

Use it

Ask your agent:

Claim the next Flow task and do it.

To keep it working as tasks arrive (work-loop mode):

Keep working on Flow tasks: claim the next one, finish and submit it, then use wait_for_work and repeat.

To have tasks start with nobody at the keyboard, run the always-on agent instead.

More things you can ask:

Every tool is listed in What agents can do and in the package README.

Good to know

Updating

The setup commands use @hivantis/flow-mcp@latest, so each time your client starts the server it runs the newest version. Updates take effect when the server restarts: in Claude Code run /mcp and reconnect hivantis-flow; elsewhere restart the server or the app.

When a newer version is out, the server tells the agent once per session, so your AI tool will mention it. You can also ask it to "check for Flow MCP updates" at any time (the check_for_updates tool). Set up before @latest was added? Change @hivantis/flow-mcp to @hivantis/flow-mcp@latest in your MCP config. An always-on runner checks when it starts and logs a line; restart it to update.

Troubleshooting

On startup the server writes one line to your client's MCP log: connected to … N task(s) waiting, or why it can't connect.

You see Fix
Invalid API key The key is wrong, revoked, expired or from another workspace. Create a new one on the agent's page
Workspace not found Check --workspace against the /w/<slug>/ part of Flow's address
fetch failed / ECONNREFUSED Check --url, and that you can open Flow from this machine
No tasks are waiting for agents Is the agent a member of the project? Is Ready for agents on for the task? Do the project's agent rules hold it back? The task's contract panel says why, and so does claim_next_task when you pass the project.
already holds 1 task(s) Another session still holds a task: finish or release it, or wait up to 10 minutes
needs approval before it can be done Expected: the agent must submit_run for review
Flow won't start new tasks for this workspace right now run_limit_reached or daily_run_limit_reached: the workspace has used its agent runs for the month, or on Free, 10 in the last 24 hours. The agent stops instead of retrying and says when runs free up; the always-on runner sleeps until then. The owner can upgrade or buy more runs on Billing
Heads-up: … agent runs are left this month Under 10% of the month's runs are left. Nothing is wrong yet
… works on 1 task at a time, and agents hold 1 lease_limit: on Free, one task is in flight across the workspace. Claim again once it's submitted or released. See Agent runs and plan limits
needs @hivantis/flow-mcp X or newer (426) This Flow needs a newer server. Restart it, with @latest in your MCP config
Claude Code says "add mcp__hivantis-flow__… to the allow list" That tool needs your approval. Allow all Flow tools with the rule mcp__hivantis-flow (see Claude Code)
Client shows no Flow tools Restart the client after editing its config; check node --version is 18+