Skip to content
Agent Builder
Module 4Intermediate

Tools & the Model Context Protocol

Connect agents to everything

Design tools agents use correctly, understand MCP, connect existing MCP servers, and build your own server to give agents new superpowers.

Lessons
5
Reading time
59 min
Level
Intermediate
Access
Full course

Lessons in this module

  1. 4.1

    Designing Tools Agents Love to Use

    Naming, descriptions, parameters, and error messages: the craft of designing tools that models call correctly on the first try.

    10 min
  2. 4.2

    What Is MCP and Why It Matters

    The Model Context Protocol explained: hosts, clients, servers, tools, resources, and prompts — and why it became the standard.

    10 min
  3. 4.3

    Connecting MCP Servers to Your Agents

    Install and configure MCP servers in popular agents, choose trustworthy servers, and troubleshoot connections.

    12 min
  4. 4.4

    Building Your First MCP Server

    Step by step: build, test, and connect a working MCP server in TypeScript that exposes your own tools to any agent.

    15 min
  5. 4.5

    Permissions, Approvals, and Tool Safety

    Decide which tools run automatically and which need a human. Permission modes, allowlists, and designing safe destructive actions.

    12 min

About this module

Tools are what let an AI agent do things rather than just talk about them: read a file, query a database, open an issue, send a message. Each tool is described to the model with a name, a description, and a schema for its inputs, and the model requests a tool call when it decides one would help. How well those tools are designed has a large effect on whether the agent uses them correctly.

The Model Context Protocol, or MCP, is an open standard for connecting agents to tools and data. An MCP server exposes tools, resources, and prompts in a common format, and any MCP-compatible host, such as Claude Code, Cursor, Codex, or VS Code, can connect to it through a built-in client. An integration written once can then be used from many different agents instead of being rebuilt for each one.

This part starts with tool design: choosing fewer, more capable tools, writing names and descriptions models understand, shaping parameters that are hard to misuse, and writing error messages that help the model recover. You will then learn how MCP is structured, including hosts, clients, servers, and transports, and how to install and configure MCP servers in popular agents, choose servers you can trust, and troubleshoot connections that fail.

Next you will build a working MCP server in TypeScript with the official SDK, test it with the MCP Inspector, and connect it to your agents. The part ends with permissions: sorting tools by blast radius, using permission modes, allowlists, and hooks, and designing destructive actions so that mistakes stay recoverable.

Questions about Tools & the Model Context Protocol

What is MCP in AI?

MCP, the Model Context Protocol, is an open standard for connecting AI applications to external tools and data. Anthropic introduced it in late 2024, and it is now supported by many agents and AI apps. It lets a tool integration be built once as an MCP server and used from any compatible client.

What is an MCP server?

An MCP server is a program that exposes capabilities to AI agents through the Model Context Protocol. It can offer tools the model can call, resources it can read, and reusable prompts. Servers can run locally on your machine or remotely over HTTP.

How is MCP different from function calling?

Function calling is the model-level mechanism: the model emits a structured request to use a tool your code defined. MCP is a protocol on top of that for packaging and sharing tools, so any compatible host can discover and call them. An agent connected to an MCP server still uses function calling under the hood.

Are MCP servers safe to use?

An MCP server runs code and can access whatever its credentials allow, so treat installing one like installing any other software. Prefer servers from official or well-maintained sources, grant the narrowest credentials possible, and remember that content a server returns can contain prompt injection.

How do I add an MCP server to Claude Code?

Run the claude mcp add command with a name and either the command that starts a local server or the URL of a remote one. You can also share servers with your team through a project .mcp.json file. Inside Claude Code, the /mcp command shows server status and handles sign-in for remote servers.

What languages can you build an MCP server in?

There are official MCP SDKs for several languages, including TypeScript and Python, and community libraries for many more. This course builds a server in TypeScript with the official SDK.