The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Moira listing page.
Agent Workflow Engine for AI agents.
Primary users: AI agents via MCP protocol. Web UI is supplementary for workflow management.
See docs/VISION.md for product vision and design principles.
Both run the same engine and MCP tools. Self-host is a single-tenant private-team deployment with administrator-approved accounts. Cloud adds managed hosting and SaaS-only policy and administration, including social login, legal consent, email verification, and the broader multi-user administration surface.
Monorepo: Clean separation of concerns with npm workspaces Workflow Engine: Node-graph execution over a set of node types (@mcp-moira/workflow-engine) MCP Server: HTTP protocol server exposing the MCP tools (@mcp-moira/mcp-server) Web Backend: Express API server (@mcp-moira/web-backend) Web Frontend: React UI with webpack (@mcp-moira/web-frontend) Docs: Astro 5 + Starlight documentation site, EN+RU (@mcp-moira/docs) Shared: Database layer + Better Auth + logging (@mcp-moira/shared) Database: Modular repository pattern with Drizzle ORM Settings System: Universal settings with encryption and dynamic UI generation Docker Deployment: Multi-stage container with TypeScript validation Validation: JSON Schema with AJV
/docsdatabase/ - Modular repositories (Workflow, Execution, Settings)auth/ - Better Auth configurationlogging/ - Structured loggingconfig/) - Unified container deployment configurationRun a complete Moira instance locally with Docker — no source build required:
Then open:
The image is pulled from the public registry by default. Data (SQLite + execution
storage) persists in ./data. See Self-Hosting or the in-app docs
at /docs/ for the full reference.
Update a normal self-host installation with the standard Compose commands:
Older .env files may still override Compose with the removed 0.3.5 tag; change that line once to
MOIRA_IMAGE=ghcr.io/moira-mcp/moira:latest before updating.
The image protects existing self-host data before its startup migrations: it creates and verifies a
coherent SQLite backup, includes the prompt manifest, and keeps three rotating recovery states under
data/.moira-startup-backups/. If initialization fails, it restores the database and manifest before
refusing to start the services. A persistent pending marker also restores the verified state before the
next attempt if the container or host was interrupted mid-initialization. A fresh installation skips
the nonexistent-database backup and uses only a temporary persistent marker so an interrupted first
start is removed before retry.
The complete automatic recovery behavior and optional pinned-image preflight are documented in Self-hosting: Updating and Recovery, with a matching Russian version. Release notes are on the GitHub Releases page.
For contributors who want to build and run from the source tree, switch
docker-compose.yml to Option B first — comment out the image: line and
uncomment the build: block (the file documents both options inline). Then:
(The default docker-compose.yml uses the prebuilt public image — docker compose up -d without --build — which is the recommended self-host path.)
Custom node and communication-channel bundles run in the separate extension runner and are disabled by default. Enabling them requires this source checkout because the runner image is built locally; the published Moira image does not import or package bundle code.
Before starting the example, replace both placeholder network permissions and fill its per-user
settings. The example contributes both a workflow action node and an ordinary notification channel.
See Self-hosting: Enable
extensions
and Writing an
Extension for the complete
installation, SDK, permission and failure contracts. npm run test:docker-extensions verifies the
default-off profile and read-only bundle mount.
The integration/API/E2E suites run against a local Docker container, configured by
.env.local. Copy the template once before running them (or before
npm run docker:restart):
Configuration in .env (copy from .env.example):
./data/moira.db (bind-mounted, persists across restarts)MCP Moira uses Better Auth with OAuth 2.1 for centralized authentication.
Browser Access:
MCP Clients:
Protected:
Testing:
See docs/AUTHENTICATION.md for complete setup and OAuth flow details.
Point your MCP client (e.g. Claude Code) at your running instance:
| Server | URL | Purpose |
|---|---|---|
moira-local | http://localhost:8080/mcp | Your local self-host instance |
Replace
localhost:8080with your own host/port (MOIRA_HOST) if you serve Moira on a different address.
The examples below show common graph patterns; they are not the complete node-type inventory. See the Nodes reference for every supported type and its current contract, including automatic note operations and file materialization.
The node fans out to the current user's enabled communication channels and never accepts provider,
recipient, or credential fields. The deprecated telegram-notification node remains available for
existing Telegram-specific workflows, including exact explicit chatId semantics.
Pauses execution until explicitly unlocked. Sends PIN via Telegram with inline approve button. Unlockable via MCP tool, web UI, or Telegram callback.
Variables processed in directive, completionCondition, and message fields:
{{variable}} - Context variable{{nested.path}} - Object property access{{executionId}} - System: current process ID{{workflowId}} - System: current workflow IDAll development happens through Docker containers.
Database: SQLite at DB_PATH (default: ./data/moira.db)
Migrations: Drizzle ORM (npx tsx scripts/run-migrations.ts)
Storage: Workflows and executions in database with user isolation
User Documentation: Served by your running instance at /docs/ (EN) and /ru/docs/ (RU), built from packages/docs (Starlight).
Technical Documentation: /docs directory - system reference, API specs, development guides.
Project Checklist - mandatory pre-commit checks executed by development workflows.
Custom slash commands in /commands directory. See commands/README.md for installation and usage.
MCP server configuration (see MCP Configuration for details):
Environment variables passed via HTTP headers (recommended for HTTP transport).
Alternative: Set environment variables in your .env file.
Project uses ESLint with TypeScript support and Prettier for code formatting.
Pre-commit Hook: Husky pre-commit hook automatically runs ESLint and Prettier on staged files.
Configuration:
.eslintrc.json - ESLint rules (strict for production code, relaxed for tests).prettierrc - Prettier formatting rulesany types are errors, must be properly typedany types allowed for flexibilityProtection against spam and DoS attacks with tiered limits:
/api/*): 100 requests/minute/api/auth/*): 100 requests/minute/mcp): 30 requests/minuteExceeded limits return HTTP 429 Too Many Requests.
Protection against oversized payloads:
Exceeded limits return HTTP 413 Payload Too Large.
Request logging includes country detection via geoip-lite:
Admin panel at /admin/users provides:
The Cloud multiUserAdmin capability enables the cross-user panel at /admin/executions. It is
server-denied and hidden by the default self-host policy:
Track every email attempt:
sent, failed, or log-only logged) with error messages/forgot-password
and receives a reset linkConfigured via environment variables:
Real delivery supports generic SMTP and Brevo. With EMAIL_PROVIDER=auto (or
unset), a complete SMTP configuration takes precedence and a legacy
BREVO_API_KEY plus EMAIL_FROM configuration remains supported. The explicit
test provider logs messages and is never advertised as real delivery.
Where things are documented. After changing code, find the area below and update the matching file in the same change.
Rendered pages live under packages/docs/src/content/docs/docs/ (EN) and
packages/docs/src/content/docs/ru/docs/ (RU). Runtime-visible topics keep their semantic Markdown
under packages/mcp-server/src/help/content/, with Russian counterparts under …/content/ru/.
Each localized MDX shell imports its matching source through the MCP package. The help tool
discovers and reads the English sources directly; pages with an interactive insertion compose the
same authored before/after sections in runtime and public presentation. The special tools topic is
listed alongside those file-backed topics and renders directly from the typed MCP contract.
| Area | Covers | Path |
|---|---|---|
| Getting started | Introduction, quickstart, self-hosting | getting-started/ |
| Concepts | Workflows, nodes, templates, notes, artifacts | concepts/ |
| Guides | Writing directives, creating & editing workflows, writing extensions | guides/ |
| Reference | Tools, input schema, magic variables, condition operators, validation, workflow catalog | reference/ |
| Integration | MCP clients, Claude Code, agent guide, Telegram setup, troubleshooting | integration/ |
| Patterns | Branching, validation loop, escalation, subagent review, workspace, and more | patterns/ |
docs/For contributors working on the codebase (implementation detail, not end-user docs).
| File | Covers | Path |
|---|---|---|
| Development setup | Build, Docker, local dev, project structure | docs/DEVELOPMENT.md |
| Testing | Test types, runner, fixtures, antipatterns | docs/TESTING.md + docs/testing/ |
| API | Backend & admin HTTP API reference | docs/API.md |
| System architecture | Engine, storage, MCP transport, handlers, validation | docs/SYSTEM.md |
| Authentication | Better Auth, OAuth 2.1, API tokens | docs/AUTHENTICATION.md |
| Web UI | Frontend architecture, components | docs/WEB-UI.md |
| Audit system | Audit logging design | docs/AUDIT-SYSTEM.md |
| Workflows | Workflow authoring, tools, catalog | docs/WORKFLOW.md, docs/WORKFLOWS.md, docs/WORKFLOW-TOOLS.md |
| Design system | UI design tokens and components | docs/DESIGN-SYSTEM.md |
| Documentation style | How to write internal and public docs | docs/DOCUMENTATION-STYLE-GUIDE.md |
| Logging | Structured logging conventions | docs/LOGGING.md |
| Issue management | GitHub issue conventions | docs/ISSUE-MANAGEMENT.md |
| Architecture decisions | ADRs (licensing, OSS model, …) | docs/adr/ |
| Deployment | Environment variables, restart procedures | docs/deployment/ |
| Legal | License/legal notes | docs/legal/ |
See CONTRIBUTING.md for setup, the PR flow, DCO sign-off, and how releases are automated (Conventional Commits → semantic-release → versioned GHCR image). For upgrading a self-host instance, see Updating / Upgrading.