When developing with LLMs, a recent topic that comes to mind is Model Context Protocol. My experience with LLMs is pretty typical: chatting directly about various subjects, and using them in code editor either to discuss or generate code (especially with using Cursor), or as a companion when figuring out bugs.
But with MCP, LLMs become even more interesting and useful. With the help of MCP servers, they’re able to do more things. For example, I can chat with Claude and, with the help of a custom MCP server, I can ask it to check this blog, find the latest blog post, and make a poetry out of it.

But, how does it work? In this post I’ll go through the basics of MCP. It will be a Q & A format to get through things quickly.
1. What is Model Context Protocol?
The official site has a pretty thorough introduction post here. But, if you want a one sentence summary, it’s this:
MCP is a standard protocol that lets applications expose their functionality and data to LLMs in a secure and consistent way.
2. Why is it needed?
Speaking very roughly, LLMs (like when you chat with ChatGPT) works by receiving your message, then used its pre-trained model to predict the best way to reply your message. The pre-training is where the limitation lies. If I ask an LLM what’s the latest post in my site, it might return an outdated information, because it’s been a while since it’s trained with my site’s content.
LLM services nowadays have included some features like being able to browse the web, which helps with getting new information. But, as you can imagine, having to make separate implementations for each LLMs is inefficient.
MCP tries to help in this area by creating a standard way to make something once, that can be used by any LLMs.
This is how it works. Within an MCP server, for example, you can create tools to get things from your blog: fetching latest blog posts, categories, and so on. Then, an LLM like Claude can connect to this server and use these tools to provide an answer.
And because MCP is a protocol, it’s not tied to any one LLM provider. You’re not limited to Claude. You can use other LLMs of your choice, without changing anything on the MCP server. The server is like a set of instructions for your employees. You can give it to multiple people, and they can all use it to do the work that you want.
3. What is an MCP server, again?
An MCP server is a piece of software that gives LLMs a way to interact with specific applications. It lets them them retrieve data or perform actions within those apps.
Under the hood, the server can be a simple node.js server.
4. How does an MCP server provide LLMs a way to do all those things?
A common implementation is to simply use the application’s existing API (e.g: use WordPress.com API to get info from a blog). The server creates the tool for LLMs to use, and then the implementation has to be added as well, e.g: using the API to fetch posts.
Here’s a snippet from my MCP server:
server.tool(
"get-categories",
"Get all categories available on hafiz.blog (WordPress.com)",
{},
async () => {
const categoriesUrl = `${WP_COM_API_BASE}/categories?per_page=50&_fields=id,name,slug`;
const categories = await fetchJson<WPCategory[]>(categoriesUrl);
if (!categories || categories.length === 0) {
return {
content: [{ type: "text", text: "No categories found" }],
};
}
const formattedCategories = categories.map((category) =>
`Category: ${category.name} (Slug: ${category.slug})`
);
return {
content: [
{
type: "text",
text: `Categories on hafiz.blog:\n\n${formattedCategories.join("\n")}`,
},
],
};
}
So, to reiterate, the bulk of the job with MCP will be in adding these tools and coding the way to use the APIs in various ways.
More details on implementation available here.
5. What is an MCP client?
It’s simply a piece of software to be added to the LLM host to be able to connect to the server, identify the tools, and so on. On its own an LLM does not know how to connect to an MCP server, so this client is needed.
6. Where do I host the MCP server?
Initially the server was meant to be run locally, but nowadays there are also services to remotely host them. You can host them with Cloudflare, for example.
7. Do you have an example?
Why yes, check out this repository: https://github.com/hafizrahman/wp-mcp
This is what I feel the least you need to understand MCP. Feel free to ask a question and I can add the answer to this post!
Leave a comment