HTMLCSSJAVASCRIPTANGULARINTERVIEW QUESTIONSSQLPYTHONJAVAPHPHOW TOW3.CSSCC++C#BOOTSTRAPREACTNEXTJSMYSQLJQUERYEXCELXMLDJANGONUMPYPANDASNODEJSDSATYPESCRIPTANGULARJSGITPOSTGRESQLMONGODBASPAIRGOKOTLINSWIFTSASSVUEGEN AIAGENTIC AIPROMPT ENGINEERINGDOCKERKUBERNETESSPRINGSPRING BOOTUNIXSCIPYAWSCYBERSECURITYDATA SCIENCEINTRO TO PROGRAMMINGINTRO TO HTML & CSSBASHRUSTTOOLS
AI-Powered Full Stack Tutorial 0/70 lessons ~6 min read Lesson 43“React, Next.js, Node, PostgreSQL, LLMs, RAG, agents, and production AI apps”
MCP Fundamentals and Tool Ecosystem Integration
TechLearningPro wanted the tutor to read a glossary entry and the support desk to look up a ticket the specialist already may see.
Course progress0%
Focus
23 guided sections
Practice signal
Examples included
Career prep
Interview Q&A included
AI-Powered Full Stack Development · Lesson 43 · AI Agents, Workflow Automation and Integrations
Lesson Overview
TechLearningPro wanted the tutor to read a glossary entry and the support desk to look up a ticket the specialist already may see. A prototype connected a Model Context Protocol server — MCP — straight to the model client. The server advertised every tool the author's laptop had registered: read a lesson, write a file, and refund_course, the name Lesson 36 already forbids. The model picked refund_course because the learner typed the word "refund." The protocol did what it claims. It listed tools and carried a call. The product had no allow-list, no tenant, and no approval.
The fix is to learn MCP as an ecosystem boundary and to integrate it through a port you own. A host is TechLearningPro's server. A client is the session the host opens to a tool server. A server offers tools, resources, and prompts. The host allow-lists names, validates arguments, and classifies each tool as read, draft, or write. A course read may run. A business write returns needs_approval and does not open a socket. Support tools that Lesson 37 already registered are not reimplemented here: the host calls executeSupportTool with a SupportCaller. MCP's wire messages stay inside an adapter. Copy method names from the specification revision you pin. This lesson does not invent them and does not call a vendor client.
The panel may show a proposal, as in AI SDKs and Streaming UI Integration. A support proposal that is allowed to run goes to executeSupportTool in Tool Calling and Secure Action Execution. That function may look up TCK-1042 or, for a support_lead, open a pending review. It does not settle refund_course. Business writes wait for Connecting AI Applications to Business APIs. The MCP course is the protocol deep-dive. The Agentic course covers agents that plan tool use. This lesson is the trust boundary in the full-stack app.
Planning assumptions:
The lab is an in-process catalog and an invoker. No MCP process is spawned and no socket is opened.
Transports you will see in the spec include local process pipes and remote HTTP. The exact names and handshake messages change between revisions. Verify them before you write an adapter.
Tools, resources, and prompts are the three primitives this lesson teaches. Later spec revisions add more capabilities. Do not assume the list in a blog is complete.
refund_course is refused. A business write such as billing.refund.create returns needs_approval and does not run. lookup_ticket in production is executeSupportTool, not a second SQL path. The lab fake only proves the host checks.
Secrets are handles on the adapter that would connect to a remote server. The catalog code does not read them.
Argument values in tests are synthetic: a glossary term, a ticket id. No customer payload and no key.
Learning Objectives
By the end of this lesson you will be able to:
Name the MCP roles — host, client, server — and match them to TechLearningPro, the session, and a tool process.
Distinguish tools (actions), resources (readable data), and prompts (templates the server offers).
Explain why a server's advertised list is not the product's allowed list.
Classify a tool as read, draft, or write and enforce that class in the invoker.
Validate arguments against a small required-string schema before any handler runs.
Scope every call with session tenant, user, and role. Ignore tenant fields inside tool arguments.
Return needs_approval for a business write and leave the handler uncalled. Delegate lookup_ticket to executeSupportTool rather than writing a second query.
Return not_allowed for a name the server might offer and the product has not listed.
Read a resource only through the same authorization idea as Module 3: the caller may see that object.
Describe prompts from a tool server as untrusted templates until a human merges them into a versioned prompt.
State that wire method names and transport names come from a pinned spec, not from this lesson.
Test the glossary read path and the credit refusal path.
Log tool name, effect, and decision, without argument values that may contain personal text.
Keep the model from being the component that opens a network connection to the tool server.
Prepare Lesson 44 to attach business APIs behind the same allow-list rather than behind a new agent framework.
You can read a TypeScript union. You do not need a live MCP server or a provider key. The MCP course can wait until the port is clear.
What is MCP Fundamentals and Tool Ecosystem Integration?
MCP is an open protocol for connecting an application that uses a model to external tools, data, and prompt templates through a standard session. Fundamentals here means the roles and the three primitives, plus the product rules that make a connection safe. Tool ecosystem integration means TechLearningPro can talk to a glossary server or a ticket server without giving that server the right to define policy.
The protocol exists because every agent demo invented its own tool JSON, and desktop hosts wanted one way to attach local utilities. That is a useful standardization of transport and discovery. It is not a standardization of permission. A server can truthfully say "I have a write tool." The host must truthfully say "this tenant's tutor may not call it."
Historically, companies integrated internal APIs with gateways, scopes, and audit logs. MCP is a new front door for the same problem, often sitting close to a model. Treat discovery as input. Treat the call as a privileged operation. The code in this lesson is ToolEcosystemPort. An adapter that speaks MCP translates between the pinned spec and this port. Feature code imports the port.
Term
Meaning in this lesson
Host
The TechLearningPro server process that holds authority
Client
The host's session to one tool server
Server
A process that offers tools, resources, and prompts
Tool
A named action with an argument schema and an effect class
Resource
A readable object addressed by a stable URI the host checks
Prompt
A template offered by a server, untrusted until reviewed
Allow-list
Names the product permits for a role
Effect
read, draft, or write
Approval
Required result for every write in this lesson
Why Do We Need It?
text
Model client binds a tool server directly
|
v
Every advertised tool is callable, including writes,
and arguments choose the tenant
|
v
Host owns ToolEcosystemPort
|
v
Allow-list, schema check, session scope,
business writes return needs_approval
Benefits:
The tutor can open a glossary entry the learner may see.
A credit tool can exist in a fixture and still be impossible to run from this path.
Tests do not spawn a process.
A future MCP adapter can be reviewed in one package.
Business APIs in Lesson 44 plug in as more tools with the same classes.
Real World Example
A learner asks for the definition of "checkpoint." The tutor proposal is read_glossary with { term: "checkpoint" }. The host checks the learner role, the allow-list, and the schema, then reads a fixture or the course glossary. The result is text the panel can show as a source, not as a grade change.
A specialist's assistant proposes lookup_ticket for TCK-1042. The host checks the staff role and the tenant, then calls executeSupportTool so the organization id comes from SupportCaller, as in Lesson 37. The same server binary also advertised refund_course. invoke returns not_allowed. A listed business write such as billing.refund.create returns needs_approval and does not open a billing socket. open_refund_review stays inside executeSupportTool: a lead may insert a pending review, and this MCP package does not add a second writer.
Banks expose account lookups and wire transfers on different scopes even when they share a gateway. Amazon's internal tool catalogs separate read APIs from mutating ones. Google and Microsoft publish plugin and connector models with consent screens. MCP is closer to a connector socket than to a consent screen. Netflix-style edge gateways would not let an upstream catalog grant itself a new scope. TechLearningPro's host is that gateway for tools. Read the protocol itself on MCP when you implement a wire adapter.
Internal Working
The route authenticates and builds a ToolScope: tenantId, userId, role of learner or staff. The body may contain a tool name and arguments. It may not contain the tenant.
listAllowed returns descriptors whose allow-list includes the role. Learners see read_glossary. Staff see read_glossary and lookup_ticket. Neither list includes refund_course. billing.refund.create is withheld from the model menu and still returns needs_approval if a proposal names it.
The model, or a staff UI, proposes a call. The proposal is data. invoke is the only function that runs a handler.
If the name is absent from the role's list, the result is not_allowed and the handler map is not consulted.
The schema check requires a JSON object whose required keys are strings within length caps. Extra keys are rejected in the lab so a hidden tenantId cannot ride along.
For read and draft, the handler receives the scope and the cleaned arguments. It must use the scope's tenant, not an argument.
For a business write, invoke returns needs_approval before any handler. refund_course is not_allowed. There is no billing client in the map. Support lookups delegate to executeSupportTool.
Resource reads use readResource. The URI must match a prefix the role may use, such as glossary://. A ticket:// URI for a learner is not_allowed. The handler still checks the tenant.
Server-offered prompts are listed as names and descriptions. Adopting one means a human copies it into a reviewed promptVersion. The runtime does not swap LESSON_REPLY_SYSTEM for a string a server sent.
Logs record scope role, tool name, effect, and result reason. They omit argument values.
Architecture
flowchart TB
subgraph product [TechLearningPro host]
Route[Authenticated route]
Port[ToolEcosystemPort]
Allow[Allow-list and schemas]
Invoke[Invoker]
end
subgraph handlers [Handlers]
Glossary[Glossary read]
Ticket[Ticket read]
end
subgraph outside [Outside the trust boundary]
Model[Model proposes a call]
Mcp[MCP server adapter later]
Spec[Pinned MCP spec]
end
Model --> Route
Route --> Port
Port --> Allow --> Invoke
Invoke --> Glossary
Invoke --> Ticket
Mcp --> Port
Spec --> Mcp
text
Session scope + proposed name + arguments
|
v
listAllowed? name must be present for the role
|
v
schema: required strings only, no extra keys
|
+--> read or draft --> handler(scope, args)
+--> write --> needs_approval
+--> unknown --> not_allowed
|
v
ToolResult
|
x MCP method strings live in the adapter, copied from the pinned spec
x refund_course has no handler
The model is upstream of the proposal. It is not on the path that opens the tool server's transport. The host is.
Deep Dive
Host, client, server
The host is the authority: it has the user session and the allow-list. The client is a library or adapter the host uses to speak to one server. The server is the glossary process, a remote connector, or a test double. People say "MCP client" and mean the host. Keep the words straight in reviews. If the client library also calls a model, do not use that bundle in the route. Split "talk to a tool server" from "talk to a model." ModelPort remains the model. ToolEcosystemPort remains the tools.
Tools, resources, prompts
A tool is a function call with arguments. A resource is a noun you read by URI. A prompt is a template the server thinks is useful. Tools want the strictest review because they change things or look like they do. Resources want the retrieval rules you already trust: if the caller cannot see the object, the read fails. Prompts want a content review, because a tool server that ships a system prompt can rewrite policy if you apply it automatically. List prompts for staff to read. Do not install them at runtime.
Effect classes
read returns data the caller may see. draft returns text that is still a draft. write would change a ledger, send mail, or edit a grade. This lesson's invoker treats write as needs_approval unconditionally. Lesson 45 can add an approval id and call a handler. Promoting a tool from read to write is a security review, not a catalog edit in a database the model can update.
Schemas without a new framework
The lab schema is intentionally small: object, required string fields, maximum length, no extra keys. Production can use a JSON Schema validator you pin. That validator is a library with its own API. Wrap it so handlers receive a typed object. Do not evaluate schema code. Do not accept a schema document from the MCP server and then run it as the only check. The server's advertised schema informs the reviewer. The host's schema is what invoke enforces. If they differ, the host wins, and the tool stays disabled until a human updates the host schema.
Transports and spec revisions
Local servers are often a subprocess with a pipe. Remote servers are HTTP. The spec has changed how HTTP is framed. An adapter must pin a revision, implement that revision's handshake and call messages, and time out the subprocess. This lesson's tests never spawn one, so a student machine stays quiet and free of a surprise binary. When you do write the adapter, the first test is still the port test: a write cannot run even if the server returns success for it. The adapter should not bypass invoke.
What the model is allowed to supply
The model may supply a tool name and string arguments that the schema allows, such as a glossary term. It may not supply role, tenantId, or effect. Those fields are not in the argument object. If they appear, extra-key rejection fires. The host's scope wins.
Ecosystem growth
New servers will appear: calendar, email, warehouse, course catalog. Each one is a dependency with a lifecycle. Register them in source control beside their effect class. A marketplace click that enables a server for all tenants is the failure mode this port exists to prevent. Tenant enablement is a staff policy row: which server ids, which tool names, still intersected with the code allow-list. The code list is the ceiling. The tenant row can only narrow it.
listAllowed is synchronous in the lab because the catalog is in memory. A remote discovery adapter may be async behind the same method later. Do not change the result type when you do. Map the spec's discovery payload inside the adapter.
Intermediate example: argument check
packages/tool-ecosystem/src/schema.ts
typescript
importtype{ StringSchema }from"./port.js";
/** Host schema. Rejects extra keys so a caller cannot smuggle tenantId. */
refund_course has an empty roles array, so every role receives not_allowed before the write branch. billing.refund.create is a write with a staff role, and invoke still returns needs_approval without calling a billing port. listAllowed hides writes from the model menu. There is no credit function in deps. Production lookup_ticket calls executeSupportTool with a SupportCaller. This fake only checks that the host passed scope.
return text ?{ ok:true, text }:{ ok:false, reason:"not_found"};
}
The URI is not fetched with a generic HTTP client. load is a port that knows glossary and ticket storage. A https:// URI is not_allowed until you deliberately add a prefix and a client with its own allow-list.
No process is spawned. No environment variable is read. The glossary string is synthetic course copy.
Architecture Diagram
text
Model or staff UI proposes a tool name
|
v
Route builds ToolScope from the session
|
v
ToolEcosystemPort.invoke
|
+--> allow-list by role
+--> effect write? needs_approval
+--> parseStringArgs
+--> GlossaryPort or TicketPort
|
v
ToolResult
Later MCP adapter, not in the lab:
pinned spec messages
|
v
map discovery onto ToolDescriptor
|
v
still call invoke
|
x do not pass server success for a write straight to the client
When you add that adapter, the module comment should name the spec revision, the transport you implemented, and the date you read the spec. If the spec's message names differ from a blog post, the spec wins.
Real-Time Enterprise Example
Production registers two servers in configuration: glossary and tickets, each with a secret handle for its credential and a base URL or a command line that the adapter alone can see. The composition root builds clients. The tutor receives ToolEcosystemPort. A learner question that needs a definition calls invoke for read_glossary only after the proposal name is on the learner list. The result is inserted as a passage with a source label, then the Lesson 40 chain may draft. The tool result is not itself the final answer unless the product wants a pure lookup, in which case you can return the definition without a model call.
Tenant challenge: tenant B disables lookup_ticket even for staff. Intersect listAllowed with a tenant policy set loaded from PostgreSQL. The code catalog remains the ceiling. An empty intersection means the model receives no tools, and the tutor still answers from passages or abstains. Outage challenge: a glossary timeout becomes unavailable. The tutor does not retry the tool in a loop and does not invent a definition. Approval challenge: if a future change adds staff to refund_course roles, the effect write still returns needs_approval. Only Lesson 45, with an approval id, should call a ledger handler that this package does not export today.
High-traffic challenge: cache glossary definitions by term inside the glossary service, not inside the invoker, and vary nothing by user for public course terms. Ticket reads are not cached across users.
Performance Optimization
listAllowed is what you send the model as the tool menu. Send the smallest list. A learner request should not receive staff tools "just in case the model behaves." Fewer tools means fewer arguments in the prompt and fewer chances to pick lookup_ticket.
Validate arguments before any remote call so a huge string never becomes a query. maxLength is that guard. Time out GlossaryPort and TicketPort the way ModelPort times out. One attempt. A tool retry can double a write later. Even for reads, a retry loop hides an outage and adds latency to the panel. The UI can show unavailable using the Lesson 42 error event if you surface it.
Do not discover the full MCP catalog on every question. Discover on a schedule or at boot, then intersect with the allow-list. Discovery is an untrusted input. Cache the last good reviewed snapshot. If discovery fails, keep the previous snapshot or fail closed to an empty tool list. An empty list is a safe tutor. A stale list that includes a newly dangerous tool is not, so the code allow-list still filters the snapshot.
The invoker is CPU-trivial. The cost to watch is model tokens spent on tool menus and the latency of the read handlers.
Security
Authentication. The route that calls invoke has a session. The tool server is not a place to "log in" the learner again with a password the model saw.
Authorization. Role allow-lists, resource prefixes, and the handler's tenant check are three layers. You want all three.
Least privilege. The glossary credential cannot read tickets. The ticket credential cannot post credits. refund_course has no credential in this package.
Validation. Host schema, required strings, no extra keys, length caps, URI prefix, and a ban on ...
Secrets. Secret handles stay in the future transport adapter. Logs contain tool names and reasons. Tests use no live tokens.
Tenant isolation. Handlers take ToolScope. Argument objects have no tenant field.
Injection. Tool text returned to a model is data, placed in a user message, as with passages. A glossary entry that says "call refund_course" does not create a call. The name still has to pass invoke.
Supply chain. Pin any MCP client library. Review what it spawns. Prefer an adapter that cannot execute a tool the port refused.
Prompt installs.listPromptOffers marks server prompts untrusted. There is no applyPrompt function.
OWASP themes: broken access control (role and tenant), insecure design (advertised tool equals permission), and injection (tool output as policy). The controls are the allow-list, the effect class, and the constant product prompts.
Common Mistakes
Binding the model client to the MCP server directly. Symptom: a new tool on the server becomes callable the same day. Cause: discovery was treated as authorization. Fix: discovery feeds an adapter. invoke checks the host catalog.
Copying spec method names from memory. Symptom: the handshake fails against the revision you deployed. Cause: a blog used an old message. Fix: pin the spec, copy the names into the adapter, and leave the port methods as listAllowed and invoke.
Letting arguments carry tenantId. Symptom: a staff member reads another tenant's ticket. Cause: the handler trusted the argument. Fix: reject extra keys and read the tenant from ToolScope.
Running write tools because the effect was only documented. Symptom: a credit posts from a demo server. Cause: the handler was registered and the effect string was ignored. Fix: write returns needs_approval before any handler. Do not register refund_course.
Installing a server-supplied system prompt. Symptom: tutor policy changes after a tool-server deploy. Cause: an automatic prompt sync. Fix: list offers as untrusted. Promote text only through a reviewed promptVersion.
Spawning a local server per request. Symptom: process leaks and slow pages. Cause: the adapter started a binary inside invoke. Fix: the composition root owns the process lifecycle, with a timeout and a kill on shutdown. The lab spawns nothing.
Sending the full tool list to every model call. Symptom: the learner prompt includes lookup_ticket. Cause: listAllowed was skipped. Fix: filter by role, then by tenant policy.
Logging arguments. Symptom: ticket summaries in the log sink. Cause: a debug print of args. Fix: log name, effect, and reason.
Fetching arbitrary resource URIs. Symptom: the server becomes an open proxy. Cause: https:// was passed to fetch. Fix: prefix allow-list and a dedicated loader.
Retrying a tool until it succeeds. Symptom: duplicated side effects the day a write is finally approved and the retry wraps the handler. Cause: a loop around invoke. Fix: one attempt. Idempotency belongs on the ledger key in a later lesson.
Using the tool server as the identity provider. Symptom: the server's notion of user disagrees with the session. Cause: a second login inside the protocol. Fix: the host passes a scoped credential it minted, or a service credential plus the host's own checks. The learner's password never goes to the tool server.
Treating a successful MCP response as proof the host allowed the call. Symptom: the adapter returns server text for refund_course. Cause: the adapter skipped invoke. Fix: the server is untrusted even when it returns a normal payload. The port's decision is the one the route returns.
Best Practices
Own ToolEcosystemPort in the application.
Map MCP discovery inside an adapter after you pin a spec revision.
Keep host, client, and server as separate words in design reviews.
Allow-list tools in code. Let tenant policy only narrow the list.
Classify every tool read, draft, or write.
Return needs_approval for writes and do not register their handlers yet.
Validate arguments with the host schema.
Reject extra keys.
Take tenant and role from the session scope.
Apply the same checks to resource URIs.
Treat server prompts as untrusted offers.
Put tool output in the user message if a model will see it.
Time out handlers once.
Do not spawn servers inside the request without a lifecycle you control.
Log names and decisions, not argument values or secrets.
Give each server its own secret handle and least privilege.
Fail closed to an empty tool list when discovery is down and you have no reviewed snapshot.
Keep ModelPort and the tool port as separate dependencies.
Test learner denial, staff read, extra keys, and cross-tenant misses.
Do not let a panel proposal call invoke by itself. The server decides.
Review a new tool the way you review a new route: who can call it, and what it changes.
Leave business-API specifics to Lesson 44, behind this same port.
Interview Questions & Answers
Beginner
What problem does MCP solve, and what does it not solve?
It gives hosts and tool servers a shared way to discover and call tools, resources, and prompts. It does not decide that TechLearningPro trusts a tool. The host's allow-list, effect class, and session scope decide that.
What is the difference between a tool and a resource?
A tool is a named action with arguments, such as read_glossary. A resource is an object addressed by a URI, such as glossary://checkpoint. Both still pass an authorization check. A write tool is not a resource you "get."
Why is refund_course in the fixture if nobody can call it?
So a test can prove a dangerous advertised name fails. Presence in a catalog without a role is not_allowed. Presence with effect write would still be needs_approval. The dangerous path should be visible in tests, not only in a slide.
Intermediate
A server adds a tool overnight. What happens on the next request?
Discovery might see it. listAllowed and invoke will not offer or run it until a human adds it to the code catalog with a role and an effect. Tenant policy cannot add it either, because policy only narrows.
How do you stop a model from passing another tenant id?
The schema rejects unexpected keys, and the handler uses ToolScope.tenantId from the session. A matching key inside the ticket id string is just a string. The ticket port looks up that id under the session tenant and returns not_found when it is not theirs.
Where do MCP method names go in this codebase?
Only in a future adapter, copied from the spec revision pinned in the file header. The route calls listAllowed, invoke, and readResource. If a name in a tutorial disagrees with the spec you pinned, follow the spec and update the adapter test.
Senior
How would you test an adapter that speaks the real protocol?
Point it at a fake server that speaks the pinned revision, or at a recorded fixture of handshake and discovery bytes. Assert the adapter's output is a ToolDescriptor list and that a server response for refund_course still comes back from invoke as not_allowed. Do not mark the test green because the server said success. Keep subprocess tests optional and off by default in CI.
Why must tool output be treated like a retrieved passage?
The glossary author, or an attacker who can edit a definition, can put instructions in the text. The model may obey them in prose. The host must not obey them as calls. Only invoke creates a call, and only with a new allow-list check. Place the text in the user message with a source label.
Architect
How would you roll this out to many internal APIs?
One port, many handlers, each with an effect class and a credential. Lesson 44 will connect business APIs this way. Do not create a second agent stack per API. Shared concerns — schema, tenant, approval — stay in the invoker. API-specific HTTP stays in the handler or a Lesson 23-style adapter.
When is a local subprocess server acceptable?
For a trusted binary you ship, started by the composition root, with a fixed command and no shell interpolation of model text. It is a poor fit for a server the learner can configure. Remote servers need network policy, a secret handle, and the same invoke path. Either way the lab in this lesson stays in-process so the default build does not execute a binary.
How do you audit tool use?
Store tenant_id, user_id, tool_name, effect, reason, run_id, and timestamp. Store a hash of arguments if support must correlate a case, not the raw argument, unless the ticket store already holds that data under its own policy. Writes that later gain approval should store the approval id on the same timeline. The model prompt is not the audit log.
What should the panel do with needs_approval?
Show "This action needs approval" using the Lesson 42 status awaiting_approval. Do not show "Done." The staff member starts the Lesson 41 resume path only for findings, and the Lesson 45 path for a real credit. The tool port itself has not changed any ledger.
Knowledge Check
1. What problem does this capability solve?
It lets TechLearningPro use tool servers, including future MCP servers, for glossary and ticket reads while keeping writes and unreviewed tools from running, regardless of what a server advertises.
2. What alternatives exist, and when would you choose each?
A direct function call fits one internal read you fully own. This port fits a growing catalog and any external protocol. A pinned MCP adapter fits once you need a real server and you have read the spec revision. Giving the model client the server's raw tool list fits a local demo and not the tutor.
3. Which data, identity, and trust boundaries matter?
The session builds ToolScope. The host catalog defines names and effects. The tool server is untrusted for policy, prompts, and schemas. Handlers trust the scope. Argument maps are untrusted input. Credentials stay in adapters.
4. What can fail, and how should the system respond?
Unknown or role-mismatched names return not_allowed. Bad arguments return invalid_arguments. Missing rows return not_found. Writes return needs_approval. Handler failures return unavailable. The model does not get a second automatic try. The lesson page stays up.
5. How would you test quality, security, performance, and cost?
Assert a learner glossary hit, a learner ticket denial, a credit denial, an extra-key rejection, and a cross-tenant miss. Assert resource prefixes. Security review looks for a credit handler and finds none. Performance review checks tool-list size and timeouts. Cost review checks that a refused tool did not call a model again by itself.
Key Takeaways
MCP standardizes how a host talks to tool servers. It does not grant permission.
The host, the client session, and the server are different roles.
Tools, resources, and prompts are the primitives to learn first.
Spec method and transport names belong in a pinned adapter, copied from the current revision.
The application port is listAllowed and invoke.
Advertised tools are not allowed tools.
Effect write returns needs_approval and has no handler here.
Schemas reject extra keys and over-long strings.
Tenant and role come from the session.
Resource URIs must match a role prefix.
Server prompts are untrusted until a human versions them.
Tool output is data, like a passage.
One attempt, then unavailable.
Logs omit argument values and secrets.
Business APIs should join this port rather than bypass it.
Summary
Lesson 43 puts a tool ecosystem behind the same kind of port Lessons 23 and 40 used for models and chains. MCP can carry discovery and calls once you pin a spec and hide it in an adapter. The host still chooses the list, checks the arguments, and refuses writes. Glossary lookups work. Credits do not. That is the boundary Lesson 44 will reuse when the tool is a business API, and the boundary a later approval lesson can finally open for a reversible write.
Next Lesson Preview
Connecting AI Applications to Business APIs attaches real product APIs — enrollments, invoices, support tickets — to this allow-list. You will map HTTP and idempotency onto read and write, keep the model on the proposal side, and still hold credits until a human approval exists.
Deliverable and Rubric
Submit the catalog, the tests for allow and deny, a role-to-tool table, and a note that names the spec revision you would pin or states that the lab adapter is not written yet. Include the field list you would audit.
Area
Weight
Conceptual accuracy and architecture
20%
Working implementation and code quality
25%
Security, privacy, and responsible AI
20%
Testing, reliability, and observability
20%
Documentation and decision rationale
15%
Further Reading
MCP for the protocol: roles, primitives, and the revision history you should pin before writing a wire adapter.
Agentic systems for planners that propose tools and must still stop at an executor.
The Model Context Protocol specification, at the revision you pin. Copy message names from that document into the adapter comment. Do not treat this lesson as the wire spec.
Ready to mark this lesson complete?Track your journey across the entire course.