Skip to main content
Glama
README.md
# a2a-task-orchestrator-mcp

<p align="center">
  <img src="https://raw.githubusercontent.com/khoap1220-hue/a2a-task-orchestrator-mcp/main/assets/hero-task-orchestrator.svg" alt="a2a-task-orchestrator-mcp Architecture Banner" width="100%" />
</p>

<p align="center">
  <a href="https://registry.modelcontextprotocol.io/?q=a2a-task-orchestrator-mcp"><img src="https://img.shields.io/badge/MCP_Registry-io.github.khoap1220--hue%2Fa2a--task--orchestrator--mcp-6366f1" alt="Official Anthropic MCP Registry" /></a>
  <a href="https://github.com/khoap1220-hue/a2a-task-orchestrator-mcp/releases/latest"><img src="https://img.shields.io/badge/Desktop_Bundle-.mcpb_v0.3-22d3ee" alt=".mcpb Bundle" /></a>
  <a href="https://github.com/khoap1220-hue/a2a-task-orchestrator-mcp/actions"><img src="https://img.shields.io/github/actions/workflow/status/khoap1220-hue/a2a-task-orchestrator-mcp/ci.yml?branch=main&label=CI%20(Python%203.10--3.13)" alt="CI Status" /></a>
  <a href="https://khoaphan.dev/a2a-iq/"><img src="https://img.shields.io/badge/A2A_Spec-v1.0.1_Task_FSM_%2B_SQLite--WAL-3b82f6" alt="A2A v1.0.1 Task FSM" /></a>
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-10b981" alt="MIT License" /></a>
</p>

**`a2a-task-orchestrator-mcp`** (`v1.0.0`) is a **zero-dependency (`dependencies = []`, 100% Python >= 3.10 stdlib)** **SQLite-WAL A2A `v1.0.1` Task Finite State Machine Orchestrator**, **Multi-Agent `agent-card` Execution DAG Validator**, and **SSRF / Replay-Safe Push-Webhook Guard** packaged as a 1-click `.mcpb` v0.3 desktop bundle.

Multi-agent A2A deployments routinely fail in production due to TOCTOU task-state resurrection races, cross-tenant state leakage, confused-deputy scope escalation across delegated `agent-card` nodes, and SSRF/replay vulnerabilities in `pushNotificationConfig` webhooks. `a2a-task-orchestrator-mcp` enforces deterministic state, topology, and webhook invariants locally in `< 30ms` cold-boot latency with zero `pip` C-extension friction:

- **Optimistic CAS A2A `v1.0.1` Task FSM (`0` TOCTOU Resurrection):** Enforces all 8 official A2A `v1.0.1` `TaskState` values with atomic Compare-And-Swap (`expected_version`) locking in SQLite-WAL and deterministically rejects any transition out of terminal states (`COMPLETED`, `FAILED`, `CANCELED`, `REJECTED`).
- **Strict `SPEC_CLASS_13` Multi-Tenant Isolation & `SPEC_CLASS_14` DLP Hash Chains:** Rejects empty or wildcard `tenant_id` values (`*`, `%`, `all`), deduplicates task creation via `(tenant_id, idempotency_key)`, scrubs raw Bearer tokens / API keys / PEM private keys / Luhn payment cards / CVVs before persistence, and links every A2A `Artifact` in a SHA-256 hash chain (`prev_artifact_sha256 -> artifact_sha256`).
- **Kahn Multi-Agent DAG & Scope-Attenuation Validator:** Detects dependency cycles via Kahn's topological sort, computes critical-path latency budgets (`timeout_ms` DP), flags `S4-REJECT-005` / non-HTTPS `agent-card` URLs, and catches confused-deputy scope widening (`child_scopes - parent_scopes`).
- **SSRF & Replay-Safe Push-Webhook Guard:** Blocks `127.0.0.0/8`, RFC 1918 (`10/8`, `172.16/12`, `192.168/16`), AWS/GCP IMDS (`169.254.0.0/16`), IPv6 loopback/ULA (`::1`, `fc00::/7`), non-HTTPS schemes, and URL credentials while verifying/minting constant-time `HMAC-SHA256` `X-A2A-Notification-Signature` headers and `(tenant_id, delivery_id)` replay locks.
- **Zero-Env Lazy Boot:** If `A2A_ORCHESTRATOR_DB_PATH` is unset, empty, or an unexpanded `${user_config.db_path}` placeholder, the server boots in `< 30ms` with `0` disk writes and defaults lazily to `:memory:` when stateful tools are invoked.

