How to build an MCP Client



MCP Servers have gotten extremely popular, and for good reason. MCP is referred to as the “USB-C” of AI – it allows AI applications to easily import data and logic written by others and makes it very easy to create a powerful app with an LLM. In order to use an MCP Server, you need an MCP Client. The default MCP Client for most people has been Claude Desktop. It is somewhat straightforward to install and use MCP Servers with Claude Desktop, and it does in fact work, but there are some annoying restrictions that can only be addressed by building your own MCP Client from scratch. If you want to use a model other than Claude (like gpt-4o or deepseek-v3) you will need to implement your own MCP Client.

In this video I go over an MCPClient CLI application I built using typescript. I walk through the code, give a high level overview and talk about why it’s important to understand MCP Clients in the first place. If you truly want to be in control of the UX of your application, you will almost certainly have to implement your own MCP Client. It can be a bit trickier to implement than an MCP Server but I showcase all of the core pieces.

I also talk about how to hook up other models, such as deepseek-v3 to an MCP application and why it’s important to be able to test out other models quickly.

00:00 – 00:36 The TommyCodesMCPClient App
00:36 – 01:07 What’s wrong with Claude Desktop?
01:07 – 03:56 Overview of implementation
03:56 – 09:03 Diving into main chat loop
09:03 – 15:32 Handling tool calls
15:32 – 17:23 Sending messages to the UI
17:23: Using Deepseek and other models

MCP Transport Explained:
How Tool Calling Works:
LiteLLM overview:

source

Disclaimer
The content published on this page is sourced from external platforms, including YouTube. We do not own or claim any rights to the videos embedded here. All videos remain the property of their respective creators and are shared for informational and educational purposes only.

If you are the copyright owner of any video and wish to have it removed, please contact us, and we will take the necessary action promptly.

Scroll to Top