Module 87: Agents and Tool Calling
MCP
🏠The everyday picture
Before USB, every printer, mouse and camera needed its own kind of plug. USB gave one standard socket. MCP aims to be that for connecting AI applications to tools and data.
📘What it really is
-
The Model Context Protocol (MCP) is an open standard (introduced by Anthropic in 2024 and now widely supported) for connecting AI applications to tools and data sources.
-
Parts:
- an MCP server offers tools (actions), resources (data to read) and prompts (templates); for example, an MCP server for your CRM, GitHub, a database or a file system;
- an MCP client inside an AI application (chat apps, coding assistants, your own app) connects to servers and makes their tools available to the model.
- Benefits: write a tool integration once, and use it from many AI applications; many ready-made servers exist.
-
Transports: a local server runs on your machine (communicating through standard input and output); a remote server runs over HTTP, usually with OAuth for authentication.
-
Security is your responsibility:
- only install MCP servers from sources you trust, and read what tools they expose; a server runs code and sees data;
- the same rules as Lesson 3: least privilege, read-only by default, the user's own permissions, approvals for actions;
- watch for tool descriptions or results containing hidden instructions (a form of prompt injection);
-
give remote servers scoped, revocable tokens, never your main credentials.
-
For a single app with a few internal tools, direct tool calling (Lesson 1) is simpler. MCP shines when tools should be shared across several AI applications.
🖱️Try it
Read the MCP documentation's quickstart (modelcontextprotocol.io). Build a tiny local MCP server with the official TypeScript SDK
that exposes one read-only tool, search_policies(query), calling your Module 86 search. Connect it to an MCP-capable desktop app
or client you use, and ask a question that uses it. Write down every permission the server has.
✅Quick check
What does an MCP server provide?
Show the answer
Tools, resources and prompts that AI applications can use through a standard protocol.
Why be careful about which MCP servers you install?
Show the answer
They run code and see data, and their tools or descriptions could be harmful or manipulated.
