Local AI Agents and the Model Context Protocol
Tool-Using Agents, MCP Servers, Evaluation and Safety
What you'll learn
An agent is a language model in a loop: it reads a request, calls tools, reads what the tools return, and keeps going until it can answer. That loop is easy to demo and hard to ship. Real agents call the wrong tool, pass malformed arguments, repeat themselves forever, run up token bills, forget what they did ten minutes ago, and do whatever a web page or an email tells them to do.
This course teaches agents as an engineering discipline. Students build the whole stack from scratch in readable Python: a tool registry with JSON Schema validation, an agent loop with budgets and a loop guard, a Model Context Protocol (MCP) server and client for the current protocol revision (2026-07-28), workflow patterns, context compaction and long-term memory, multi-agent teams, an evaluation harness that reports pass@k and pass^k with confidence intervals, and a layered safety policy with approval gates, an egress allowlist, a lethal-trifecta guard and a tamper-evident audit log.
Every lab runs on local models through Ollama. Every lab also runs with no model at all: a deterministic offline model stands in for the LLM, so the course works in a classroom without GPUs and every number in the instructor guide can be reproduced exactly. Students then rerun the same labs on a real model and compare.
Learning outcomes
By the end of the course, you can:
- Explain what makes a system an agent, and choose between a single model call, a fixed workflow and an autonomous agent for a given task, with a justification.
- Design tools that models use correctly: names, descriptions, JSON Schemas, validation and error messages written for a model to act on.
- Build an agent loop that always terminates with a named reason, survives model-server failures, contains slow tools and records a complete trace.
- Implement an MCP server for protocol revision 2026-07-28: stateless requests with per-request metadata,
server/discover, tools, resources, prompts, and multi round-trip requests with integrity-protected state. - Implement an MCP client over stdio and Streamable HTTP, apply the transport's header and origin rules, test any server for conformance, and bridge remote tools into a local agent.
- Apply the standard workflow patterns (chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer) and measure their cost against a free-running agent.
- Engineer an agent's context: tool-result clearing, compaction, and long-term memory with recall, deduplication, secret refusal and deletion.
- Build supervisor and handoff (swarm) multi-agent systems and decide from measurements whether they beat one agent.
- Evaluate agents with outcome-based graders, pass@k, pass^k and bootstrap confidence intervals, compare configurations with paired tests, and gate releases in CI.
- Threat-model a tool-using agent and defend it in depth: spotlighting, least privilege, approval gates, egress control, the lethal-trifecta guard, audit logs and sandboxed code execution.
Who it's for
- Software engineers asked to "add an agent" to a product or an internal workflow
- Platform and tooling engineers who need to expose internal systems to AI clients through MCP
- Technical leads who must decide whether a task needs an agent at all, and how to prove it works and is safe
Prerequisites
Comfortable Python (functions, classes, decorators, virtual environments), command line, HTTP and JSON. No machine-learning background is required. RNK-LLM-301 (local model serving) and RNK-RAG-401 (retrieval and evaluation) are helpful but not required.
Equipment and software
| Requirement | Version | Why |
|---|---|---|
| Python | 3.11 or newer | The whole lab kit. It uses only the standard library |
| Git | any recent | To keep your lab work under version control |
| A terminal and editor | any | VS Code, PyCharm, Vim, all fine |
| Ollama (recommended) | 0.12 or newer | To run the labs on a real local model with tool calling |
coverage (optional) | 7.4+ | To run the coverage gate yourself |
See the setup guide. Python 3.11+, Git and a text editor. Ollama with a tool-calling model is recommended for the live-model parts of each lab; every lab also runs with the built-in offline model.
The full setup guide, with verification steps, is in your learning materials when you enroll.
Format and study time
42 guided hours (10 modules × ~4 h + capstone clinic) plus ~15 h capstone build. Instructor-led cohort, 5-day intensive, or self-paced with office hours.
| Format | Schedule | Contact hours |
|---|---|---|
| A. Part-time cohort (recommended) | 10 weeks; one 4-hour session per week (or 2 × 2 h) + capstone demo in week 11 | 42 |
| B. Intensive bootcamp | 5 consecutive days, 2 modules per day (8 h/day), capstone due 2 weeks later + remote demo | 42 |
| C. Self-paced + office hours | 12 weeks recommended; weekly 1-hour office hours; recorded demo | ~40 + 12 |
Each scheduled class below states its own format, every meeting date and time, and its time zone.
What a seat includes
| Component | Detail |
|---|---|
| 10 instructor-led modules | ~40 h of live teaching, each with lecture notes, a slide deck, a lab and a quiz |
| A readable agent framework | labs/agentkit/: the loop, tools, schemas, MCP server and client, memory, multi-agent, evals and safety, in about 3,000 lines of standard-library Python |
| A tested codebase | 84 automated tests at 100% line and branch coverage over every lab file |
| Offline-capable labs | A deterministic offline model, so every lab runs without a GPU and reproduces the instructor's numbers exactly |
| A complete simulated business | Halcyon Robotics' support desk: customers, robots, orders, a knowledge base, an inbox and eleven tools |
| MCP from the specification up | Server, client, Streamable HTTP binding and a 14-check conformance suite for revision 2026-07-28, checked against the official Python SDK 2.3.0 |
| Evaluation and red-team datasets | 20 graded agent tasks, 3 cross-domain team tasks, 12 labelled tickets and 7 safety scenarios |
| Capstone project | Real-world brief, milestone reviews and a 100-point rubric |
| Assessment suite | 10 quizzes (100 questions), a final exam (40 MCQ + 5 short answer + 2 design scenarios), answer keys and rubrics |
| Verifiable certificate | PDF certificate with grade tier and registry-backed verification ID |
| Curated bibliography | Primary sources: the MCP specification, papers, and official engineering guidance |
| Instructor kit | Run sheets, demo scripts, expected results for every lab, troubleshooting and grading workflow |
Curriculum
- 01Agents: a model in a loop4 h · Lab: A 20-line agent and the same task through a traced agent loop
- 02Tool design: the agent-computer interface4 h · Lab: Schemas from typed functions, validation messages, and an error-message experiment
- 03Robust loops: budgets, retries, traces4 h · Lab: Six failure scenarios, each ending with a named stop reason
- 04MCP servers (protocol 2026-07-28)4 h · Lab: The support desk as an MCP server with an elicitation-confirmed RMA
- 05MCP clients, transports and interoperability4 h · Lab: An agent using remote tools over stdio and HTTP, plus a conformance report
- 06Workflows before agents4 h · Lab: Five workflow patterns with accuracy and model-call counts
- 07Context engineering and memory4 h · Lab: Four context strategies compared, and memory that survives a restart
- 08Multi-agent systems4 h · Lab: Single agent vs supervisor vs swarm, measured on two task suites
- 09Evaluating agents4 h · Lab: An eval suite with pass@k, pass^k, paired comparisons and a CI gate
- 10Agent safety and defense in depth4 h · Lab: A defense matrix, a utility-cost table, an audit log and a sandbox report
- ★Capstone clinic & demo day2 h · Lab: Capstone project
Assessment and completion
| Component | Weight |
|---|---|
| Labs (10 × 4%) | 40% |
| Module quizzes (10 × 1.5%) | 15% |
| Final exam | 15% |
| Capstone project | 30% |
- Pass: ≥ 70% overall, with the capstone ≥ 70% and at least 8 of 10 labs submitted
- Merit: ≥ 80% overall
- Distinction: ≥ 90% overall, and the capstone's evaluation report shows a measured improvement over its baseline with confidence intervals
Simply opening a lesson or a video never counts as completing an assessment. Completion is recorded only when the published requirements are met and your instructor has confirmed the result.
Course outcomes and recognition. Each course page explains the training and assessment it includes. Any RNK Academy completion certificate records the course requirements you met. It does not by itself establish an accredited qualification, professional license or third-party credential.
Course policies
- Late work: −10% per day, up to 3 days; after that, by arrangement only. One free 48-hour extension per student, no questions asked.
- Collaboration: discuss freely; write your own code and reports. Capstone teams of two must document who did what.
- AI assistants: allowed for coding, with disclosure in each report. You must be able to explain everything you submit. Fabricating results (metrics, traces, outputs) is academic misconduct.
- Data: the Halcyon world is fictional and safe to use. Never connect a lab agent to real email, payment or customer systems, and never give it real credentials.
- Safety exercises: Module 10 measures defenses against a fixed set of fictional scenarios inside the lab world. Testing systems you do not own or have written permission to test is not part of this course and is not allowed.
- Accessibility: materials are searchable PDFs; their Markdown sources (screen-reader friendly, exportable to HTML) are available on request. Contact the instructor for accommodations (extra time, alternative formats).
- Attendance (A/B): ≥ 80% required for certification; missed sessions can be made up by submitting the lab with a 1-page reflection.
Upcoming classes
No classes for this course are scheduled right now
New classes are added as instructors and dates are confirmed. Browse the courses to see what each one covers, or ask us about upcoming dates.