Bridging the Gap: A Deep Dive into the Model Context Protocol (MCP)
Source: Dev.to
What Is MCP?
MCP provides a unified bridge between a model and the “outside world,” giving AI “superpowers” that go beyond a simple chat interface. By standardising how models access information and execute tasks, MCP makes AI tools more integrated, capable, and easier to build.
Architecture Overview
MCP follows a client‑server model:
- MCP Host – the application (e.g., VS Code, Claude Desktop) that wants to use external resources.
- MCP Server – a local or remote program that exposes data or functionality.
- MCP Client – a dedicated connection within the host for each specific server.
When the host connects to a server, it instantiates an MCP client object for that connection. Multiple client objects can coexist (e.g., one for a Jira server, another for the local filesystem).
Protocol Layers
Data Layer
Defines what is being said. Based on JSON‑RPC, it handles the connection lifecycle and core primitives (tools, resources, and prompts).
Transport Layer
Defines how the message gets there.
| Transport | Use‑case | Characteristics |
|---|---|---|
| Stdio Transport | Local processes on the same machine (e.g., VS Code ↔ local files) | Lightning‑fast, zero network overhead |
| Streamable HTTP Transport | Remote servers (e.g., official Jira MCP server) | Uses HTTP POST + Server‑Sent Events (SSE); supports secure authentication (OAuth) |
Core Primitives
Once a host is connected to a server, the AI can interact with three main primitives:
Tools (Executable Functions)
The AI can perform actions.
{
"method": "create_issue",
"params": {
"title": "Bug in login flow",
"description": "Steps to reproduce..."
}
}
Example: create_issue creates a Jira ticket; add_comment updates a task.
Resources (Data Sources)
Provide context the AI needs.
Example: Project schemas help the AI map “Priority Highest” → “Blocker”; user profiles map names to IDs.
Prompts (Templates)
Reusable instructions that structure interactions.
Example: A Bug Reporter prompt forces the AI to ask for “Steps to Reproduce” before creating a ticket.
Server‑to‑Client Interactions
MCP is not a one‑way street. Servers can request help from the client:
| Interaction | Description |
|---|---|
| Sampling | Server asks the AI host to complete a task (e.g., summarise 10 tickets into a release‑note paragraph). |
| Elicitation | Server prompts the user for missing information (e.g., “Which project should this ticket go into?”). |
| Logging | Server sends debug messages to the client for monitoring. |
Notification System
In dynamic environments, tools and data sources change constantly. MCP handles this through a notification system built on JSON‑RPC 2.0, allowing a server to push updates to the client without waiting for a request.
JSON‑RPC (JavaScript Object Notation‑Remote Procedure Call) is a JSON‑based wire protocol for remote procedure calls. It supports notifications (data sent that does not require a response) and asynchronous multiple calls.
For more information about the JSON‑RPC specification, click here.
The client simply waits to be told about changes—if a database goes offline or a new tool becomes available, the AI learns instantly.
Why MCP Matters
As LLMs become more powerful, their utility increasingly depends on context. MCP standardises the way models obtain that context, simplifying development and enabling richer, more capable AI applications.
Getting Started
More and more companies are releasing official MCP servers every day. Explore the most popular ones in the Anthropic MCP Gallery.