Orkestia
Blog
Reference

MCP Integration

The canonical way for any AI agent to discover, run, watch, and recover Orkestia workflows over the Model Context Protocol

Orkestia exposes a public Model Context Protocol (MCP) server at https://mcp.orkestia.dev/mcp. This is the canonical AI-agent integration: any MCP-capable client — Claude, your own LLM app, an autonomous worker — connects once and gains a typed, permissioned window onto the workflow engine. The agent discovers what your organization can do, inspects the inputs a capability needs, runs it, and follows it to a terminal state — all without anyone hand-coding an integration first.

Two design choices make this safe to expose publicly:

  • Org scoping is server-side. Your bearer token resolves your organization_uuid on the server. Every run an agent starts is automatically scoped to your org — the agent never sends, guesses, or asks for the org ID.
  • The transport is stateless. The server is stateless streamable-HTTP: no per-replica session state, so it survives pod restarts and HPA scale events without dropping an agent's context.
Everything on Orkestia is a workflow. The MCP server is simply the agent-facing projection of the same engine the UI, the REST API, and DGI drive. An agent and a human reach identical capabilities through different doors. Lumen has a separate telemetry MCP — see Lumen MCP.

Connecting a client

Step-by-step setup for Claude, Claude Code, Cursor, and ChatGPT, plus a prompt library and troubleshooting, lives in Connect an AI assistant. This page is the tool-level reference.

Most MCP clients are configured with a small JSON block. Point one at Orkestia like this:

{
  "mcpServers": {
    "orkestia": {
      "type": "http",
      "url": "https://mcp.orkestia.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${ORKESTIA_TOKEN}"
      }
    }
  }
}

Lumen's telemetry MCP is a second server. Connect it after the org is enabled:

{
  "mcpServers": {
    "lumen": {
      "type": "http",
      "url": "https://mcp-lumen.orkestia.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${ORKESTIA_TOKEN}"
      }
    }
  }
}
Keep ORKESTIA_TOKEN in your environment, not in the config file. The token is the only thing that identifies your org to the server, so treat it like any other credential. The server also speaks OAuth (authorization-code + client-credentials), so MCP clients that support it can sign in interactively instead of pasting a token. See Security & Compliance for token hygiene.

Once connected, the server advertises three kinds of context to the agent:

  • Tools — the verbs the agent can invoke (discover, start, watch, recover).
  • Resources — read-only rule://, concept://, and knowledge:// documents the agent should read before acting, delivered as first-class context rather than buried in prose, plus a templated prerequisite://{workflow_type}/{variant} resource.
  • Prompts — usage-guide templates (how_to_use_workflow_mcp, diagnose_workflow_run).

AWS, Azure, and Google Cloud from one MCP endpoint

The Orkestia MCP server at https://mcp.orkestia.dev/mcp exposes the workflow catalog across AWS, Azure, and Google Cloud alongside the rest of the supported providers.

Execution happens in the customer's own cloud, never in Orkestia's. For how connections are scoped and runs are reviewed, see Security and Compliance and Governance and Approvals.

The discovery sequence

An agent needs no prior knowledge of your platform. It follows the same loop every time, and the server's own instructions enforce the order:

StepToolPurpose
1whoamiConfirm identity and the org the session is scoped to. Mandatory first call before any workflow operation.
2list_workflow_namespaces / list_workflow_typesSee what capabilities exist (optionally filter by prefix).
3get_workflow_schemaInspect the inputs a workflow requires before running it.
4get_workflow_prerequisitesIf the schema reports has_prerequisites: true, fetch the setup guide first.
5start_workflowLaunch an execution with validated initial_data.
6watch_workflow / get_workflow_statusFollow the run to a terminal state; retry_workflow to recover a failure.
whoami first — always. The server resolves your organization_uuid from the token. Do not pass organization_uuid in initial_data unless a workflow schema explicitly declares it as an input (and then it must match your authenticated org). An agent should never ask a human for the org ID.

Tool surface

The tools split cleanly into two families that mirror the mental model: workflow types are registered capabilities; workflow runs are executions with a unique workflow_id. Catalog tools explore capabilities; run tools operate on live executions.

Identity

whoami

Returns your authenticated identity and the org every run is scoped to: user_id, organization_uuid (canonical) plus its organization_id legacy alias, username, token_type, principal_type, and a human-readable message. Agent tokens additionally return agent_uuid, permission_mode, seat_mode, and staff_actor_uuid. The mandatory first call of any session.

Catalog — discover capabilities

ToolWhat it returns
list_workflow_namespacesThe top-level capability namespaces your org is entitled to (e.g. provider/service prefixes).
list_workflow_typesRegistered workflow types, optionally filtered by prefix="<namespace>.", q="<keyword>", or featured=true.
get_workflow_schemaThe input contract for a workflow type — its fields, a read_only flag, and has_prerequisites / prerequisite_variants.
get_workflow_definitionThe full workflow definition — declared states, transitions, timeouts, outcomes, and DAG layers.
get_workflow_dagThe DAG structure (layers, steps, compensation) for a multi-step workflow type.
get_workflow_prerequisitesA setup guide for a type (and variant) whose schema reports prerequisites — the canonical case being a missing connection.
Data workflows are how an agent looks things up. When the agent needs IDs or resource metadata, it discovers read-only data workflows (names often contain load, list, fetch, get, or query), starts them like any other workflow, and reads their terminal output. There is no separate "query API" — reads are workflows too. See Workflow Types Registry.

Runs — execute and operate

