Model Context Protocol (MCP)
Model Context Protocol (MCP) is an open standard that allows AI models to securely and consistently connect to external tools, data sources and applications.
Learning Objectives
- Explain what the Model Context Protocol (MCP) is.
- Understand why MCP was created.
- Differentiate MCP from traditional Function Calling.
- Describe the MCP architecture.
- Understand MCP Clients, Servers and Tools.
- Recognize real-world MCP applications.
Why This Matters
As AI systems become more capable, they need access to many different tools such as GitHub, Jira, Slack, Google Drive, databases, local files, APIs, documentation and calendars.
Without a common standard, every AI application would require a custom integration for every tool. This quickly becomes difficult to maintain.
MCP solves this by introducing a common protocol that both AI applications and external tools can understand. Think of it as a universal connector for AI.
The Problem Before MCP
Imagine buying electronic devices. Every manufacturer uses a different charging cable. Your desk becomes filled with adapters.
Now imagine USB-C. One standard works with many devices.
MCP plays a similar role for AI. Instead of building hundreds of custom integrations, developers can implement one protocol that works with many tools.
Everyday Analogy
Imagine moving to another country. Without a common language, every conversation requires a different translator. Communication becomes slow and difficult.
Now imagine everyone agrees to speak English. Conversations become much easier.
MCP provides a common language between AI models and external systems.
What Is MCP?
Model Context Protocol defines how AI applications communicate with external services.
It standardizes tool discovery, tool descriptions, function execution, resource access, prompts, responses and errors.
This consistency allows AI systems to work with many different tools using the same communication pattern.
MCP Architecture
User β AI Application β MCP Client β MCP Server β Tools β Resources β External Systems.
The AI never communicates directly with every service. Instead, the MCP Client and MCP Server manage communication.
Core Components
MCP Client: Lives inside the AI application. Responsible for discovering available tools, requesting resources, executing tools and exchanging messages with MCP Servers. Examples include Claude Desktop, AI IDEs and AI Agents.
MCP Server: Provides capabilities to AI applications. Can expose Tools, Resources and Prompts. Each server focuses on a specific domain. Examples include GitHub Server, Filesystem Server, Jira Server and Database Server.
Tools: Perform actions such as create file, search repository, create Jira ticket, run SQL query, restart service, read calendar and send email.
Resources: Provide information such as documentation, files, configuration, knowledge bases, logs and source code. Unlike tools, resources are generally read rather than executed.
Prompts: An MCP Server can also provide reusable prompt templates such as Code Review Prompt, Sprint Planning Prompt, Architecture Review Prompt and Security Checklist. This enables consistent AI workflows across teams.
MCP Workflow
User Request β LLM β MCP Client β Discover Available Servers β Select Appropriate Tool β MCP Server β External System β Result Returned β LLM Generates Final Response.
MCP vs Function Calling
Function Calling: Functions are usually defined inside one application. Integration is application-specific. Good for simple applications.
MCP: Tools are exposed through a standard protocol. Applications can connect to many MCP Servers without custom integrations. Better for enterprise AI, developer tools, AI assistants, agent platforms and large ecosystems.
Security
MCP was designed with security in mind.
Best practices include authentication, authorization, user approval, permission scopes, audit logging, sandboxing and secure communication.
Applications should expose only the tools that users are authorized to access.
Real-World Example
Imagine a developer asks: "Create a Jira story, search GitHub for similar code, update the documentation and notify the team in Slack."
Using MCP: AI β GitHub MCP Server β Jira MCP Server β Filesystem MCP Server β Slack MCP Server β Results Combined β Final Response.
The AI coordinates multiple servers through one consistent protocol.
Benefits
MCP provides standardized integrations, reusable tools, easier maintenance, better scalability, vendor-neutral architecture and faster development.
Limitations
MCP still requires well-designed servers, secure implementations, proper authentication and reliable infrastructure.
Poorly designed servers can still produce poor user experiences.
Common Misconceptions
MCP is not another AI model. It does not replace Large Language Models. It is a communication protocol. Think of it as the USB-C for AI tools.
Best Practices
Keep MCP Servers focused on one domain. Expose only necessary tools. Require user approval for sensitive actions. Log requests and responses. Version MCP Servers carefully. Reuse prompt templates where appropriate.
Worked Example: One Server, Three Clients
Your team writes one MCP server for the internal ticket system exposing tools search_tickets, create_ticket, and resource ticket://{id}. Now:
- Claude Desktop connects β support managers query tickets in chat.
- Claude Code connects β engineers file bugs without leaving the editor.
- Your custom agent (AI-017) connects β an escalation bot triages new tickets overnight.
One integration, three consumers. Before MCP, that was three bespoke integrations to build and keep in sync: the MΓN problem (M apps Γ N data sources) collapsing into M+N. That arithmetic is the entire value proposition, and it's why the ecosystem converged on the standard within a year of release.
Try It Yourself
- Inventory your own MΓN: list the AI apps you use (chatbot, IDE assistantβ¦) and the systems you'd want them to reach (calendar, notes, company wiki, tickets). Multiply. That grid is what MCP reduces to one row plus one column.
- If you use Claude Desktop or Claude Code: browse the public MCP server directory, connect one server (the filesystem server is a safe start), and watch the model discover and call its tools β the handshake and discovery flow of this lesson, live.
Common Mistakes
- Confusing MCP with function calling (AI-018). Function calling is the model-side mechanism; MCP is the standardized plumbing that delivers tools/resources to any client.
- Building a custom integration where a public MCP server already exists β check the directory first.
- Exposing overly powerful tools from a server. A
run_sqltool hands the model your whole database; expose narrow, purpose-built operations instead (AI-027). - Ignoring auth boundaries. The server enforces permissions, not the model; never rely on the model to "not ask" for data it shouldn't see.
Key Takeaways
- MCP standardizes AI tool integration.
- MCP separates AI reasoning from external systems.
- MCP supports tools, resources and prompts.
- MCP simplifies enterprise AI development.
- MCP enables scalable AI ecosystems.
Glossary
- Model Context Protocol (MCP)
- An open standard, the USB-C for AI tools, that lets AI applications connect to external tools, data sources, and applications through one consistent protocol instead of bespoke integrations. It standardizes tool discovery, descriptions, execution, resource access, prompts, and errors.
- MCP Client
- The component inside the AI application (Claude Desktop, an AI IDE, a custom agent) that discovers available servers, requests resources, executes tools, and exchanges messages with MCP Servers.
- MCP Server
- A domain-focused service exposing Tools, Resources, and Prompts: a GitHub server, Jira server, filesystem server. One well-built server serves many clients: the worked example's ticket server powers chat, editor, and overnight triage bot from a single integration.
- Resource
- A readable data source an MCP Server exposes β documentation, logs, configuration, source code. Unlike tools, resources are read rather than executed.
- Prompt (MCP)
- A reusable prompt template a server can expose, like a Code Review Prompt or Security Checklist, enabling consistent AI workflows across teams.
- MΓN Problem
- The integration explosion MCP collapses: M AI apps Γ N data sources means MΓN custom integrations without a standard, but only M+N with one. That arithmetic is the protocol's entire value proposition.
- Tool Scoping
- Exposing narrow, purpose-built operations instead of overly powerful ones β a run_sql tool hands the model your whole database. The server enforces permissions, never the model. (see AI-027)
- Function Calling
- The model-side mechanism for emitting structured tool requests; MCP is the standardized plumbing that delivers tools and resources to any client. Confusing the two is the most common mistake in this lesson. (see AI-018)
References
Diagram
Knowledge Check
7 questions