Model Context Protocol (MCP) Servers

The key to improving LLM

What is an MCP server?


The Model Context Protocol (MCP) servers are somehow a “plug and play” socket for LLMs. The idea is to be able to connect LLMs to external tools. More formally, we could say that MCP is a standardized protocol for connecting large language models (LLMs) to external tools and context providers through a consistent interface. This eliminates the need for bespoke integrations and ensures interoperability between different models and services.

When LLMs were first released on the market, it was quickly found that they were not the strongest when it came to certain tasks, and that hallucinations when resolving problems could be more harmful than beneficial. So we had to figure out a way to be able to provide these LLMs with access to external context and tools. Doting that LLM model from some additional powers, this is a beautiful conceptual idea, but being able to connect these different services can become a nightmare.

Imagine different LLMs trying to connect to different services. All this while each of them used their customized interface (usually APIs) and non-standardized communication. In hindsight, it is simple to understand the value of a standardized method for interconnecting all these tools.

In November of 2024, Anthropic generated MCP. MCP helps us have a standardized communication protocol to interconnect any Model (GPT4, Grok3, Gemini, …) to any Context (GitHub code, info from a DB, Slack connections, local files,…) using a standard Protocol.

MCP architecture:

When we generate a new AI application, let’s say, for example, an agent, this will become our MCP client. This client will connect to an MCP server, the server is a lightweight service that will help retrieve data and connect different pieces of context for our application. This MCP server can connect to local or remote sources.

When it comes to what the server can handle, three different primitives can be used: Prompt templates, resources, and tools. Each of these primitives expands the capabilities of the LLM.

  • Prompt Templates: Predefined structures to guide model input.
  • Resources: External data sources (APIs, files, databases) where the LLM model can retrieve information.
  • Tools: Executable actions like running scripts or calling APIs.

When it comes to communication itself, MCP uses two different protocols: stdio for local communications as well as HTTP with Server-Sent Events (SSE) for remote communications.

In summary, Model Context Protocol (MCP) servers offer a powerful, standardized way to connect language models with external tools and context sources. Helping standardize how models access data, execute functions, and structure prompts. MCP significantly reduces integration complexity and promotes interoperability across AI systems. As LLM applications continue to expand in complexity and demand, protocols like MCP will be key players in building scalable, flexible, and more reliable AI-powered solutions.


References/Additional readings:

https://modelcontextprotocol.io/introduction

https://github.com/cyanheads/model-context-protocol-resources/blob/main/guides/mcp-client-development-guide.md#1-introduction-to-mcp-clients

https://github.com/modelcontextprotocol/python-sdk

For other interesting reads make sure you check my blog page.

Scroll to Top