ToolWhat it does
start_workflowLaunches an execution of a workflow type with validated initial_data; returns a workflow_id.
watch_workflowFollows a run to a terminal state, streaming transitions.
get_workflow_statusPoint-in-time status of a single run.
get_workflow_historyThe transition history (event-sourced) of a run.
list_workflowsPaginated list of runs of a given workflow_type, filterable by state_name or terminal status.
list_stuck_workflowsSurfaces stalled runs that need attention — the entry point for self-healing operators.
retry_workflowRecovers a failed run.
resolve_workflowResolves a run parked on the remediation gate: a DAG step that failed on a fixable precondition parks in remediation_pending instead of compensating; apply the fix the run's state_data.remediation envelope names, then resolve "remediated" — the engine re-runs only the failed step and the run continues. Resolve "denied" to compensate and fail.
force_terminate_workflowAbandons a confirmed-stale non-terminal run by appending a failed terminal state (guarded by a reason plus age / state checks).
get_workflow_history returns the event-sourced transition log, so an agent (or a human auditing it) can reconstruct exactly what a run did and why it failed before deciding whether to retry_workflow. This is the same audit trail Lumen renders for observability.
Two more tools round out the surface: list_plugins (read-only — the engine plugins backing provider access) and, on deployments with the project catalog enabled, register_project / list_projects / refresh_project / validate_workflow_registry. The authoritative, always-current tool list lives at reference.orkestia.dev.

Prerequisites-first

The single most important behavioral rule: resolve prerequisites before starting a workflow. Many capabilities depend on a customer-owned resource Orkestia cannot provide for you — most commonly a cloud connection granting the platform a scoped role in your account (this is the Zero Code Custody posture: execution happens in your cloud, never ours).

The contract is explicit in the schema:

// get_workflow_schema(workflow_type) → (shape illustrative)
{
  "workflow_type": "<provider>.<service>.<operation>",
  "has_prerequisites": true,
  "prerequisite_variants": ["aws"],
  "read_only": false,
  "fields": [ { "name": "...", "type": "...", "required": true } ]
}

When has_prerequisites is true, the agent calls get_workflow_prerequisites before start_workflow. The returned guide arrives with platform identity already filled in — for example, Orkestia's AWS principal — so the human can complete a one-time setup (creating a role, granting access) without leaving the conversation.

Skipping the prerequisites step is the most common cause of an avoidable failed run. If an agent starts a workflow whose connection is missing, the run fails at the first action that needs it. Read rule://prerequisites-first and honor the has_prerequisites flag.

Rule resources

Beyond tools, the server publishes rule resources — guardrails and setup guides delivered as first-class MCP context. A well-behaved agent reads the relevant rule before acting.

ResourceWhat it covers
rule://getting-startedThe full discovery pattern: mandatory whoami first, then list → schema → start → watch.
rule://authenticated-contextAlways call whoami first; the org is resolved server-side and must not be passed unless a schema declares it.
rule://prerequisites-firstAlways resolve prerequisites before starting a workflow.
rule://orkestia-auth-setupA one-call recipe for wiring "Sign in with Orkestia" into an app — provisioning an identity tenant + OIDC client and exposing end-user-scoped workflows.
rule://groundingDescribe Orkestia only from what tool results actually show — never infer architecture, pricing, or maturity.

The server also exposes concept:// and knowledge:// orientation resources, the templated prerequisite://{workflow_type}/{variant} resource, and two prompt templates (how_to_use_workflow_mcp, diagnose_workflow_run). The full, current set lives at reference.orkestia.dev.

Worked example

A typical agent turn — "run the thing that provisions a static site for this repo" — expands into the loop below. Tool names are exact; payloads are illustrative because the per-workflow contract is owned by the live catalog.

// 1. Confirm who we are and which org we're scoped to.
await whoami()

// 2. Discover candidate capabilities (filter by namespace if known).
await list_workflow_types({ prefix: "aws." })

// 3. Inspect the input contract for the chosen type.
const schema = await get_workflow_schema({
  workflow_type: "<provider>.<service>.<operation>",
})

// 4. If the schema declares prerequisites, resolve them first.
if (schema.has_prerequisites) {
  await get_workflow_prerequisites({
    workflow_type: "<provider>.<service>.<operation>",
    variant: "default",
  })
  // → surface the setup guide to the human; wait until the connection exists.
}

// 5. Start the run with validated initial_data (no organization_uuid).
const { workflow_id } = await start_workflow({
  workflow_type: "<provider>.<service>.<operation>",
  initial_data: { /* fields per schema */ },
})

// 6. Watch to a terminal state; recover on failure.
const result = await watch_workflow({ workflow_id })
if (result.status === "FAILED") {
  await get_workflow_history({ workflow_id }) // diagnose
  await retry_workflow({ workflow_id })       // recover
}
Beta. Exact workflow type names, input fields, prerequisite variants, and the full tool list change between releases. Treat the names above as placeholders and always drive off the live catalog (list_workflow_types + get_workflow_schema) rather than hard-coding. The authoritative, per-workflow contract lives at reference.orkestia.dev.

How this connects to the rest of Orkestia

The MCP server is one of three AI surfaces, and all three resolve to the same workflow primitive:

DGI

Turns a plain-language message into a workflow DAG — producing the same workflows the MCP server discovers.

Staff governance

Governs fleets of agents driving the MCP surface — structure, approvals, and oversight.

Workflows

The core primitive every tool here operates on.

Identity & multi-tenancy

How tokens resolve to an org and scope every run.

Lumen MCP

Connect mcp-lumen.orkestia.dev for logs, groups, traces, and triage tools.

Full tool & resource reference — the canonical, always-current list of MCP tools, rule resources, and per-workflow input schemas lives in the external catalog at reference.orkestia.dev.

For broader context, see Concepts, the MCP-driven guides, and the Workflow Types Registry.