Over the past few days, I’ve switched from VSCode to using Zed for a few reasons. Zed is a code editor written in Rust, very lightweight, and its interface is similar to VSCode in many aspects. However, Zed still has its own differences and follows its own philosophy. Personally, I’ve used Zed since its early days; my first impression was that it was very fast and smooth. That said, many features I was used to in VSCode were missing in Zed, so I only stopped at the level of experimentation.
One feature I use very frequently is debugging with breakpoints: selecting positions and observing the data flow in the system. VSCode is a popular editor, so enabling debugging is much easier. It usually takes only a few steps, and especially if you use a framework, you can easily find guides online. In general, VSCode does a very good job of simplifying things for users.
Therefore, after switching to Zed,... Read more
This may be the last post in the basic MCP series on the blog. Originally I had planned not to write any more because the documentation for Prompts & Resources in MCP is very limited, but since these two topics are interesting I decided to introduce them to readers.
I have read and studied the material about these two items on the MCP main site. After understanding the principles and use‑cases, I looked for projects that have integrated them and intended to add examples to this article, but it turned out that very few projects actually implement these two components. Why is that?
In my opinion, a few... Read more
Do you like writing documentation? Or do you prefer writing code? When given a request, do you immediately think of solutions, imagining how you'll do it, writing it like this, with each line of if...else naturally appearing in your mind? Or do you think about the business logic, related parts, or what changes might impact the existing system?
When I first learned programming, I had no concept of writing documentation, not even reading it. All I did was read articles from others, follow their step-by-step instructions, and just replicate what they did. If I encountered difficulties, searching online didn’t take too much time. In short, I only did what was sufficient, nothing extra, leaving the rest to time and accumulated experience.
That habit stayed with me... Read more
In the previous article, we built a simple MCP client, but the codebase has become larger and more complex. To help readers understand, the simplest way to grasp the program is to observe the data flow being processed inside it, see what's happening at a specific point, and why it needs to be called... In short, it’s about setting up debugging.
Usually, when using a framework to develop an application, the framework often integrates debugging instructions, so you just need to read the documentation and follow the guide. However, for the series of examples on building an MCP server for 2coffee.dev, developed from scratch using TypeScript without using any available frameworks, there is no built-in debugging. Therefore, this guide is for readers to set up debugging in the VSCode code editor.
First, understand the rules for... Read more
In this Part 2, we will create a simple client that can interact via a command-line interface (CLI), meaning a command-line application. The input is the user's request, and the output is the application calling the correct function available in the MCP Server and then returning the result. For simplicity, let's use the MCP server 2coffee.dev that we created in previous articles. You can reference the source code at Creating a Simple MCP Server for 2coffee.dev.
Anthropic's documentation includes an article guiding how to create an MCP client utilizing their library @anthropic-ai/sdk. However, this library is compatible only with Anthropic models, so we will not follow that approach but instead take advantage of local LLMs using the tool LM Studio. LM Studio supports some APIs compliant with OpenAI standards, so we can entirely use the openai library as a replacement for @anthropic-ai/sdk.
First, start LM Studio, go... Read more
Building a basic MCP client is not difficult, but first, to do anything, we need to understand how it works. The MCP client needs to have a well-coordinated mechanism with the MCP server, and that is the specification of MCP.
The communication process between the client and the server generally proceeds as follows. Here, I will omit components such as authentication, discovering the list of prompts, resources... provided by the server. Instead, I will focus on a basic main flow from entering a command request to execution and then receiving the result. ... Read more
Mediator is a system design pattern that helps minimize chaotic dependencies between objects by restricting direct communication between them, forcing them to interact through an intermediary object.
Initially, when I was unaware of this concept, I used to write "chaotic" code in both Front-end and Back-end. The components in the system sometimes do not operate independently but interact with each other. This interaction causes many difficulties in debugging and maintenance. Let me give examples one by one for easier visualization.
First, on the server side,... Read more
Hello! It's been a long time since we last continued the series on building an MCP server. Recently, due to a lot of work, I finally managed to set aside some time to continue writing today.
The MCP specification clearly outlines the authentication mechanism to be used for a remote MCP server. Essentially, it is the authentication process as per the Oauth 2.1 specification. In summary, the process involves the following steps:
Step 1: The client discovers... Read more
The recent series of attacks on npm packages has significantly impacted the community, making us question the security of the libraries we use, whether in development or production environments.
From the very first day I learned about Node.js, npmjs... I noticed that every time I ran npm install, a node_modules folder and a package-lock.json file would appear. Out of curiosity, I opened them and—oh my!—why are there so many folders in there, while the package.json file shows that I only installed the express library? 🤔 This means that installing express automatically installs a bunch of other packages. In other words, express depends on other packages, which in turn depend on even more packages, leading to a "dependency hell." This explains why installing just one library brings in dozens of libraries you've probably never even heard of.
What's quite interesting is that... Read more
In Part 1, we deployed the MCP remote server using the old SSE protocol. In this Part 2, we will continue implementing a newer protocol: MCP.
The implementation is very straightforward, similar to SSE, but requires the implementation of three endpoints.
First, declare a variable transports... Read more