Exercise: Integrating the LLM
So, let’s see how we can integrate an LLM into the client. The goal is to have a much better user experience and to abstract away the complexity of using the server. To get there, we will need to take the following steps:
- List server features: By listing the features, we can see what we have available to us
- Convert the list of features to an LLM tool: The features from the MCP server are not directly usable by the LLM, so we need to convert them into a format that the LLM can understand
- Manage user input: This will allow the user to type a natural language request and the LLM on our client will make a completion request, and in doing so, tell us which feature to use and what parameters to send.
Let’s do this!
List server features
You might be building this client as the first thing you do if you, for example, are consuming someone else’s MCP server. In that case, make sure you install...
 
                                             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
     
         
                 
                 
                 
                 
                 
                 
                 
                 
                