Home / Courses / RNK-AGT-401

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:

  1. 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.
  2. Design tools that models use correctly: names, descriptions, JSON Schemas, validation and error messages written for a model to act on.
  3. Build an agent loop that always terminates with a named reason, survives model-server failures, contains slow tools and records a complete trace.
  4. 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.
  5. 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.
  6. Apply the standard workflow patterns (chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer) and measure their cost against a free-running agent.
  7. Engineer an agent's context: tool-result clearing, compaction, and long-term memory with recall, deduplication, secret refusal and deletion.
  8. Build supervisor and handoff (swarm) multi-agent systems and decide from measurements whether they beat one agent.
  9. Evaluate agents with outcome-based graders, pass@k, pass^k and bootstrap confidence intervals, compare configurations with paired tests, and gate releases in CI.
  10. 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

RequirementVersionWhy
Python3.11 or newerThe whole lab kit. It uses only the standard library
Gitany recentTo keep your lab work under version control
A terminal and editoranyVS Code, PyCharm, Vim, all fine
Ollama (recommended)0.12 or newerTo 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.

FormatScheduleContact hours
A. Part-time cohort (recommended)10 weeks; one 4-hour session per week (or 2 × 2 h) + capstone demo in week 1142
B. Intensive bootcamp5 consecutive days, 2 modules per day (8 h/day), capstone due 2 weeks later + remote demo42
C. Self-paced + office hours12 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

ComponentDetail
10 instructor-led modules~40 h of live teaching, each with lecture notes, a slide deck, a lab and a quiz
A readable agent frameworklabs/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 codebase84 automated tests at 100% line and branch coverage over every lab file
Offline-capable labsA deterministic offline model, so every lab runs without a GPU and reproduces the instructor's numbers exactly
A complete simulated businessHalcyon Robotics' support desk: customers, robots, orders, a knowledge base, an inbox and eleven tools
MCP from the specification upServer, 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 datasets20 graded agent tasks, 3 cross-domain team tasks, 12 labelled tickets and 7 safety scenarios
Capstone projectReal-world brief, milestone reviews and a 100-point rubric
Assessment suite10 quizzes (100 questions), a final exam (40 MCQ + 5 short answer + 2 design scenarios), answer keys and rubrics
Verifiable certificatePDF certificate with grade tier and registry-backed verification ID
Curated bibliographyPrimary sources: the MCP specification, papers, and official engineering guidance
Instructor kitRun sheets, demo scripts, expected results for every lab, troubleshooting and grading workflow

Curriculum

  1. 01
    Agents: a model in a loop
    4 h · Lab: A 20-line agent and the same task through a traced agent loop
  2. 02
    Tool design: the agent-computer interface
    4 h · Lab: Schemas from typed functions, validation messages, and an error-message experiment
  3. 03
    Robust loops: budgets, retries, traces
    4 h · Lab: Six failure scenarios, each ending with a named stop reason
  4. 04
    MCP servers (protocol 2026-07-28)
    4 h · Lab: The support desk as an MCP server with an elicitation-confirmed RMA
  5. 05
    MCP clients, transports and interoperability
    4 h · Lab: An agent using remote tools over stdio and HTTP, plus a conformance report
  6. 06
    Workflows before agents
    4 h · Lab: Five workflow patterns with accuracy and model-call counts
  7. 07
    Context engineering and memory
    4 h · Lab: Four context strategies compared, and memory that survives a restart
  8. 08
    Multi-agent systems
    4 h · Lab: Single agent vs supervisor vs swarm, measured on two task suites
  9. 09
    Evaluating agents
    4 h · Lab: An eval suite with pass@k, pass^k, paired comparisons and a CI gate
  10. 10
    Agent safety and defense in depth
    4 h · Lab: A defense matrix, a utility-cost table, an audit log and a sandbox report
  11. ★
    Capstone clinic & demo day
    2 h · Lab: Capstone project

Assessment and completion

ComponentWeight
Labs (10 × 4%)40%
Module quizzes (10 × 1.5%)15%
Final exam15%
Capstone project30%
  • 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.