MCP Integration
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_uuidon 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.
Connecting a client
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}"
}
}
}
}
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://, andknowledge://documents the agent should read before acting, delivered as first-class context rather than buried in prose, plus a templatedprerequisite://{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.
- For AWS, see the AWS connections guide.
- For Azure, see the Azure connection.
- For Google Cloud, see the GCP connection.
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:
- whoami
- list_workflow_namespaces / list_workflow_types
- get_workflow_schema
- get_workflow_prerequisites
- start_workflow
- watch_workflow / get_workflow_status
- retry_workflow
- terminal output
- whoami→list_workflow_namespaces / list_workflow_types
- list_workflow_namespaces / list_workflow_types→get_workflow_schema
- get_workflow_schema→ has_prerequisites: true →get_workflow_prerequisites
- get_workflow_schema→ ready →start_workflow
- get_workflow_prerequisites→start_workflow
- start_workflow→watch_workflow / get_workflow_status
- watch_workflow / get_workflow_status→ failed →retry_workflow
- watch_workflow / get_workflow_status→ done →terminal output
| Step | Tool | Purpose |
|---|---|---|
| 1 | whoami | Confirm identity and the org the session is scoped to. Mandatory first call before any workflow operation. |
| 2 | list_workflow_namespaces / list_workflow_types | See what capabilities exist (optionally filter by prefix). |
| 3 | get_workflow_schema | Inspect the inputs a workflow requires before running it. |
| 4 | get_workflow_prerequisites | If the schema reports has_prerequisites: true, fetch the setup guide first. |
| 5 | start_workflow | Launch an execution with validated initial_data. |
| 6 | watch_workflow / get_workflow_status | Follow 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
| Tool | What it returns |
|---|---|
list_workflow_namespaces | The top-level capability namespaces your org is entitled to (e.g. provider/service prefixes). |
list_workflow_types | Registered workflow types, optionally filtered by prefix="<namespace>.", q="<keyword>", or featured=true. |
get_workflow_schema | The input contract for a workflow type — its fields, a read_only flag, and has_prerequisites / prerequisite_variants. |
get_workflow_definition | The full workflow definition — declared states, transitions, timeouts, outcomes, and DAG layers. |
get_workflow_dag | The DAG structure (layers, steps, compensation) for a multi-step workflow type. |
get_workflow_prerequisites | A setup guide for a type (and variant) whose schema reports prerequisites — the canonical case being a missing connection. |
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
| Tool | What it does |
|---|---|
start_workflow | Launches an execution of a workflow type with validated initial_data; returns a workflow_id. |
watch_workflow | Follows a run to a terminal state, streaming transitions. |
get_workflow_status | Point-in-time status of a single run. |
get_workflow_history | The transition history (event-sourced) of a run. |
list_workflows | Paginated list of runs of a given workflow_type, filterable by state_name or terminal status. |
list_stuck_workflows | Surfaces stalled runs that need attention — the entry point for self-healing operators. |
retry_workflow | Recovers a failed run. |
resolve_workflow | Resolves 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_workflow | Abandons 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.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.
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.
| Resource | What it covers |
|---|---|
rule://getting-started | The full discovery pattern: mandatory whoami first, then list → schema → start → watch. |
rule://authenticated-context | Always call whoami first; the org is resolved server-side and must not be passed unless a schema declares it. |
rule://prerequisites-first | Always resolve prerequisites before starting a workflow. |
rule://orkestia-auth-setup | A 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://grounding | Describe 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
}
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.
For broader context, see Concepts, the MCP-driven guides, and the Workflow Types Registry.
Workflow Types & Registry
How the Orkestia workflow registry is structured — namespaces, dotted naming, typed schemas, prerequisites, and the discovery loop that lets humans, SDKs, and AI agents browse capabilities
API & Tooling
The programmatic surfaces for driving Orkestia workflows — the REST API, the typed Node/TS SDK, and the two-token auth model
