Building Clients
To consume an MCP server, you need some form of client. You could, for example, use an application such as Claude Desktop or Virtual Studio Code (VS Code), as they have the ability to consume MCP servers and will handle the discovery of features and be able to use them. There are also cases where you want your own written client. A good example of this situation is when you want to build in AI capabilities as part of your app. Imagine, for example, that you have an e-commerce app and want to have an AI-improved search. The MCP server would be a separate app, whereas the client would be built into the e-commerce app.
With this in mind, let’s explore how we can build a client and what goes into it.
In this chapter, you will learn how to do the following:
- Build a client using both STDIO and SSE transports
- Consume an MCP server and its features
- Leverage an LLM to enhance your client experience
The chapter covers the following...
 
                                             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
     
         
                 
                 
                 
                 
                 
                 
                 
                 
                