Section 5 · Lesson 3
Model Context Protocol (MCP) — The Runtime Diagnostic Bridge
Turn AI from a glorified guesser into an evidence-driven partner — open protocol, bounded autonomy, and the Runtime Gateflow loop.
From guesser to evidence-driven partner
You ask the AI to fix a bug; the patch looks plausible but fails — or breaks something else. The model is often flying blind: inferring from incomplete static context. MCP moves you from speculation to observation with structured, verifiable runtime evidence.
What is MCP?
The Model Context Protocol is an open standard — a diagnostic bridge from your AI host (IDE) to external tools and data. Access is controlled and auditable: the AI can see what’s really happening inside your application, not just guess from chat.
Bounded autonomy
The agent is not free to roam your machine. It may only call tools you explicitly declare and permit. That is what makes MCP safe enough for real projects while still powerful.
Under the hood
MCP uses a familiar client–host–server architecture and JSON-RPC — structured, reliable, secure communication between the host and each tool server.
Evidence anchored to the spec
Every observation ties back to your specification. Debugging improves the spec too — vague or missing requirements show up in the evidence trail, creating a feedback loop that strengthens requirements.md over time.
Why a standard protocol matters
Without MCP, every team builds custom one-off integrations for each tool. MCP is a common language — a universal plug so the AI ecosystem scales together without reinventing the wheel.
Speculation
The old way: AI infers from static snippets and pasted logs — plausible patches that fail at runtime or create new bugs.
Observation
The goal: structured, verifiable evidence from live systems — the agent shows proof instead of guessing.
Evidence-gathering toolkit
Specialized MCP servers on the other side of the bridge — each gives the agent a different diagnostic superpower.
Playwright MCP
Agent eyes and hands — control a browser, navigate, click, type, re-enact the user journey from the spec; capture on-screen evidence.
Chrome DevTools MCP
Performance traces and network logs — turn “the page should be fast” into the exact trace showing which function slows the app (e.g. LCP).
Figma MCP
Design source of truth — reference real artifacts instead of guessing padding, color, or layout from chat.
Repo & custom servers
Specs, issues, and team-permitted tools through one open protocol — no one-off integrations per vendor.
Runtime Gateflow
A repeatable diagnostic loop inside spec-driven development — from a requirement to evidence, root cause, and a verifiable fix.
requirements.md / SPEC
Select spec
Pick a specific requirement to verify — one acceptance criterion or user journey, not the whole backlog.
Loop: evidence anchors back to requirements.md — vague specs surface in the trail.
MCP governance (three tiers)
Always do
Record evidence and link it back to the spec — every observation traceable to requirements.md.
Ask first
Before changing live system state outside a safe sandbox, get human confirmation.
Never do
Never access secrets or resources the MCP server was not explicitly permitted to expose.
Aligns with constitution tiers in Section 4 — record evidence, ask before risky state changes, never touch undeclared secrets.
| Bridge | Runtime role |
|---|---|
| Repository | Specs, diffs, and project structure |
| Playwright / browser | Frontend journeys and UI verification |
| Runtime / logs | Failures and performance with live context |
| Custom servers | Team-permitted tools only (bounded autonomy) |
Partner, not guesser
With MCP, the question shifts from whether AI can help debug — to how you collaborate with evidence, specs, and bounded tools. Configure servers in Cursor and run Runtime Gateflow against requirements.md.
Practice
Check your understanding
A few minutes of recall now saves rereading later.
1.What does MCP add to an AI coding workflow?
2.Which tool re-enacts the user journey described in the spec?
3.Bounded autonomy means the agent…
Order the runtime gateflow. Use the arrows to move a step, then check your order.
- 1Reproduce
- 2Record
- 3Localize
- 4Propose
- 5Select spec
- 6Map