Chapter 4. MCP Clients: Advanced Use and Best Practices
In Chapter 3 you learned how to build a client that supported the server primitives: tools, resources, and prompts. You learned a standard architecture for building clients and how to manage stdio and streamable HTTP connections. To round out your client-building knowledge, this chapter will show you how to provide the server with client-based capabilities, how to use OAuth to allow servers to authorize your client users, how to build for different models and model providers, how to discover servers with the MCP Registry, techniques for connecting to multiple servers, managing your context window with context engineering, and some best practices for building your client.
Providing MCP Client Capabilities
This section will introduce the use of callback functions to provide client capabilities to the connected MCP server. There are three major capabilities that a ...
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.
Read now
Unlock full access