MCP (Model Context Protocol)

Think of the Model Context Protocol as a universal adapter or translator for artificial intelligence. Today developers have to wire every AI model up to every application separately, which is inefficient. MCP creates a common language that all the systems involved understand. Thanks to it, any AI model can easily “talk” to various tools – to pull data from a company database, say, or send a message into a chat – without needing a bespoke solution every time.

The Model Context Protocol (MCP) is an open standard designed to unify communication between generative AI models and external sources such as databases, APIs or other software tools. The protocol works on a client-server principle, where the AI model (the client) can discover and call functions provided by an external server in a standardised way. The goal of MCP is to eliminate the need to build specific integrations for every combination of model and tool, thereby supporting interoperability and enabling the development of more complex and more capable AI agents.


The Model Context Protocol (MCP) is an open standard that unifies the way artificial intelligence communicates with external tools and data. Think of it as a USB-C port for AI: instead of having to create a unique connection for every AI model and every application (a calendar, a database, an internal company system), MCP provides a universal interface. This lets any compatible AI model “speak” easily and securely to any tool that also supports MCP.

The aim is to simplify developers’ work and make it possible to build more complex and more capable AI assistants and agents that can work with current data and carry out tasks inside your applications.

How MCP works

The protocol works on a client-server architecture:

  • MCP server: a small program acting as a “translator” for a particular application or data source (GitHub, Slack, a database). It exposes that tool’s functions (“read the latest messages”, “create a new task”) and data (“list the files in the project”) in the standardised MCP format.
  • MCP client: part of the AI application (a desktop chatbot such as Claude, or a development environment). The client communicates with the server, finds out what tools and data it offers, and sends it requests on behalf of the AI model.

When a user asks the AI for something that requires external data (“What meetings do I have today?”), the AI application (the client) sends a standardised query to the calendar MCP server. The server performs the action, returns the data in a standardised format, and the AI model then uses it to generate an answer.


Code example

The following simplified Python example shows how to build a simple MCP server that exposes one tool to an AI model: get_weather. The tool returns the current weather for a given city. The code uses the FastMCP library, which makes the whole process easier.

First the required libraries have to be installed:

The server code (weather_server.py) in Python

How to run it and what happens:

  1. Save the code as weather_server.py.
  2. Start the server from a terminal with: python weather_server.py.
  3. The server is now running and “listening” on a local port. Any AI application with an MCP client (for example Claude Desktop) can connect to it.
  4. When the user of the connected AI application asks “What is the weather in Prague?”, the model sees that it has the get_weather tool available.
  5. The model “calls” this tool with the parameter city='Prague'.
  6. Our server runs the function, sends a request to https://wttr.in/Prague?format=3, receives the reply (for example “Prague: ☀️ +22°C”) and passes it back to the AI model.
  7. The AI model uses this information to formulate the final answer for the user.

Is this article useful to you and are you citing it? Copy the citation