Dev.to AI 🤖 Ai 👁 0 📖 9 min read

MCP (Model Context Protocol) — the standard that connects every LLM app to tools in 2026

By late 2026, Model Context Protocol (MCP) is the standard every AI coding assistant, chat app, and agent framework has settled on for one problem: how an LLM application connects to the data and tools that live outside

By late 2026, Model Context Protocol (MCP) is the standard every AI coding assistant, chat app, and agent framework has settled on for one problem: how an LLM application connects to the data and tools that live outside it. Claude Desktop, Cursor, Zed, VS Code, and most agent frameworks ship MCP support natively. If an engineering team is adding tool integrations to anything LLM-powered in 2026, MCP is the first thing on the shortlist — and often the only thing.

This article covers what MCP actually is, the three roles that make it work, the two transports it uses, when to pick it over a direct integration, and the misconceptions that trip teams up on first adoption.

The problem MCP solves

Before MCP (released by Anthropic in late 2024), every LLM app that needed external data or tool access invented its own integration layer. Claude Desktop had its own plugin shape. OpenAI's ChatGPT had GPTs with their own OpenAPI-flavoured spec. Cursor had its own tool configuration. Internal company AI apps built one-off clients against whatever API they needed.

The result: a tool that wanted to be reachable from three different LLM apps got built three times. A team wanting to expose their internal docs to an AI assistant wrote a custom integration against each AI assistant they used. The ecosystem was fragmented in the exact way the web was before HTTP standardised client-server communication.

MCP standardises that integration layer. One MCP server exposes capabilities once; any MCP-aware host application can connect to it. The analogy that gets used most often is "USB-C for AI": one plug shape, many devices.

The three roles

MCP has a strict three-role architecture. Getting these right in the mental model avoids most beginner confusion.

Host — the AI application the user interacts with. Claude Desktop, Cursor, Zed, VS Code with an MCP-aware extension. The host runs the LLM (or calls it over an API) and decides when the LLM should use an external tool or read external data. One host, zero or many clients inside it.

Client — a connector that lives inside the host and manages one connection to one server. If a host is connected to five servers, it runs five client instances internally. The client handles the protocol-level details (JSON-RPC messages, transport, capability negotiation) so neither the host nor the server has to care about the mechanics.

Server — a process that exposes capabilities. A filesystem server exposes "read this file" and "list this directory." A GitHub server exposes "search issues" and "create pull request." A company's internal docs server exposes "search the handbook" and "fetch the policy for X." Servers can run as a local subprocess on the user's machine or as a remote HTTP service.

The data flow: user asks the host something, host decides which server(s) to involve, host's client talks to the server, server returns results, host feeds results back into the LLM prompt, LLM composes the answer.

The three server primitives

A server exposes capabilities as three kinds of thing:

Tools — functions the LLM can call to perform an action or compute a value. A search_web(query) tool. A send_email(to, subject, body) tool. A run_sql(query) tool. Tools are the primitive that most people think of when they hear "MCP."

Resources — read-only data the host can fetch and surface to the LLM as context. A specific file's contents. A database schema. A document from a knowledge base. Resources are addressed by URI and are passive — the host decides when to read them.

Prompts — reusable prompt templates the host can offer to the user as pre-made actions. "Summarise this document." "Refactor this code." "Explain this error." Prompts are the primitive that lets servers suggest workflows, not just raw capabilities.

Most servers in practice expose mostly tools, some resources, and few or no prompts. The three are complementary; a filesystem server might expose a read_file tool AND a file:// resource type, with the resource being the way the host pre-loads a file and the tool being the way the LLM reads a file during a conversation.

The two transports

The MCP spec is transport-agnostic — any bidirectional message channel will do — but in practice two transports cover every real deployment.

stdio — the server runs as a local subprocess, communicating with the client over standard input and output. Zero network, zero authentication, lowest friction. The right choice for local servers that access the user's own machine (filesystem, local git, local database). The host launches the server when needed and shuts it down when the host closes.

Streamable HTTP — the server runs as a remote HTTP service. The client sends messages via HTTP POST, optionally receives streaming responses via Server-Sent Events. Supports standard HTTP auth including bearer tokens, API keys, and OAuth. The right choice for servers that expose cloud data or company-wide infrastructure where many users share one server instance.

An earlier HTTP+SSE transport existed in older spec revisions and was replaced by Streamable HTTP in the 2025-03-26 spec revision. New servers should use Streamable HTTP; older servers may still ship HTTP+SSE and work with older clients that haven't upgraded.

Underneath, it's just JSON-RPC

MCP's wire protocol is JSON-RPC 2.0 on top of the chosen transport. Every message is a JSON object with jsonrpc, id, method, and params (or result / error for responses). Reading the raw messages during debugging is useful; the official MCP Inspector prints them in a readable form.

The implication: an MCP server is not a special kind of process — it's a program that reads JSON-RPC messages on stdin (or an HTTP endpoint) and writes JSON-RPC responses. Any language with a JSON parser can implement one; official SDKs ship in Python, TypeScript, Java/Kotlin, Swift, C#, with community implementations in Rust and others.

A minimal Python server

The Python SDK ships at pip install mcp. The exact import path can shift between major versions — always start from the current quickstart on modelcontextprotocol.io before copying older examples. The pattern that covers 90% of real servers (using the stable FastMCP class):

