AgenCast runtime
AgenCast is a workflow runtime for AI agents: create a reusable procedure, validate and test its flow, run it with new inputs and inspect the results. Agents operate it through MCP or the CLI; the optional GUI helps people review and edit the same workflow files and inspect run records. Live workflow model calls use OpenRouter.
Version 0.19.4, Python 3.12 + uv. Formats per docs/spec/ (v1), design
in docs/DESIGN.md. The package and the command are both called agencast (until 0.2.5
maw); the command name is in pyproject.toml ([project.scripts]).
The package also contains the skills, documentation and examples: guide.
Usage
Run the commands from the root of the repository clone.
uv run --project framework agencast --project examples/showcase validate ig-post
uv run --project framework agencast --project examples/showcase run ig-post -i topic="new coffee" --dry-run
uv run --project framework agencast --project examples/showcase run ig-post -i topic="new coffee" --fake examples/showcase/fake/ig-post.yaml
uv run --project framework agencast --project examples/showcase run ig-post -i topic="new coffee"
uv run --project framework agencast --project examples/showcase run demo-task -i books="Austen: Pride and Prejudice (1813)" --fake examples/showcase/fake/demo-task.yaml
uv run --project framework agencast --project examples/showcase runs list
uv run --project framework agencast --project examples/showcase runs show <run_id>
uv run --project framework agencast --project examples/showcase serve --host 127.0.0.1 --port 8080 [--workers 2] [--cors http://localhost:5173]
uv run --project framework agencast --project examples/showcase mcp [--allow read|run|edit] [--input-dir DIR]... [--fake [SCRIPT]] [--http [--host H] [--port P] [--allow-host H]...]
uv run --project framework agencast --project examples/showcase migrate examples/showcase/workflows/scenarios/ig-post.yaml
uv run --project framework agencast new project ~/my-project [--example showcase|tutorial]
uv run --project framework agencast new agent reviewer | new scenario check [--project <path>]
uv run --project framework agencast skills list | path | install [--to all] [--prefix DIR] [--copy] [--force]
uv run --project framework agencast docs [show spec/scenario.md]
uv run --project framework agencast projects list | add <path> [--name N] | rm <name> | trust <name> [--yes]
-
A scenario can be given by name (
ig-post) or by the path to its.yaml. The project root = the first folder withworkflows/going up from the current folder, or--project <path>on any command — everything works from any folder. -
Configuration
workflows/config.yaml(templateconfig.example.yaml) and the MCP server registryworkflows/mcp.yaml(templatemcp.example.yaml; only the owner changes both —mcp.yamlonly on disk: the API never reads or writes the file, the GUI shows its servers read-only). Keys only from the environment or from.envin the project root. -
A
taskstep starts the MCP servers frommcp.yamlonce per run (stdio vianpxneeds Node; on a serverless host, preinstall the package). The servers' stderr is in the run record inmcp/<server>.stderr.log. -
--fakereplaces model calls with no model cost and no OpenRouter key; an optional YAML contains scripted answers (described insrc/agencast/fake.py). The MCP servers frommcp.yamlin ataskstep are real even with--fake; the examplefilesystemvianpxneeds Node.js and downloads a package on first run. The callback is really sent and needs a signing secret. Only scenarios withouttask(including called scenarios) and without--callback-urlare guaranteed to run offline, e.g.ig-post. -
Inputs of type
fileandfilesare images (PNG, JPEG, WebP, GIF, AVIF; at most 10 MB each, up to 16):-i photo=a.jpg,-i 'refs=["a.png","b.webp"]'. They are copied intoruns/<id>/inputs/and carrywidth,heightandformat;images:onask/taskshows them to the model, onimagethey are reference images (only an alias withapi: images). Over HTTP an image is uploaded first and passed as{"upload_id": …}(docs/spec/scenario.md, Typefile; docs/spec/api.md, Uploads). -
--callback-url https://…sends the result signed with HMAC after the run (callback.secret_env). -
Run records are in
runs/(in.gitignore), files fromoutputinoutputs/(storage.type: local). -
Every run has a
report.html(a single file, CSS inside, no external resources, prompts and responses in<details>); a copy goes to storage and its URL is in the callback asreport_url(storage.type: local→file://). -
new project <path>createsworkflows/(config, agentwriter, scenariodemo— they passvalidate --offlineand--fake),.env.exampleand.gitignore;new agent|scenario <name>adds a minimal file to the project. It never overwrites anything (docs/spec/projects.md). -
The project registry
~/.config/agencast/projects.yaml(AGENCAST_CONFIG_DIR) is filled bynew project,projects addand arunthat passed validation (not--dry-run; since 0.15.1validatedoes not change the registry); the GUI can write in registry mode — its entries aretrusted: false: such a project uses no MCP server untilagencast projects trust <name>, which shows the project root and its servers and asks first (--yesoutside a terminal; docs/spec/projects.md).projects_rootsets the default folder for new projects (default~/agencast-projects). -
migrate: there is nothing to convert in v1; an unknown version =configerror. -
Exit code: 0 success, 1 the run ended with an error, 2
configerror (validate, inputs, environment).
Webhook server (agencast serve)
Contract: docs/spec/webhook.md. Stdlib ThreadingHTTPServer, no
web framework.
POST /runs Authorization: Bearer $WEBHOOK_TOKEN
{"scenario": "ig-post", "inputs": {"topic": "…"}, "callback_url": "https://…", "request_key": "caller-4711"}
→ 202 {"run_id": "…", "queue_position": 1} the run is queued, the result arrives at callback_url
→ 200 {"run_id": "<original>", "queue_position": null} request_key was already used
→ 401 / 422 {"error": "…", "details": [...]} nothing is created, no callback arrives
GET /runs/<run_id> status: queued (+ queue_position) / running / callback body + callback_failed
GET /projects, /projects/<p>[/scenarios/<s>|/runs[/<id>[/files/<path>]]|/spend?day=] read API (docs/spec/api.md)
POST /projects/<p>/runs like POST /runs in project <p>; callback_url optional, "dry_run": true → plan only
POST /projects/<p>/uploads raw bytes of one image → 201 {"upload_id"} for a file/files input (single project: POST /uploads)
POST /projects/<p>/validate validation without writing ({path, text} or an empty body), errors as objects
POST /projects/new creates a project from the template and writes it to the registry
POST /projects registers an existing project with workflows/config.yaml
DELETE /projects/<p> removes the project from the registry only, files stay
GET /, /assets/… GUI (framework/src/agencast/ui/, no token)
-
GUI (since 0.6.0):
serveserves the built GUI fromframework/src/agencast/ui/(output ofnpm run buildin the repository'sui/folder; git ignores it, it goes into the wheel viaartifacts).GET /and/assets/…need no token, the token protects only/projects…and/runs…; a path without an extension returnsindex.html(hash routing). Without a built GUI,GET /returns 404 with instructions. When developing the GUI fromvite dev(another origin), runserve --port 8787 --cors http://localhost:5173— without the switch there are no CORS headers. -
In a project or with
--project: one project (tokenwebhook.token_env); outside a project, registry mode: all projects from the registry, the server tokenAGENCAST_TOKEN, secrets from the server's environment and.envin cwd,/runsonly via/projects/<p>/runs. -
--hostand--portoverrideAGENCAST_HOSTandAGENCAST_PORT; the defaults are127.0.0.1and8080.AGENCAST_PORTmust be an integer 1–65535. These variables are read from the process environment while parsing arguments;.envin cwd is loaded only afterwards, so you cannot set the bind address or port from it. -
For registry mode,
~/.config/agencast/serve.envcan containAGENCAST_TOKEN,AGENCAST_HOSTandAGENCAST_PORT:AGENCAST_TOKEN=<secret-token> AGENCAST_HOST=127.0.0.1 AGENCAST_PORT=8080
For access from other devices, set
AGENCAST_HOSTto the private address of the Tailscale interface. A user systemd service:[Unit] Description=AgenCast server [Service] ExecStart=%h/.local/bin/agencast serve EnvironmentFile=%h/.config/agencast/serve.env Restart=on-failure [Install] WantedBy=default.target
-
Startup needs the variables
webhook.token_env,callback.secret_envand (without--fake) the OpenRouter key; otherwise it ends with aconfigerror. -
Runs go one after another (a single worker thread);
--workers Nstarts N runs at once, and the completion order is then not guaranteed. The queue andrequest_keyare files in<runs>/_queue/— after a server restart, waiting requests are processed; a run interrupted midway is not repeated, a callbackinternalis sent (verify manually). On SIGTERM or Ctrl-Cservefirst stops the MCP servers of the runs in flight; requests still waiting stay in the queue. -
The optional
limits.max_parallel_runsandlimits.daily_budget_usdinconfig.yaml(since 0.3.1) apply to all runs over oneruns/—serve, the manual CLI and cron share one cap (docs/spec/config.md). -
Callback:
https://(exceptionhttp://127.0.0.1for tests), signatureX-Signature: sha256=<HMAC>, 3 attempts, thencallback_failed. -
The server is HTTP without TLS and the GUI has no token protection. Never expose it publicly; bind only to localhost or a private network, for example Tailscale. Hosted deployment is Phase 3c.
MCP server (agencast mcp, since 0.19.0)
agencast mcp serves the registered projects (one with --project) to an MCP client over stdio, or over
streamable HTTP with --http and a bearer token from AGENCAST_MCP_TOKEN: tools to list projects and
scenarios, run them (fake_run free, run_scenario live), follow and read runs, and with --allow edit
write scenarios, agents and skills. Runs outlive the client and the server. Image inputs come from
directories the owner allows with --input-dir. Clients that render MCP Apps also get a run card. Everything
is specified in docs/spec/mcp-server.md; client setup is in the
main README.
Tests
cd framework && uv run pytest
Conformance suite (DESIGN §5.6, §5.9): expressions (58 cases from spike (c)
adjusted per the spec + the spec rules), loader, validate, engine (error
classes, retry, cascade, parallel, switch, budget, timeout, callback,
masking), the task step with the fake MCP server tests/fake_mcp_server.py
(permissions, schema normalization, loop, skills, dedupe_key, leftover
processes) and golden scenarios — every file in examples/*/workflows/ and every example
in docs/spec/. A new scenario in examples/*/workflows/scenarios/ is tested automatically;
its scripted answers belong in ../examples/<project>/fake/<name>.yaml.
Structure (DESIGN D3 layers)
| File | Layer |
|---|---|
loader.py |
reading files: YAML 1.2 core, frontmatter, .env, JSON Schema from the spec |
validate.py |
static checks (scenario.md §7), inputs |
expressions.py |
expressions and templates (scenario.md §5) |
engine.py |
run: steps, retry, timeout, budget, callback |
providers.py |
OpenRouter chat / Jev / image, error classes, cascade |
fake.py |
fake provider (httpx.MockTransport) |
record.py |
run record, summary.md, plan.md, report.html |
server.py |
webhook server, queue, request_key, /projects/... API (read, edit, validate), GUI and --cors |
mcp_client.py |
mcp.yaml, the run's MCP servers (mcp SDK 2.2), tool schema normalization |
task.py |
the task step (model ↔ tools loop, load_skill), dedupe_key |
projects.py |
project registry, templates for agencast new, project and scenario descriptions for the GUI |
api.py |
public API for the shells (CLI, serve, agencast mcp, a hosted wrapper, planned): load, run, dry_run, runs_list, run_status, new_* |
mcp_server.py |
agencast mcp: the MCP tools, run workers (run --mcp-job), the HTTP transport (spec) |
mcp_app/run-card.html |
the run card, MCP Apps resource ui://agencast/run-card.html |
resources.py |
the bundled docs, skills and examples (agencast docs, get_guide) |
cli.py |
the agencast command |
Not yet: a hosted wrapper and R2 storage (Phase 3c). Unclear points in the spec: docs/spec/ISSUES.md.
Historical logs are in the archive of live runs.
Metadata
Release files for agencast 0.19.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| agencast-0.19.4.tar.gz | 1.0 MB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agencast-0.19.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.9 MB
Release files / agencast-0.19.4.tar.gz
| Download URL | agencast-0.19.4.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f9d6ef5f74ed325ad3ab8dfe09221015c985c8f1a25bccdea565f42926dc438
|
|
BLAKE2b-256 checksum How to use checksums |
eed0774c15d4d9692aef73ed103775812c555c290cfde39ae3c20def2f83bae7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / agencast-0.19.4-py3-none-any.whl
| Download URL | agencast-0.19.4-py3-none-any.whl |
|---|---|
| Size | 907.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d216565baa48ef3a3b669f810b148fccaa6069f335c2b715664f3865f4b40288
|
|
BLAKE2b-256 checksum How to use checksums |
cd0d1600068c7db4c5044695aad38bafd454619fe8c230932cc2f3a3e9c6d770
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logSecurity for agencast 0.19.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for agencast-0.19.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.