chapter four

4 Exposing agents with MCP

 

This chapter covers

  • The Model Context Protocol (MCP)
  • Building a documentation crew
  • Setting up a custom MCP server
  • Integrating MCP with Cursor

4.1 Introduction to MCP

So far, we have used function calling as the mechanism that lets a model request a specific operation in a structured way. When the model decides to call a function, the host application receives a well-formed payload, runs the function, and then feeds the result back into the model. This is a powerful primitive, but it is also tightly coupled to the API surface of a specific model provider and to the conventions of the client that is doing the orchestration.

This is where the Model Context Protocol comes in. MCP is an open standard that defines how an AI client can discover and call external capabilities in a consistent way. The project is part of the Agentic AI Foundation (AAIF), which operates as a directed fund under the Linux Foundation, and has support from major players like Google, Microsoft, OpenAI, and Anthropic.

4.1.1 Core roles

4.1.2 Server capabilities

4.1.3 Architecture

4.2 Building the documentation crew

4.2.1 Prerequisites

4.2.2 Setting up the docs agent

4.2.3 Setting up the screenshot agent

4.2.4 Assembling the crew

4.3 Setting up the MCP server

4.4 Invoking the crew from Cursor

4.5 Summary