WTF is an MCP? Demystifying the Model Context Protocol
Large language models (LLMs) like Claude, ChatGPT, and Gemini have revolutionized how we interact with technology. They can write, research, and solve complex problems. However, they often operate in isolation, cut off from real-time data and external tools. This is where the Model Context Protocol (MCP) comes in.
The Problem: LLM Isolation and the N x M Challenge
LLMs traditionally lack direct access to current information or the ability to interact with other applications. This leads to:
- The Copy-Paste Dance: Users manually shuttle information between the LLM and other sources/tools.
- The N x M Problem for Developers: Integrating N different LLMs with M different tools requires custom, non-standardized code for each
N*M
combination. This means redundant effort, high maintenance, and fragmented implementations.
Enter MCP: A Universal Remote for AI
Developed by Anthropic and released as an open-source protocol, MCP provides a standardized way for LLMs to connect with external data sources and tools. Think of it as a "universal remote" for AI applications.
It builds upon existing concepts like function calling (or "tool use"), but standardizes the process. Instead of defining model-specific schemas and handlers for each tool and each LLM, MCP offers:
- Consistent Tool Specification: A uniform way to define tools (functions) across different AI systems.
- Standardized Discovery & Execution: A protocol for finding available tools and running them.
- Plug-and-Play Integration: Enables any MCP-compatible AI app to use any MCP-compatible tool without custom code.
How MCP Works: The Client-Server Dance
MCP uses a client-server architecture, inspired by the Language Server Protocol (LSP) used in code editors.
- Host Application: The LLM interface (e.g., Claude Desktop, Cursor).
- MCP Client: Lives within the host app, talks to MCP servers using the protocol.
- MCP Server: Exposes specific tools/capabilities (e.g., access to GitHub, Slack, databases) to the client.
- Transport Layer: How clients and servers communicate (e.g., STDIN/STDOUT for local, HTTP+SSE for remote).
The Flow:
- Handshake: Client connects to servers and discovers available tools.
- User Request: User asks the LLM something requiring external access (e.g., "Summarize my recent Slack DMs").
- Tool Selection: LLM identifies the need for an MCP tool (e.g., the Slack MCP server).
- Permission: Client asks the user for permission to use the tool.
- Execution: Client sends a request to the server; the server performs the action (e.g., fetches Slack messages).
- Response: Server returns the result to the client.
- Integration: LLM incorporates the result into its response.
Source: Descope
The Growing MCP Ecosystem
MCP is gaining traction:
- Clients: Claude Desktop, Cursor, Zed, Continue, Sourcegraph Cody.
- Frameworks: Firebase Genkit, LangChain adapters, Superinterface.
- Servers:
- Reference: PostgreSQL, Slack, GitHub (maintained by MCP contributors).
- Official: Stripe, JetBrains, Apify (maintained by the companies).
- Community: Discord, Docker, HubSpot (maintained by enthusiasts).
Security Considerations
MCP uses OAuth 2.1 subsets for authorization. Key considerations include:
- Standard OAuth security practices (preventing open redirects, securing tokens, using PKCE).
- Human-in-the-Loop: Explicit user permission is crucial. Clear prompts are needed.
- Least Privilege: Servers should request only necessary permissions.
The Future of Connected AI
MCP aims to solve the N x M integration problem, fostering a more interoperable AI ecosystem. Future developments like an official server registry and enhanced AI-to-AI collaboration (sampling capabilities) promise even more powerful and seamlessly integrated AI experiences.
By standardizing how AI models connect to the outside world, MCP paves the way for more capable, context-aware, and genuinely helpful AI assistants.
This post drew heavily from the excellent explanation of MCP by Descope: What Is the Model Context Protocol (MCP) and How It Works