Steward MCP
Official# Steward MCP
**Git tracks your code. Steward tracks your commitments.**
`steward-mcp` is a local-first, zero-dependency state engine and [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for AI coding environments (**Antigravity, Claude Code, Cursor, Windsurf, Codex, Hermes**).
---
## Why this exists
Every AI coding session hits the same three walls:
1. **Context compaction wipes your decisions.** Two hours in, the chat compacts and the agent forgets why you rejected Redis or why a migration has to stay backwards-compatible.
2. **Switching models rewrites reality.** You swap from Claude to Gemini to DeepSeek (or a local model) to manage token costs or quotas—and the new model quietly contradicts what the last one agreed to.
3. **Agents mark unverified work "done."** Memory files let any prompt quietly overwrite project truth with zero proof.
**Reasoning is rented. State is the only thing you own.**
Steward keeps your project's **Decisions**, **Open Debt**, **Verified Components**, and **Current Focus** in a local, hash-chained ledger (`./.steward/`)—and puts a **fail-closed gate** in front of marking anything "verified."
- **Zero external dependencies** (pure Python 3.10+ standard library)
- **100% local & offline** (no cloud account, no API keys, no telemetry)
- **Works across every ADE** over standard MCP `stdio`
---
## Quick Start (60 seconds)
### 1. Install
```bash
pip install -e .
# or run directly from source without installing:
PYTHONPATH=src python3 -m steward_mcp --help
```
### 2. Connect to your ADE
Add one MCP block to your IDE / agent config:
#### Antigravity / Cursor / Windsurf (`mcp_config.json` or `.cursor/mcp.json`)
```json
{
"mcpServers": {
"steward": {
"command": "steward-mcp",
"args": ["serve", "--state-dir", ".steward", "--project", "default"]
}
}
}
```
#### Claude Code
```bash
claude mcp add steward -- steward-mcp serve --state-dir .steward --project default
```
#### Zero-install fallback (straight from a cloned repo)
```json
{
"mcpServers": {
"steward": {
"command": "python3",
"args": ["-m", "steward_mcp", "serve", "--state-dir", ".steward", "--project", "default"],
"env": {
"PYTHONPATH": "/path/to/steward-mcp/src"
}
}
}
}
```
### 3. Add the 15-line agent rule
Copy the matching file from [`ade-rules/`](ade-rules/) into your repo (`AGENTS.md`, `CLAUDE.md`, `.cursor/rules/steward.mdc`, or `SKILL.md`) so your agent knows *when* to restore, decide, log debt, and freeze.
---
## What Your Agent Gets (12 Tools · 3 Resources · 2 Prompts)
| Category | Tool | What it does |
| :--- | :--- | :--- |
| **Read / Fold** | `steward_status` | ~100-token snapshot of focus, counts, open debt, and recent decisions |
| | `steward_query` | Sliced reads (`decisions`, `debt`, `mechanisms`, `proposals`, `search`, `entry`) |
| | `steward_restore` | Restore context at session start, after compaction, or after a model swap |
| | `steward_freeze` | Fold live state into human-readable `.steward/<project>/ANCHOR.md` |
| **Commitments** | `steward_decide` | Record a binding decision (`DEC-NNNN`) with rationale in the audit chain |
| | `steward_debt_open` | Log an open bug, debt, or constraint (`§7`) so it cannot silently vanish |
| | `steward_debt_resolve` | Mark a debt resolved inline with proof (never deletes history) |
| | `steward_focus` | Set the single active challenge, hypothesis, and next action |
| **Fail-Closed Gate** | `steward_propose` | **Tier 1:** write a cheap, unvalidated draft (`PROP-NNNN`) |
| | `steward_adjudicate` | Run gate checks (identity, concrete evidence, file SHA-256 snapshot) → mint single-use v2 token |
| | `steward_promote` | **Tier 2:** spend the v2 token to promote a verified component (`M1`, `M2`, …) |
| **Forensics** | `steward_verify` | Verify the entire genesis-to-tip hash chain and every spent gate token |
**MCP Resources:** `steward://status` · `steward://anchor` · `steward://debt/open`
**MCP Prompts:** `onboard` · `handoff`
---
## How the Fail-Closed Gate Works (Drafts vs. Merged Truth)
Think of it like a Git PR before merge:
1. Anyone (or any model) can call `steward_propose` to write a draft. Drafts are clearly marked **NOT BINDING**.
2. To mark a component **verified/canonical**, the agent calls `steward_adjudicate` with concrete proof (and optionally `artifact_path`, which Steward hashes and freezes as a byte-exact snapshot).
3. If all checks pass, the gate mints a **single-use, TTL-bounded, payload-bound v2 token**.
4. `steward_promote` verifies the token, checks that neither the text nor the frozen file bytes were tampered with, commits atomically (with OS `flock` + `fsync`), and consumes the token.
If an agent tries to skip the gate, reuse a token, edit the evidence after approval, or tamper with the snapshot, **the write is refused at the boundary.**
---
## CLI Quick Reference
```bash
steward-mcp init --state-dir .steward --project myapp
steward-mcp status --state-dir .steward --project myapp
steward-mcp anchor --state-dir .steward --project myapp
steward-mcp verify --state-dir .steward --project myapp
```
---
## Research Companion
`steward-mcp` is both a practical open-source tool and the reproducible companion implementation for the design-science chapter:
- [**State Is Not Memory: Why an LLM Agent Needs a Steward**](docs/thesis-chapter.md) *(includes a Plain-English Summary & Dev-to-Paper Glossary)*
- [**Architecture & Register Map (§1–§10)**](docs/architecture.md)
Built by **DataMind Labs Africa** · MIT Licensed.
TDQS
Scored across 12 tools
Most tools map to a clearly distinct action on a distinct region of the ledger (status/query/restore/verify for reads; decide/propose/promote for tiered writes; debt_open/debt_resolve for debt). The main soft spots are the three read tools (steward_status, steward_query, steward_restore) and the adjudicate/promote pair, which depend on descriptions to be told apart, but the descriptions do make the boundaries explicit.
All 12 tools share a steward_ namespace prefix and snake_case, with mostly verb-style names (decide, query, promote, freeze, verify). Minor deviations exist: debt_open/debt_resolve insert a resource noun mid-name, and status/focus are noun forms rather than verbs, but the pattern remains readable and predictable.
12 tools is well within the ideal 3-15 range and each one maps to a real step in the ledger lifecycle: read, tiered writes, gated promotion, and session freeze/restore/verify. Nothing appears redundant or padded.
The surface covers the core lifecycle: lightweight and sliced reads, decision/debt/focus/proposal writes, fail-closed adjudication, promotion, handoff freeze/restore, and chain verification. Gaps are minor but real—no tool to write risks/conventions/mechanisms or retire components (only query them), and no explicit proposal listing/rejection beyond the gate, though append-only design and steward_query make these workable.