Menu

AI & Machine Learning Topic

What Is MCP? Tools, Resources and AI Apps Explained

Lesson 3 of 6 · AI agents, tools and MCP.

Use these lessons in order. The code examples share the same small study project.

  1. AI Agents for Beginners: How a Study Helper Works
  2. Python Tool Calling: Build Your First AI Agent
  3. What Is MCP? Tools, Resources and AI Apps Explained
  4. Build an MCP Server and Client in Python
  5. Test AI Agents and MCP Tools in Python
  6. Connect an AI Agent to MCP Tools in Python

Documentation checked: 25 October 2026. Code examples use made-up lesson data. Technical words are explained as they appear.

You have a study tool in Python. Later, you want to use the same tool from another AI app. You could write a new connection for each app. MCP offers a shared way to describe and call it.

MCP means Model Context Protocol. A protocol is a set of rules for communication. MCP helps AI apps connect with tools and information.

MCP is not an AI model

MCP does not write an answer by itself. Your AI app still needs a model or some other way to decide what to do.

It also does not make a tool correct or give it permission to read every file. Those decisions belong to the app and server.

The three main parts

Host: The app the person uses. It may be a chat app or a coding app.

Client: The part inside the host that talks to a particular MCP server.

Server: The program that offers tools or information. A server can run on the same computer or somewhere else.

In our project, the study server offers lesson data. A short Python client connects to it. The client can call a tool even without an AI model.

Tools, resources and prompts

Tool: A named action the app can request. Our get_lesson tool accepts a course and lesson number.

Resource: Information available at an address. Our study://welcome resource gives a short note about the courses.

Prompt: A reusable message pattern that a server can offer. For example, a study app could offer a pattern for explaining a lesson. This project does not need a custom prompt feature.

These are different features. Reading a resource is not the same as calling a tool.

Follow one request

  1. The client connects to our known study server.
  2. It asks for the available tools.
  3. The server describes get_lesson and its inputs.
  4. The client requests Python lesson two.
  5. The server checks the inputs and reads the local catalog.
  6. The client receives the lesson result.

The Python SDK handles the protocol messages. You do not need to write raw JSON-RPC messages for this beginner project.

How is this different from normal tool calling?

In the earlier lesson, your app calls a Python function directly. With MCP, the app calls through an MCP client and server.

The model can still use a function-tool description. Your app connects that request to the MCP tool. MCP is the connection to the tool; the model API is a separate connection.

How do the messages travel?

A transport is the way messages move between programs.

  • Standard input/output, or stdio: Often used when a host starts a local server process.
  • Streamable HTTP: Used for communication over HTTP. Our example runs it on your own computer.

Our server will use http://127.0.0.1:8012/mcp. The address 127.0.0.1 means this computer. Port 8012 is separate from the Lecturre website on port 8081.

A useful boundary

A read-only lesson tool is a good first example. Its input is small, and its result is easy to check. There is no email to send and no real database row to change.

For a tool that changes something, check the user’s access and intent in your own code. A server response can contain text from outside your app. Treat that text as data, not as a new instruction.

Try explaining it

Imagine a library desk. The visitor uses the host. The client asks the desk a clear question. The server looks up a book and returns information. The communication rules help both sides understand the request.

The library still needs its own rules about who can borrow a book. In the same way, MCP communication does not replace access checks.

Next lesson

Build the connection in Build an MCP Server and Client in Python. You can run that lesson without a model API key.

Official sources

Connect this lesson to the full AI course

For Python and data basics, start with the first Python project. For document-based answers, read the RAG guide. Use prompt and evaluation checks to assess the answer as well as the tool loop. The local tests check program behaviour; they do not establish the quality of a live model.

All AI & Machine Learning tutorials

Comments (0)

No comments yet. Be the first to comment!

LecturreAI Assistant

Hello! I'm LecturreAI

What would you like to learn today?