Skip to Content
AI Agents with MCP
book

AI Agents with MCP

by Kyle Stratis
May 2026
Intermediate to advanced
275 pages
3h 52m
English
O'Reilly Media, Inc.
Content preview from AI Agents with MCP

Chapter 5. Building MCP Servers: Providing Tools, Prompts and Resources to Applications

On the other side of the MCP equation from the client is the server. In Chapter 3, the client examples all made use of a server that gave the host application the ability to do math. This serverwas pre-built and was run locally. In this chapter, our examples will show the construction of this same server from scratch, including all of the primitives and features that servers can provide to clients and host applications. We will begin with a high-level view of the server, including what servers do and how they’re useful, how they connect to clients, and the two main paths for building them with the Python SDK. Then, we will get right into the details:

  • server primitives (tools, prompts, and resources) and how to serve them

  • server utilities (completion, logging, notifications, and pagination) and how to use them

  • server security

  • using client-provided resources like sampling and elicitation

As a server ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

AI Agents in Action

AI Agents in Action

Micheal Lanham
AI Agents in Action

AI Agents in Action

Micheal Lanham

Publisher Resources

ISBN: 9798341639546Errata Page