# server.py
from mcp.server.fastmcp import FastMCP

mcp = FastMCP(name="my-first-server")


@mcp.tool()
def add(a: int, b: int) -> int:
    """Return the sum of two integers."""
    return a + b


@mcp.resource("greeting://{name}")
def greeting(name: str) -> str:
    """Return a friendly greeting for the given name."""
    return f"Hello, {name}!"


if __name__ == "__main__":
    # Default transport is stdio — the server waits on stdin for client messages.
    mcp.run()

Three things to notice:

  1. The decorators are the whole registration step. @mcp.tool() and @mcp.resource() are all that's needed to make a function or resource template visible to clients. No manifest file, no JSON schema to hand-write — the SDK generates both from the Python signature + docstring.
  2. Type hints and docstrings matter. The LLM sees them. A tool named fetch with the docstring "returns stuff" is useless; the same function named fetch_user_profile with "Returns the user's name, email, and plan tier given their user_id" is useful.
  3. stdio by default. mcp.run() with no arguments starts a stdio server. For Streamable HTTP, pass transport="streamable-http" or use the uv run mcp run server.py --transport streamable-http CLI.

Test the server locally with the official Inspector:

uv run mcp dev server.py

The Inspector opens in a browser and lets you call tools and read resources without needing a full LLM host. First debugging stop whenever a tool isn't working as expected.

Version pinning note: the Python SDK has moved classes and import paths between major revisions. If adopting an older codebase, pin the mcp package version that matches the imports the codebase uses (pip show mcp to see the current version), and consult the SDK changelog before upgrading. New code should start from the current quickstart example on modelcontextprotocol.io.

Connecting to a host

Once a server is running, a host needs to be told about it. For Claude Desktop and most other local hosts, this is a JSON config file that lists each server by name, the command to run it, and any environment variables. Rough shape:

{
  "mcpServers": {
    "my-first-server": {
      "command": "python",
      "args": ["/absolute/path/to/server.py"]
    }
  }
}

The exact file path and schema vary by host (Claude Desktop's lives in a per-OS location, Cursor's lives inside its workspace settings, VS Code has an extension-specific config). The MCP spec defines the server; the host defines where it looks for servers.

For remote (Streamable HTTP) servers, the config usually points to a URL and specifies auth headers instead of a command.

When MCP is the right pick

MCP is the right pick when any of these are true:

  • The server exposes capabilities that more than one AI app should be able to use. Writing it once as an MCP server is cheaper than writing it as three different host-specific plugins.
  • The capability is something a user installs on their own machine (filesystem, local git, personal notes). stdio keeps everything local and permissions clean.
  • The server will be reused across teams or published to the ecosystem. An MCP server with a clear name has instant installability for anyone who runs an MCP-aware host.
  • The capability needs to work from inside an agent framework (LangChain, LlamaIndex, custom), not just a chat UI. Most agent frameworks now consume MCP servers natively.

MCP is the wrong pick when:

  • The capability is a one-off integration for exactly one in-house app that will never be reused. The MCP overhead is wasted.
  • The capability needs sub-millisecond latency or has to run in-process with the LLM. MCP adds a JSON-RPC round-trip; direct function calls are faster for hot paths.
  • The LLM app does not run tools at the user's request but as part of an agent loop where the host already has native tool support. For some setups, an in-process tool definition is still simpler than an external server.

Three misconceptions worth clearing

"MCP is a replacement for LangChain / LlamaIndex." No. MCP is the layer below. LangChain still composes LLM calls, memory, and chains; now one of the ways it can gain tools is by consuming an MCP server, rather than requiring custom LangChain tool classes. The two complement.

"MCP is Anthropic-only." No. Anthropic open-sourced the spec and the ecosystem has clients and servers for multiple LLM vendors. The protocol doesn't care which model the host is running.

"MCP is just OpenAPI for LLMs." Related but distinct. OpenAPI is a REST contract description language. MCP is a bidirectional protocol with a stateful connection, with tool / resource / prompt primitives, specifically shaped for LLMs to use. An MCP server can expose an OpenAPI-described service — but the MCP layer is doing more than describing a REST surface.

What's current and what's shifting

The MCP spec continues to iterate on a quarterly rhythm. The core architecture (host/client/server, three primitives, two transports, JSON-RPC under the hood) has been stable since 2025. Primitive additions, authorisation hardening, and transport improvements land in each new spec revision — some older primitives also move toward deprecation as the spec consolidates. Before building against any specific primitive, verify its current status on the official changelog at modelcontextprotocol.io; article-tier summaries of a fast-moving spec decay in weeks.

Reference pages worth bookmarking: the official docs at modelcontextprotocol.io, the Python SDK repository on GitHub (modelcontextprotocol/python-sdk), and the server registry (community-maintained lists of published servers for popular services).

Bottom line

MCP solved a fragmentation problem that cost real engineering time in 2023 and 2024. By late 2026 it's close to table stakes for any serious LLM-powered application that connects to external systems. The learning curve to publish a basic server is roughly an hour. The pay-off is that any MCP-aware host can use the server with no further integration work — including hosts that don't exist yet.

For teams shipping anything beyond pure prompt-in-answer-out LLM UX, MCP is now the default integration layer. The alternative is still writing per-host adapters forever.

Related reading:

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.