MCP Server

Nimish ChandolaNimish Chandola
3 min read

Problem

So far, we have explored many models, whether they are Anthropic models, OpenAI models, or others. We know that to get updated & refined information from these models, we need to provide some context. Without it, the models might not provide the latest info or could start hallucinating.

Also if I have build some tool and prompts which is solving some generic problem its hard to share across community.

For example, if I have built a tool to identify the best stocks using well-proven algorithms, and someone else wants to use that tool, they can't because we don't have a platform to share tools.

Solution

If we can deploy a server capable of providing this context to our models, and make this context available to the AI community, we will have the option to reuse some generic tools, data, and prompts. This will speed up our AI development.

There are mainly three types of context we provide to any AI model. What if we could host these contexts on a server so that multiple people can benefit from them? By connecting these contexts using a standard protocol and architecture, we can solve our problem. Thats what Anthropic did in 2024 and named it as MCP Server.

Now that we understand the problem and have identified the solution, we are ready to dive into understanding the MCP server and its architecture.

MCP

MCP is an open protocol that standardizes how applications provide context to LLMs. The Model Context Protocol (MCP) is built on a flexible, expandable architecture that allows smooth communication between LLM applications and integrations.

MCP has 3 components in it’s Architecture

1) MCP Hosts

Hosts are the platform which is using LLM and they feed the context to the LLM to get the required output. This host can be Cursor, VSCode, or your own AI application where you are creating some context for the LLMs.

2) MCP Client

Client reside under the Host to maintain 1:1 connection with server

3) MCP Server

Server is the place where we will create & deploy all out context (like tools, prompts, etc) and it will act as a library/server of context which will be required by the model.

MCP allow two communication protocol

1) STDIO

STDIO call integrations are used where the server runs in the same environment as the client

2) SSE [Server Sent Events]

SSE is used where the remote connection is open for streaming with the HTTP for client connection and SS for Server response.

Architecture

Since you have already reviewed the components and communication protocols for MCP, it will now be easier for you to understand the MCP architecture below.

The article discusses the issue of AI models requiring context for accurate outputs, highlighting the difficulty in sharing tools across the community. It proposes a solution through the deployment of a server to provide shared context to AI models, enhancing tool and data reuse. The Model Context Protocol (MCP), introduced by Anthropic in November 2024, is detailed as an open protocol that facilitates standardized context provision to AI applications. MCP's architecture consists of Hosts that integrate LLMs, Clients maintaining server connections, and Servers hosting contextual elements like tools and prompts. It supports two communication protocols: STDIO for local environments and SSE for streaming over HTTP.

0
Subscribe to my newsletter

Read articles from Nimish Chandola directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Nimish Chandola
Nimish Chandola