MCP Integration
Example workflows
Concrete agent-loop examples using the MCP tools and resources — picking up a story, proving acceptance criteria, and handling a blocker.
These walk through what an agent actually calls, in order, for common situations. Tool names are written for the local server (intent mcp); swap in the remote server's equivalents from Tools & resources if you're on the HTTP endpoint (mark_in_progress → start_story, mark_done → complete_story, etc.).
Picking up the next story
- Call
list_stories(or read theintentdocs://project/statusresource first, to decide whether to keep going or stop for the session). - Pick the highest-priority
todostory whose dependencies are done — the same selection logic asintent nexton the CLI. - Call
mark_in_progresswith the story's ID. - Read
intentdocs://project/storymap(orget_context, on thestandard/allmode) for full context — personas, related stories, data model references — beyond whatlist_storiesalone returns. - Implement.
Proving acceptance criteria before marking done
Acceptance criteria have a method — executable, agent_self_check, visual_render, or founder_confirm. Only executable criteria have something an agent can literally run and observe.
- After implementing, run each
executablecriterion's command yourself (or defer tointent checkif you're shelling out to the CLI from within the agent session). - Call
report_criteriawith the story ID and one result per criterion:{ criterion_id, status: "pass" | "fail" | "blocked", detail }.detailshould describe what you actually observed — it's the evidence trail, not a formality. - Call
mark_done. If amustcriterion isn't reported aspass, the tool call returns the blocking list instead of completing — fix it and re-report, or passforce: trueif you have a real reason to override (this gets recorded).
Raising a blocker instead of forcing past it
If a must criterion keeps failing after a few real attempts, don't loop indefinitely and don't force it through:
- Call
raise_blockerwithstory_id,summary,attempting,failing, anddecision_needed— a single, concrete decision the founder needs to make (not "help me debug this"). - Stop working the story. Don't call
mark_doneafterward —raise_blockeris the terminal action for that story until a human responds.
Reacting to a cancelled story
If a human runs intent stop <id> on a story an agent is mid-flight on, the local MCP server refuses further tool calls on it (except list_stories/get_status) and returns a message starting with "🛑 Development of ... was cancelled." An agent's loop should treat that response as a hard stop for the current story, not a transient error to retry.
Logging a decision an agent made unprompted
If an agent makes a real architectural call mid-implementation — a library choice, a schema tradeoff — call log_decision with a short title, the reasoning, and a category (architecture, product, technical, or trade-off). This is what shows up in CLAUDE.md after the next intent sync --context, so the next session (agent or human) doesn't re-litigate it.