Agentic architecture, MCP & Claude Code
20% of the examAgent patterns, the Model Context Protocol (MCP) and Claude Code workflows.
Thinking in agents
- Agent = loop: perceive → decide → act (tool use) → observe → repeat until a stop.
- Simple, well-described tools; too many hurts. Clear stop criteria + iteration cap.
- Break tasks down (orchestration, sub-agents) rather than one mega-prompt.
Model Context Protocol (MCP)
- Open standard to connect Claude to data/tools via MCP servers (tools, resources, prompts).
- A server exposes capabilities; a client (Claude Desktop, Claude Code, app) consumes them. Transports: stdio (local), HTTP/SSE (remote).
- One server serves many clients — write the integration once.
Claude Code
- Terminal coding agent: reads/writes files, runs commands, uses tools + MCP servers.
- Best practices: CLAUDE.md (project context), tool permissions, task decomposition.
Practice — 10 questions
- 1. What is MCP (Model Context Protocol)?
- 2. Two typical MCP server transports?
- 3. An agent loop spirals (endless tool calls). Fix?
- 4. Why expose an integration via an MCP server vs ad-hoc wiring?
- 5. Give persistent project context to Claude Code?
- 6. In MCP, which primitive exposes actions the model can execute?
- 7. When prefer a coded deterministic workflow over an autonomous agent?
- 8. Why craft a tool's description carefully?
- 9. Suitable pattern to break a complex task into coordinated subtasks?
- 10. Security best practice for a production Claude Code agent's tools?