Machine Learning Pills

Machine Learning Pills

Share this post

Machine Learning Pills
Machine Learning Pills
Issue #98 - Introduction to the Model Context Protocol (MCP)

Issue #98 - Introduction to the Model Context Protocol (MCP)

David Andrés's avatar
David Andrés
Jun 15, 2025
∙ Paid
6

Share this post

Machine Learning Pills
Machine Learning Pills
Issue #98 - Introduction to the Model Context Protocol (MCP)
2
Share

💊 Pill of the Week

AI is evolving rapidly—but a major bottleneck still remains: how models interact with the external world. While modern large language models (LLMs) excel at generating natural language, they can’t natively access tools, APIs, or private data without help. That’s where the Model Context Protocol (MCP) comes in—a new open standard designed to solve this exact problem.

What Is MCP?

Developed by Anthropic, the Model Context Protocol (MCP) is an open protocol that standardizes how AI models—especially assistants and agent-like systems—can discover and interact with external tools, services, and data. Rather than relying on one-off, brittle integrations, MCP provides a modular, scalable, and universal interface for AI-to-system communication.

MCP is doing for AI tools and data what HTTP did for web communication: making them universally accessible, composable, and easier to integrate.

The Problem: Integration Chaos

To extend an AI’s abilities—like booking a meeting, summarizing a file, or querying a company database—developers have traditionally relied on custom “glue code.” This often means hand-rolling APIs and connectors for every tool or service, which leads to:

  • Redundant engineering effort

  • Frequent breakage as APIs change

  • An N × M problem, where N models and M tools require N×M integrations

This approach is expensive, brittle, and fundamentally unscalable—especially as the ecosystem of models and tools continues to grow.

MCP’s Solution: A Common Language Between Models and Tools

MCP introduces a client-server architecture that formalizes how models discover and invoke capabilities:

  • MCP Clients are built into AI applications like Claude Desktop, Cursor, or Windsurf. They initiate requests and consume tool results.

  • MCP Servers expose a catalog of tools, data resources, and prompt templates in a format the model can understand and call.

This decouples AI applications from the services they use, making every integration discoverable, composable, and reusable.

How MCP Works

At a high level, MCP defines a clear lifecycle for how AI systems can discover and use external capabilities—structured around four simple stages:

  1. Discovery – The AI client retrieves a manifest of available tools, resources, and templates from an MCP server. This manifest tells the model what’s possible.

  2. Request – Based on user input, the model selects and calls the appropriate tool (e.g., send_email(to, subject, body)) using the standardized format.

  3. Execute – The MCP server handles the actual execution—whether that means calling an external API, querying a database, or processing a file.

  4. Response – The execution result is returned to the client and integrated into the model’s next response or action.

This protocolized exchange allows models to plan, reason, and act without needing brittle, model-specific integrations.

This step-by-step interaction turns what used to be opaque, hardcoded integrations into a modular, discoverable protocol that models can navigate dynamically.


I'd be grateful if you could share your feedback before we move forward 🙏:

Loading...

Many thanks, this will help me improve the content I share with you all. Any additional feedback is always appreaciated. You can DM me in X @daansan_ml


‍🎓Further Learning*

Are you ready to go from zero to building real-world machine learning projects?

Join the AI Learning Hub, a program that will take you through every step of AI mastery—from Python basics to deploying and scaling advanced AI systems.

Why Join?
✔ 10+ hours of content, from fundamentals to cutting-edge AI.
✔ Real-world projects to build your portfolio.
✔ Lifetime access to all current and future materials.
✔ A private community of learners and professionals.
✔ Direct feedback and mentorship.

What You’ll Learn:

  • Python, Pandas, and Data Visualization

  • Machine Learning & Deep Learning fundamentals

  • Model deployment with MLOps tools like Docker, Kubernetes, and MLflow

  • End-to-end projects to solve real-world problems

🔗 Join the AI Learning Hub (Lifetime Learning Access)

🔗 Join the AI Learning Hub (Monthly Membership)

Take the leap into AI with the roadmap designed for continuous growth, hands-on learning, and a vibrant support system.

*Sponsored: by purchasing any of their courses you would also be supporting MLPills.


Let’s continue!

The Three Core Capabilities of MCP

At the heart of the Model Context Protocol are three foundational capabilities—known as primitives—that MCP servers can expose to AI clients. These primitives define the range of actions and knowledge that an AI assistant can tap into. Together, they provide a powerful, flexible interface for extending a model's reach beyond pure text generation.

1. Tools – Performing Actions

Tools are essentially callable functions that allow an AI to do things in the real world. Think of them as buttons the AI can press to trigger some behavior—send a message, access an API, or perform a computation. Tools can represent anything from a simple arithmetic operation to interacting with complex business systems.

For example, a tool might allow the AI to:

  • Draft and send an email by calling a function like send_email(to, subject, body)

  • Fetch live financial data using lookup_stock_price(ticker)

  • Generate invoices by invoking generate_invoice(customer_id)

These aren’t just examples—they reflect a general structure where each function is described with metadata that the AI can use to call it intelligently and safely.

We’ve already introduced the LLM tools in this article:

DIY #14 - Step-by-step implementation of a ReAct Agent in LangGraph

DIY #14 - Step-by-step implementation of a ReAct Agent in LangGraph

David Andrés
·
Apr 20
Read full story

2. Resources – Reading Information

While tools let models take action, resources let them read from external data sources. Resources expose structured knowledge that the AI can access and use to enrich its responses or decisions.

This might include:

Keep reading with a 7-day free trial

Subscribe to Machine Learning Pills to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 MLPills
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share