Deployed Lab

Module 2 · Integration · Chapter 4 · Free

Design the MCP gateway: one front door for tools, auth and audit

16 min1 clickable picture1 hands-on lab1 predict, 2 quick quizzes, final quiz5-min video review
In 30 seconds

The picture: one staffed front desk in a hospital, instead of every visitor wandering to every ward.

Exam objective: Integration

Domain: Integration (21 percent of the exam, the heaviest domain). You should be able to:

The problem Priya, Northgate's CISO, asks one question in the security review: if a nurse reports a strange draft, can you show every system Relay touched to produce it? The review does not fail loudly. It stalls, and a stalled review costs the pilot its start date. Atlas is the answer Ruth brings back.
The plan for this chapter
  1. What breaks when every agent connects to every server directly.
  2. A tool call's journey through Atlas, check by check.
  3. The honest costs: latency per call and audit rows per month.
  4. The lab: write Atlas's config and policy, then judge gateway decisions.

Next: why direct connections fail as the agent count grows.

Step 1: One front door, or a corridor of open doors

Think of a hospital front desk. Visitors check in once, get a badge for the wards they may enter, and the desk keeps the visitor log. Without a desk, every ward checks badges its own way, and nobody holds the full log.

MCP basics live in Foundations: see MCP in Claude Code for servers, tools and .mcp.json. This chapter is the level up: what happens when several agents share several servers in production.

With direct connections, each new agent repeats the same work and the same mistakes:

None of these failures needs a careless team. They are what the shape produces: many agents times many servers means many copies of every control, and copies drift.

Atlas fixes this by being the only path. Agents connect to Atlas; Atlas connects to the servers.

Next: a single tool call, followed through every check.

Step 2: A tool call travels through Atlas

Atlas does five jobs in one place: authentication, per-tool permissions, rate limiting, audit logging and tool versioning. Tools are namespaced by system, so ehr.get_patient_summary and scheduling.lookup_appointment can never collide or be confused.

Least privilege is per agent. Relay gets drafting tools: ehr.get_patient_summary, scheduling.lookup_appointment, relay.draft_reply, scheduling.book_appointment, desk.escalate_to_clinician. Chartwise gets documentation tools instead, and no booking tool at all.

Press Next to follow one call from the portal to the EHR.

A tool call travelling through Atlas to the EHR A portal message reaches Relay, Relay calls a tool through Atlas, Atlas runs an auth check, a permission check and a rate check, writes the audit record, and the call lands on the EHR. Portalmessage in Relaytool call Atlasauth, rights, rate EHRsummary out Audit logone row per call
  1. Relay decides it needs the patient summary and calls ehr.get_patient_summary through Atlas.
  2. Atlas verifies Relay's identity. The EHR credentials live in Atlas, never in the agent.
  3. Atlas checks Relay's allowlist. get_patient_summary is on it. A booking call from Chartwise would stop here.
  4. Atlas counts all EHR calls this minute against 600. Under the cap, the call goes through.
  5. Every call, allowed or denied, writes one audit row: agent, tool, time, decision.

Where the picture breaks down:

Next: the honest arithmetic, latency and audit volume.

Step 3: Worked example, what the front door costs

Worked example. Atlas is not free. Price it before Priya does. All figures in this box are made up, except the pilot volume and the budget.

Latency: assume Atlas adds 40 ms per call (made up). Relay makes 4 calls per draft: 4 × 40 = 160 ms added per message.

Against the 3 second end-to-end budget (made up target): 160 ÷ 3,000 = about 5 percent. The checks buy cap enforcement and a full audit trail for 5 percent of the budget.

Audit volume at pilot: 18,000 messages a month × 4 calls = 72,000 audit rows a month.

At full volume: 260,000 × 4 = 1,040,000 rows a month. At a made-up 1 KB per row, that is about 1 GB a month to store and keep searchable.

Versioning rides along: when the EHR server ships tool version 2, Atlas can route Relay to version 1 until its prompts are retested, instead of every agent upgrading at once.

Her cold-open question was about a draft that was produced, which means allowed calls. An audit log of denials only cannot answer it. Storage is priced in the worked example instead: about 1 GB a month at full volume.

Denials are data too. A spike in denied calls usually means a prompt changed, a tool was renamed, or an agent is asking for something its job never needed. Because Atlas writes denied calls to the same log as allowed ones, Ruth can spot that pattern in one query instead of hearing about it in an incident review.

Next: allowlists, and the call that must never pass.

Step 4: Least privilege, written as lists

An allowlist is a short, reviewable sentence: this agent, these tools, nothing else. Anything not listed is denied by default.

Namespacing makes the lists readable in review: ehr., scheduling., desk. and relay. prefixes say who owns each tool and which cap applies.

Version pins sit in the same policy. When a server ships a new tool version, Atlas keeps each agent on its pinned version until that agent's prompts have been retested against the new shapes. The pin is one line in one file, reviewed like any other policy change, and Elena's steering group can see exactly which agent runs which version at any moment. If a policy needs a paragraph of explanation per agent, the lists themselves are probably doing too much.

Next: the lab, where you write the gateway design note.

Hands-on lab: the MCP gateway design note

Part A: build it locally

Lab: Atlas is Northgate's MCP gateway: the one front door between agents and the EHR, scheduling and desk systems. This lab runs in your browser and needs JavaScript enabled.

What to notice: every path writes an audit row, and only one path is a plain allow. Deny, throttle and escalate are designed outcomes, not errors.

Next: mix-ups and the quiz.

Mix-ups to avoid

Field note, November 2026 In production, the audit log is the feature teams thank the gateway for, usually during the first incident review. Rate limiting prevents a class of outage, but the log is what turns a three-day reconstruction into a ten-minute query.

Chapter quiz

Five questions in the exam's style. Score 70% or more to finish.

Review this chapter in 5 minutes

Watch the whole chapter recapped: why direct connections break, Atlas's five jobs, least-privilege allowlists, and pricing the latency and audit costs.

Decision rule: if a control must hold across every agent, it lives in the gateway, not in each agent. One front door, one counter, one log.

Independent exam preparation. Not affiliated with or endorsed by Anthropic.

Review

Glossary

MCP gateway
A single service between agents and MCP servers that enforces policy on every call. Example: Atlas at Northgate.
Namespacing
Prefixing tool names with their owning system. Example: ehr.get_patient_summary versus scheduling.lookup_appointment.
Allowlist
The explicit list of tools an agent may call; anything else is denied. Example: Chartwise's two documentation tools.
Least privilege
Giving each agent only the tools its job needs. Example: no booking tool for a documentation assistant.
Audit log
One record per call: agent, tool, time, decision. Example: 72,000 rows a month at pilot volume.
Throttle
Slowing or queueing calls to respect a cap. Example: deferring a routine summary read to the next minute.
Tool versioning
Running more than one version of a tool and routing agents deliberately. Example: Relay pinned to EHR tools v1.

Next: "Connect legacy systems: wrap, sync or stream, and what each choice costs".