Skip to main content
The Runflow MCP server is a thin, stateless proxy that exposes the Runflow API to any Model Context Protocol client. Bring your own rf_live_* key, point your agent at mcp.runflow.io, and you have:
  • A generate tool that runs any Runflow model or Solution and waits for the result.
  • A list_models tool that filters the live catalog.
  • One /runflow:<slug> slash command per active Solution, auto-generated from the catalog.
  • The Runflow agent skill returned as MCP initialize instructions, so the Solutions-first decision rule is in context for the whole session.
The MCP server is the fastest path for agents that already speak MCP. If your runtime does not speak MCP, integrate via the regular REST API — the MCP server is a convenience layer, not a different product.

Connect in 30 seconds

Get an rf_live_* key from the dashboard under Settings → API keys. Service keys (rf_svc_*) are not accepted — only rf_live_* can dispatch runs.
Claude Code, Cursor, and VS Code do not currently substitute ${VAR} (or ${env:VAR}) inside MCP HTTP-transport headers. The literal string is sent and the server returns 401. Until the clients ship support (claude-code#6204, #51581, Cursor forum 79296), the working paths are: paste your rf_live_… key directly into the config file and keep it out of version control (gitignore it, never commit it), OR use a stdio wrapper like mcp-remote that does honour env vars.

Claude Code

Easiest reliable path is the stdio wrapper. Add to ~/.claude/config.json:
mcp-remote substitutes ${RUNFLOW_API_KEY} from the env block before opening the HTTPS connection. If you prefer the direct HTTP transport, paste the literal key:
Add the config file to .gitignore if it lives inside a project. Never commit a literal key.

Cursor

Same constraint as Claude Code. Add to ~/.cursor/mcp.json:
~/.cursor/mcp.json is user-scoped (not committed). If you want a project-scoped config, prefer the mcp-remote stdio pattern shown above so the key can live in a process env var instead of a JSON file.

VS Code MCP

Use the VS Code MCP extension’s HTTP transport with URL https://mcp.runflow.io/mcp and a single literal-key Authorization header in user settings. Same env-var-substitution limitation as the CLI clients.

Claude.ai connectors

Add a custom connector with URL https://mcp.runflow.io/mcp and paste your bearer when prompted. The connector inherits the initialize.instructions SKILL.md automatically. The bearer is stored encrypted in your account, not in a local file.

Tools

generate

Dispatch a run and (by default) wait for the result.
Polling backs off adaptively: 2s for the first 30s, 5s through 2 minutes, then 10s. The server enforces MCP_POLL_TIMEOUT_MS (10 minutes by default). If the poll exceeds that ceiling, the tool returns a polling_timeout envelope with the latest run state. The upstream run keeps running.

Resuming after polling_timeout

If you supplied client_ref on the original call, re-invoke generate with the same model and the same client_ref. Runflow honours the idempotency key and returns the existing run. Without client_ref, the run still completes upstream but cannot be resumed via MCP — the run_id is returned in the error envelope so you can poll the REST API directly.

Example

list_models

Browse the unified catalog. Solutions (provider_slug=runflow) appear alongside raw provider models — no special casing.
Each entry includes a runs_endpoint you can pass straight to generate (strip the /v1/models/ prefix and /runs suffix to get the model argument).

Prompts

The server auto-builds one slash command per active Solution. Solutions are catalog entries with provider_slug=runflow — they encode a complete workflow behind a single endpoint. You will see prompts like:
  • /runflow:headshots
  • /runflow:logo-inpaint
  • /runflow:object-removal-prompt
  • /runflow:smart-segmentation
  • /runflow:upscale
Selecting a prompt fills your chat with a templated message containing the Solution’s required inputs. Edit the inputs, send, and the server dispatches the run through generate for you. Prompts are memoised per catalog snapshot, so prompts/list is cheap and initialize does not rebuild on every request.

Auth

The server accepts any bearer matching MCP_ACCEPTED_KEY_PREFIXES (default rf_live). Send the key verbatim:
401 responses include an RFC 9728 WWW-Authenticate header:
The /.well-known/oauth-protected-resource endpoint returns a stub resource block in v1.0; a future minor release will add authorization-server pointers for the in-browser MCP OAuth flow.

Errors

Two distinct envelope shapes, depending on where the error originates.

Transport-level (JSON-RPC)

Returned when a request is rejected before the tool handler runs — host check, body cap, auth, rate limit. Lives at HTTP 4xx/5xx. Default rate-limit window is 60s with caps of 30 req/IP pre-auth, 120 req/IP post-auth, and 600 req per distinct bearer fingerprint.

Tool-result envelope

Returned at HTTP 200 with isError: true when a tool succeeds at the transport layer but fails inside generate or list_models. Clients reading structuredContent.error get a stable shape:
Clients that only render text get a stable [code] message lead line.

Troubleshooting

If none of the above match, run the smoke test below — the raw JSON-RPC response usually identifies the cause.

Smoke test

Two curl steps. The first proves your bearer is accepted and the skill is returned as instructions; the second proves a real tool call round-trips end-to-end.
You should see result.serverInfo.name = "Runflow" and result.instructions containing the agent skill.
You should see active Solutions (provider_slug=runflow) in result.content[0].text along with result.structuredContent. The exact count varies as Solutions ship and retire — check the live catalog for the current set.

When to use the MCP server vs. the REST API

  • Agent skill — the SKILL.md the MCP server returns as instructions.
  • Quickstart (REST) — direct HTTP integration.
  • Models — the catalog generate dispatches into.
  • Authentication — bearer lifecycle, scopes, rotation.
  • Errors — REST error vocabulary. MCP envelopes use lowercase snake_case codes (e.g. insufficient_credits); the REST API returns the corresponding SCREAMING_SNAKE enum (e.g. INSUFFICIENT_CREDIT). The lowercase MCP form is a direct lowercasing of the REST errors[].type; treat them as the same code under different casing conventions.