chapter three

3 Actions with Model Context Protocol for AI agents

 

This chapter covers

  • Understanding MCP fundamentals for agent development
  • Getting started with MCP servers
  • Using MCP servers with agents
  • Building MCP servers for agents

In chapter 2 we examined an agent’s core components. This chapter discusses the Model Context Protocol (MCP), the connector that empowers agents. MCP is often described as the USB-C for agents and LLMs because it provides a standard protocol for agent tools. More importantly, as we develop complex research agent workflows, it opens up a landscape of tools our agents can use.

MCP adoption in the AI space has been so quick and widespread that almost anything we want our agents to do is likely supported by an MCP server. Not only that, but we can also build our agents as consumable MCP servers. This allows us to connect complex agentic workflows as tools to other agent workflows so we can build agent-specific workflows that can be reused like components.

In the following sections, we will examine the fundamentals of MCP architecture and then explore building and using servers with agents to understand how MCP transforms agent capabilities.

3.1 Understanding MCP fundamentals for agent development

3.1.1 The standardization problem MCP solves

3.1.2 MCP architecture: Clients, servers, and services

3.1.3 Core components: Tools, resources, and prompts

3.1.4 MCP deployment patterns for agents

3.1.5 MCP powers the functional agent layers

3.2 Getting started with MCP servers

3.2.1 Coding up an MCP server for Claude

3.2.2 Using the MCP inspector

3.2.3 Understanding MCP transport types

3.2.4 From desktop to agents: The key differences

3.3 Using MCP servers for agents

3.3.1 Using agents with local MCP servers over STDIO

3.3.2 Using local MCP servers over SSE with agents

3.3.3 Connecting to the standard MCP servers

3.4 Building MCP servers for agents

3.4.1 Converting tools to an MCP server

3.4.2 Consuming MCP servers locally or remotely