---

## 7 Deterministic MCP Tools

| Tool Name | Read-Only | Purpose & Enforced Invariants |
| :--- | :---: | :--- |
| `orchestrator_create_task` | No (`idempotent`) | Create a tenant-isolated (`SPEC_CLASS_13`) A2A `v1.0.1` task in `TASK_STATE_SUBMITTED` (`version = 1`) with `context_id` and `(tenant_id, idempotency_key)` deduplication (`CLAIMED_NEW` vs `DEDUPED_EXISTING`). |
| `orchestrator_transition_task` | No | Transition across the 8 official A2A `v1.0.1` states using atomic optimistic `expected_version` CAS locking; deterministically blocks terminal resurrection (`TERMINAL_STATE_IMMUTABLE`). |
| `orchestrator_append_artifact` | No | Scrub raw secrets/cards (`SPEC_CLASS_14`) and append an A2A `Artifact` chained with SHA-256 (`prev_artifact_sha256 -> artifact_sha256`). |
| `orchestrator_validate_push_webhook` | No | Block SSRF targets (IMDS/loopback/RFC1918/IPv6/credentials), mint or constant-time verify `X-A2A-Notification-Signature` (`HMAC-SHA256`), and enforce `(tenant_id, delivery_id)` replay locks. |
| `orchestrator_validate_agent_dag` | Yes | Validate multi-agent DAGs via Kahn's topological sort: catch cycles, compute critical-path SLA latency, enforce `S4-REJECT-005` HTTPS `agent-card` rules, and block `child_scopes - parent_scopes` escalation. |
| `orchestrator_inspect_task_lineage` | Yes | Tenant-scoped (`WHERE tenant_id = ?`) audit query returning current task state, full CAS transition history, and cryptographic `verify_artifact_chain` verification. |
| `orchestrator_render_mermaid_trace` | Yes | Render GitHub-compatible Mermaid `stateDiagram-v2` (task FSM trail) or `flowchart LR` (multi-agent DAG critical path & scope findings). |

## 3 Slash Prompts & 2 Built-in Resources

| Type | Identifier | Description |
| :--- | :--- | :--- |
| **Prompt** | `design-and-validate-a2a-dag` | Model a multi-agent workflow DAG, audit scopes & `agent-card` URLs, and render a Mermaid `flowchart LR`. |
| **Prompt** | `audit-push-notification-webhook` | Audit a `pushNotificationConfig` URL for SSRF, `HMAC-SHA256` signature posture, and replay safety. |
| **Prompt** | `inspect-task-fsm-audit-trail` | Verify a tenant task's CAS transition log, SHA-256 artifact chain, and `stateDiagram-v2` trace. |
| **Resource** | `a2a-orch://spec/v1.0.1-task-fsm-matrix` | Complete JSON matrix of A2A `v1.0.1` states, allowed transitions, CAS locks, and `S4-REJECT-005` rules. |
| **Resource** | `a2a-orch://playbooks/zero-toctou-webhook-wal` | SQLite-WAL tuning, DLP hash-chain verification, and SSRF/HMAC webhook playbook ([Webhooks Reference](https://khoaphan.dev/webhooks/)). |

---

## Official A2A `v1.0.1` Task FSM Matrix

| Current State | Allowed `target_state` Transitions | Terminal Lock |
| :--- | :--- | :---: |
| `TASK_STATE_SUBMITTED` | `WORKING`, `INPUT_REQUIRED`, `AUTH_REQUIRED`, `COMPLETED`, `FAILED`, `CANCELED`, `REJECTED` | Mutable (`CAS`) |
| `TASK_STATE_WORKING` | `INPUT_REQUIRED`, `AUTH_REQUIRED`, `COMPLETED`, `FAILED`, `CANCELED` | Mutable (`CAS`) |
| `TASK_STATE_INPUT_REQUIRED` | `WORKING`, `FAILED`, `CANCELED` | Mutable (`CAS`) |
| `TASK_STATE_AUTH_REQUIRED` | `WORKING`, `FAILED`, `CANCELED`, `REJECTED` | Mutable (`CAS`) |
| `TASK_STATE_COMPLETED` | *(none — `TERMINAL_STATE_IMMUTABLE`)* | **Immutable** |
| `TASK_STATE_FAILED` | *(none — `TERMINAL_STATE_IMMUTABLE`)* | **Immutable** |
| `TASK_STATE_CANCELED` | *(none — `TERMINAL_STATE_IMMUTABLE`)* | **Immutable** |
| `TASK_STATE_REJECTED` | *(none — `TERMINAL_STATE_IMMUTABLE`)* | **Immutable** |

---

## Installation & Quick Start

### 1. 1-Click Claude Desktop Bundle (`.mcpb` v0.3)

Download `a2a-task-orchestrator-mcp.mcpb` from the [Latest GitHub Release](https://github.com/khoap1220-hue/a2a-task-orchestrator-mcp/releases/latest) and open it in Claude Desktop. Leave **SQLite WAL Database Path** blank for zero-config `:memory:` execution, or set a file path (for example `~/.a2a/orchestrator.sqlite`) for persistent WAL storage across sessions.

### 2. Python Package / `mcpServers` Config (Claude Desktop, Cursor, Windsurf, VS Code)

```bash
pip install a2a-task-orchestrator-mcp
a2a-task-orchestrator-mcp selftest --json
```

```json
{
  "mcpServers": {
    "a2a-task-orchestrator": {
      "command": "a2a-task-orchestrator-mcp-server",
      "env": {
        "A2A_ORCHESTRATOR_DB_PATH": ":memory:"
      }
    }
  }
}
```

### 3. Non-Root Docker Container

```bash
docker build -t a2a-task-orchestrator-mcp .
docker run --rm -i a2a-task-orchestrator-mcp
```

---

## Engineering & Ecosystem Links

- **A2A v1.0.1 & MCP IQ Benchmark Hub:** https://khoaphan.dev/a2a-iq/
- **Idempotent & SSRF-Safe Webhook Architecture:** https://khoaphan.dev/webhooks/
- **Transparent Written-First A2A Engineering Services:** https://khoaphan.dev/services/?ref=gh-a2a-task-orchestrator-mcp — Operated as a 100% written, asynchronous A2A engineering workflow via GitHub PRs/Specs, Email (`khoa@khoaphan.dev`), and In-App Messaging with Code-First PoCs and automated test suites upfront.

## License

Released under the [MIT License](LICENSE).

TDQS

A3.9/5.0

Scored across 7 tools

Disambiguation5/5

Each tool targets a distinct operation in the A2A lifecycle: task creation, FSM transition, artifact append, webhook validation, DAG validation, lineage inspection, and visualization rendering. The two validation tools are clearly separated by target (push webhook vs. agent DAG), so an agent should not confuse them.

Naming Consistency5/5

All tools use a consistent `orchestrator_` prefix followed by snake_case verb_noun phrasing such as `create_task`, `transition_task`, and `validate_agent_dag`. The convention is predictable throughout the set.

Tool Count5/5

Seven tools is a well-scoped set for task orchestration, comfortably within the 3-15 ideal range. Each tool contributes a distinct lifecycle, validation, inspection, or rendering capability without obvious redundancy.

Completeness4/5

The surface covers core task lifecycle operations, artifact integrity, webhook and DAG validation, lineage inspection, and trace rendering. Minor gaps exist around task listing/search and possibly metadata updates, but the main orchestration workflows are covered.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues