Campaign orchestration MCP server for AI agents — dependency DAGs, parallel fan-out, failure policies
Project description
sortie-mcp
Campaign orchestration MCP server for AI agents — dependency DAGs, parallel fan-out, failure policies, and embedded notes.
Think make for AI agent workflows, where the LLM is the planner that
generates and adapts the DAG at runtime.
Install
pip install sortie-mcp
Or with uv:
uv add sortie-mcp
Quick Start
1. Set up PostgreSQL
sortie-mcp requires PostgreSQL 15+ with pgvector.
export DATABASE_URL="postgresql://user:pass@localhost:5432/mydb"
export SORTIE_SCHEMA="sortie" # default
2. Run the MCP server
sortie-mcp
# or: python -m sortie_mcp.server
The server runs on stdio transport. Configure it in your MCP client:
{
"sortie": {
"command": ["sortie-mcp"],
"env": {
"DATABASE_URL": "postgresql://..."
}
}
}
3. Run the campaign runner
sortie-runner
# or: python -m sortie_mcp.runner
Add to cron for autonomous operation:
*/15 * * * * /path/to/venv/bin/sortie-runner
Architecture
One MCP server, three perspectives:
- Coordinator (e.g. a dispatcher agent): create, list, steer, pause/cancel campaigns
- Worker (specialist agents): get context, add notes, complete/fail steps, spawn subtasks
- Runner (cron): capacity-aware watchdog that dispatches ready steps and consults the planner LLM
Step Types
| Type | Description |
|---|---|
atomic |
Single task executed by one agent |
parallel_group |
Fan-out: children run concurrently |
sequence |
Pipeline: each step depends on the previous |
for_each |
Map: apply a template to each item in a list |
Key Features
- DAG splice (
spawn_and_continue): agents can split work into subtasks + continuation - Branch abort (
abort_branch): scoped early return from an ancestor step - Skip cascade: transitive propagation through the dependency graph
- Priority scheduling: urgent / high / normal / low / background
- Advisory dedup: fingerprinting warns the planner of duplicate steps
- Depth limits:
spawn_and_continuehidden from agents at max depth - Embedded notes: pgvector semantic search across campaign findings
Configuration
| Env Var | Default | Description |
|---|---|---|
DATABASE_URL |
postgresql://localhost/sortie |
PostgreSQL connection string |
SORTIE_SCHEMA |
sortie |
Database schema name |
SORTIE_MAX_CONCURRENT |
4 |
Max parallel running steps |
SORTIE_ZOMBIE_TIMEOUT |
30 |
Minutes before a stuck step is reset |
LITELLM_URL |
http://localhost:4000 |
LiteLLM proxy URL (for planner) |
LITELLM_KEY |
LiteLLM API key | |
SORTIE_PLANNER_MODEL |
qwen3.5:9b |
Model for the planner LLM |
OPENCLAW_RUNTIME_URL |
http://localhost:3000 |
Agent runtime API |
Development
uv sync
uv run pytest
uv run ruff check .
uv run mypy src tests
License
GPL-3.0-or-later. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sortie_mcp-0.1.13.tar.gz.
File metadata
- Download URL: sortie_mcp-0.1.13.tar.gz
- Upload date:
- Size: 33.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
060fb80dca7e5fbdd343c462023dd69844cf186508acf8f14da1ed674b9722de
|
|
| MD5 |
67991405224f6596f323a498fe43f386
|
|
| BLAKE2b-256 |
1b3f0802efb97ee695ae81412868af7984e8c4fd9817b39d87f2444393e1e8bf
|
Provenance
The following attestation bundles were made for sortie_mcp-0.1.13.tar.gz:
Publisher:
publish.yml on retospect/sortie-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sortie_mcp-0.1.13.tar.gz -
Subject digest:
060fb80dca7e5fbdd343c462023dd69844cf186508acf8f14da1ed674b9722de - Sigstore transparency entry: 1244516696
- Sigstore integration time:
-
Permalink:
retospect/sortie-mcp@07372f86abc61a0e272fb6a024008f315a0bbf54 -
Branch / Tag:
refs/tags/v0.1.13 - Owner: https://github.com/retospect
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@07372f86abc61a0e272fb6a024008f315a0bbf54 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sortie_mcp-0.1.13-py3-none-any.whl.
File metadata
- Download URL: sortie_mcp-0.1.13-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cea1b1be676b2e1b82529e01d52ab529e338d7758b7e5639c20113cd60398d2
|
|
| MD5 |
44f147bb2a98db43b0c053920b7c29a3
|
|
| BLAKE2b-256 |
85df35466e8f5614006869b83e1499fe25bd1379d974a0296bc1b600b76568b9
|
Provenance
The following attestation bundles were made for sortie_mcp-0.1.13-py3-none-any.whl:
Publisher:
publish.yml on retospect/sortie-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sortie_mcp-0.1.13-py3-none-any.whl -
Subject digest:
6cea1b1be676b2e1b82529e01d52ab529e338d7758b7e5639c20113cd60398d2 - Sigstore transparency entry: 1244516719
- Sigstore integration time:
-
Permalink:
retospect/sortie-mcp@07372f86abc61a0e272fb6a024008f315a0bbf54 -
Branch / Tag:
refs/tags/v0.1.13 - Owner: https://github.com/retospect
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@07372f86abc61a0e272fb6a024008f315a0bbf54 -
Trigger Event:
push
-
Statement type: