Metadata-Version: 2.4
Name: fdu-team-mcp
Version: 0.2.1
Summary: MCP control plane for the FDU + Engineering delivery team: approval gate, packet and report validation, evidence ledger.
Author: Alberto Ancona
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/albanc80/agentic-delivery-team
Keywords: mcp,agents,governance,delivery,human-in-the-loop
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# team-mcp

The team's **control plane** as an MCP server, so the gates stop belonging to one harness.

Every host that speaks MCP — Claude Code, Codex CLI, Hermes, OpenClaw — can call the same implementations, which
means an approval means the same thing everywhere instead of meaning "OpenClaw checked it".

It reimplements no rule. Each tool shells out to the repository's own checkers, so the evaluation suite in
`pod/evaluation/` remains the definition of correct behaviour.

## Tools

| Tool | Purpose |
|---|---|
| `gate_check` | Gate A: verify a human ApprovalRecord against a DeliveryContract **by content hash**. Returns `APPROVED` or `BLOCKED` with reasons. Takes paths, JSON strings or objects. |
| `packet_validate` | Validate a TaskPacket against the shipped schema. A packet that fails does not start a pod. Takes a path or the document text. |
| `report_validate` | Validate a CompletionReport. |
| `ledger_append` | Append one timestamped, tamper-evident line to an engagement ledger. |
| `roles_list` | The team as data: role, team, tier, exec posture, spawn list. |
| `constitution` | The rules (C1–C8) every role obeys. |

Tools only — no prompts, no resources — because a tool is the one primitive every host implements the same way.

Every tool accepts the **document itself** as well as a file path. A path only resolves when the client shares a
filesystem with the server; a hosted session or a sandboxed client passes the content instead.

## Run it

```bash
pip install fdu-team-mcp            # published: https://pypi.org/project/fdu-team-mcp/
fdu-team-mcp                        # no configuration needed
```

The wheel carries its own data: the policy matrix, schemas, constitution, all 15 role contracts and the real
validators, copied from the repository at build time and hash-recorded in `data/BUNDLE.json` (CI fails if the
repository changes and the bundle is not refreshed). Installing the package is the whole setup.

`FDU_TEAM_ROOT` is a maintainer override: point it at a checkout and the server reads that repository's data
instead of the bundled copy. It changes which data is read, never which code runs.

Releasing a new version: [`docs/PUBLISHING.md`](../docs/PUBLISHING.md).

`FDU_TEAM_ROOT` must point at a checkout of this repository: that is where the checkers, schemas and manifest
live. Without it the server refuses to start rather than guessing.

## Wire it into a harness

**Claude Code** — nothing to do. The plugin ships `.mcp.json`:

```json
{ "mcpServers": { "team": { "command": "fdu-team-mcp", "args": [] } } }
```

Registering it by hand is only needed where the plugin is not used, and takes the same two lines.

**Codex CLI**:

```bash
codex mcp add team -- fdu-team-mcp
```

**Hermes / OpenClaw** — both configure MCP servers in their own settings; point the command at `fdu-team-mcp` with
the same env var.

## Verify it works

```bash
python3 mcp/selftest_client.py
```

That spawns the server the way a harness does and speaks real stdio JSON-RPC at it: handshake, tool discovery,
an approval that passes, an **edited contract that is refused**, a ledger append, a packet that validates and a
template that does not. Eleven checks, all executed — see the run in the repository's CI.

## What it does not do

- **It cannot prove authorship.** `gate_check` proves a record matches the approved hash and that the approver
  identity differs from the requester. It cannot prove a human typed it. Sign the record if that matters.
- **It cannot enforce anything by itself.** A host that ignores a `BLOCKED` result is a host that ignores it. The
  gate is a control only where the role contract says the role must call it before spawning — the constitution's
  C6 and C7.
- **It does not ship on npm.** The control plane is Python because the validators are Python; an npm package
  would only hide that requirement, not remove it. `pip install fdu-team-mcp` and `uvx fdu-team-mcp` are the
  supported paths, and MCP hosts accept any command, so nothing downstream needs a Node package.
