What Is MCP Protocol? The Developer's Guide to the Model Context Protocol
MCP is the open standard that lets AI agents connect to any tool, database, or API through a single protocol. Here is how the architecture works and how to start building.

What Is MCP (Model Context Protocol)?
MCP is an open standard that defines how AI applications connect to external tools, databases, and services. Anthropic engineers David Soria Parra and Justin Spahr-Summers built it and announced it in November 2024. It gives language models a universal interface for discovering and using capabilities outside their training data (reading files, querying databases, calling APIs, sending messages) without requiring a custom integration for every combination of AI app and data source.
Here's the problem it solves. Before MCP, 10 AI applications and 15 data sources meant up to 150 custom connectors. MCP cuts that to 25. Each application implements one MCP client, each data source runs one MCP server, and they all speak the same protocol. The official specification draws an explicit parallel to the Language Server Protocol (LSP), which solved the same N-times-M problem for programming language support across code editors.
The protocol is open source. New contributions are licensed under Apache 2.0 (earlier code remains under MIT until relicensed). Since December 2025, MCP has been governed by the Agentic AI Foundation (AAIF), a directed fund under the Linux Foundation co-founded by Anthropic, Block, and OpenAI. Every major AI vendor has adopted it: OpenAI added MCP support in March 2025, Google DeepMind in April 2025, and Microsoft integrated it into Semantic Kernel and Azure OpenAI.
Why the USB-C Analogy Only Goes So Far
You'll see MCP compared to USB-C. One plug, many devices. That captures the standardization angle but understates the intelligence layer. A USB-C cable doesn't decide which peripheral to use based on context. MCP exposes capability descriptions that the language model reads, reasons over, and selects at runtime. The model decides whether to call a Stripe API, read a file, or query a database based on the user's request. It's less like a cable and more like a universal adapter that also hands the model a catalog of everything it can plug into.
How MCP Works: Architecture and Core Primitives
Hosts, Clients, and Servers
MCP defines three architectural roles:
- Hosts are the AI applications users interact with, like Claude Desktop, VS Code, ChatGPT, or your own agent framework. The host creates and manages MCP clients.
- Clients live inside the host, one per server connection. They handle protocol negotiation, capability discovery, and message routing between the model and the server.
- Servers expose capabilities to the AI model. A Postgres MCP server might expose query tools and schema resources. A GitHub server might expose tools for creating issues and reading pull requests.
Communication uses JSON-RPC 2.0 messages encoded in UTF-8. Clients and hosts typically run on the same machine; servers can be local processes or remote HTTP services.
Tools, Resources, and Prompts
Servers expose three core primitives:
- Tools are executable functions the model can call: file operations, API requests, database queries. The model reads the tool's description and input schema, decides when to invoke it, and passes structured arguments.
- Resources provide read-only context data like file contents, API responses, or configuration values. They give the model information without side effects.
- Prompts are reusable message templates for specific workflows. A code-review prompt might structure how the model analyzes a diff, what context to request, and how to format its response.
Clients discover available primitives via tools/list, resources/list, and prompts/list requests. The latest specification also introduces extensions including Tasks (for async long-running operations) and MCP Apps (interactive UI elements).
Transports: stdio vs Streamable HTTP
MCP supports two standard transports:
- stdio: The client launches the server as a subprocess and exchanges newline-delimited JSON-RPC messages over stdin/stdout. No network port is opened. Simplest setup for local development.
- Streamable HTTP: The server runs as an HTTP service. Each message is an HTTP POST; responses come back as JSON or a server-sent events (SSE) stream. This is the standard for remote and production deployments.
One critical gotcha with stdio: never write to stdout from your server code (no print() in Python, no console.log() in TypeScript). It corrupts the JSON-RPC message stream. Use stderr instead.
MCP vs APIs vs Function Calling
MCP doesn't replace your REST APIs. It sits a layer above them. Here's how the pieces relate:
| | REST API | Native Function Calling | MCP | |---|---|---|---| | Caller | Application code | The LLM (via provider API) | The LLM (via MCP client) | | Discovery | Documentation, OpenAPI spec | Hardcoded in the prompt | Dynamic (tools/list) | | Transport | HTTP | Provider-specific | JSON-RPC (stdio or HTTP) | | Portability | Endpoint-specific | Provider-locked | Any MCP-compatible host | | Governance | API owner | AI provider | Linux Foundation (AAIF) |
MCP vs REST APIs: Most MCP servers call REST APIs internally. MCP standardizes how the AI model discovers and invokes those APIs. Your Stripe API doesn't change; the MCP server wraps it so any MCP-compatible agent can use it without custom integration code.
MCP vs function calling: Native function calling (OpenAI's tooluse, Anthropic's tooluse) is provider-specific. You define tools in the API request, and the model returns structured calls. MCP externalizes this: tools live on servers that any host can connect to. Write a tool once as an MCP server, and it works across Claude, ChatGPT, VS Code, and every other MCP client.
MCP vs A2A: Google's Agent-to-Agent Protocol (A2A) connects agents to other agents for task delegation and negotiation. MCP gives an agent hands (tools and data); A2A gives it colleagues. Most production systems use both.
The 2026 Specification: What Changed
The 2026-07-28 revision is the most substantial change since authorization was added. The headline: MCP is now stateless at the protocol layer.
Previously, clients and servers performed an initialize handshake that established a session with a persistent ID. The new spec removes that entirely. Each request now carries its own protocol version, client identity, and capabilities in a _meta parameter. Servers advertise their capabilities via a server/discover request instead of a one-time handshake.
The revision also deprecated several features (with a 12-month grace period): roots, sampling, and protocol-level logging. Authorization now requires OAuth 2.1 with PKCE, and token passthrough (servers accepting tokens not issued for them) is explicitly forbidden.
MCP Security: What You Need to Know
MCP introduces a real attack surface that the ecosystem is still catching up to. The NSA published formal guidance in May 2026 warning that MCP's "rapid proliferation has outpaced the development of its security model."
The risks aren't theoretical. Tool poisoning attacks hide malicious instructions in tool descriptions that the model follows silently. The first known malicious MCP server, a postmark-mcp npm package, added a hidden BCC to every outgoing email, exfiltrating password resets and invoices. CVE-2025-6514 (CVSS 9.6) in mcp-remote allowed arbitrary command execution and wasn't patched until version 0.1.16.
Here's a hardening checklist for teams deploying MCP servers:
- Restrict filesystem access. Only grant servers access to directories they need. MCP servers run with your user account permissions.
- Sandbox local servers. Use containers or chroot for stdio servers, especially third-party ones.
- Require OAuth 2.1 for remote servers. Use PKCE (S256), audience-bound tokens, and issuer validation.
- Validate all URLs. Reject
javascript:,data:, andfile:schemes. Block private IP ranges to prevent SSRF. - Pin tool definitions. Lock server versions to prevent supply-chain attacks that modify tool descriptions between releases.
- Audit before deploying third-party servers. Check the source code. Independent scans have found that 38% or more of MCP servers have no authentication.
How to Get Started with MCP
Building Your First MCP Server in Python
Install the SDK and scaffold a project:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv init my-server && cd my-server
uv add "mcp[cli]"Create a minimal server that exposes one tool:
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("my-server")
@mcp.tool()
def greet(name: str) -> str:
"""Say hello to someone."""
return f"Hello, {name}!"
mcp.run(transport="stdio")Test it with the MCP Inspector:
uv run mcp dev my_server.pyFor TypeScript, install @modelcontextprotocol/server and zod, register tools with server.registerTool(), and start with serveStdio(createServer). Official SDKs also exist for Go, Java, Kotlin, C#, Ruby, Rust, Swift, and PHP.
Connecting to Existing MCP Servers
Most MCP clients use a JSON config file. For Claude Desktop, edit claude_desktop_config.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/projects"]
}
}
}Restart the application and the filesystem tools appear automatically. Reference servers you can run immediately with npx or uvx include filesystem, git, fetch, memory, and sequential-thinking.
Choosing a Transport
Use stdio for local development and single-user desktop setups. It's simpler, needs no port management, and has no network attack surface. Use Streamable HTTP for production deployments, multi-user access, and remote servers.
Where MCP Is Headed
The numbers tell the story: over 10,000 MCP servers in production, SDKs downloaded more than 97 million times per month, and adoption by every major AI platform. The first MCP Dev Summit in New York (April 2026) drew roughly 1,200 attendees.
For teams building AI agents that connect to dozens or hundreds of tools, the protocol kills the integration tax that used to eat up development time. Platforms like Gamut run 180+ MCP integrations, from Stripe and Gmail to Slack, Notion, and Supabase, so agent builders can wire up integrations in minutes instead of weeks. If you're evaluating MCP for your agent stack, browsing a curated registry of production-ready servers is a faster starting point than hunting through npm.
FAQ
What does MCP stand for? MCP stands for Model Context Protocol. "Model" refers to the language model. "Context" refers to the tools, data, and prompts the protocol brings into the model's working context.
Is MCP the same as an API? No. MCP sits above APIs. Most MCP servers call REST or GraphQL APIs internally, but MCP standardizes how the AI model discovers and invokes those APIs at runtime. The underlying API still does the actual work.
What is the difference between an MCP server and client? An MCP server exposes capabilities (tools, resources, prompts). An MCP client lives inside the AI application, discovers servers, and relays their capabilities to the language model. The host creates one client per server.
Does MCP work with models other than Claude? Yes. OpenAI added MCP support in March 2025, Google DeepMind in April 2025, and Microsoft integrated it into its AI stack. MCP is model-agnostic by design. Any application that implements an MCP client can use any MCP server.
Is MCP secure? MCP introduces real security considerations. The NSA published formal guidance in May 2026, and over 40 CVEs have been disclosed against core MCP implementations. The July 2026 spec revision added stricter authorization requirements. Teams should sandbox servers, audit third-party code, and follow the hardening checklist above.
Who created MCP and who governs it? Anthropic created MCP and open-sourced it in November 2024. Since December 2025, it's been governed by the Agentic AI Foundation under the Linux Foundation, co-founded by Anthropic, Block, and OpenAI.
Skip the Integration Work
Gamut gives your AI agents access to 180+ MCP integrations out of the box -- Stripe, Gmail, Slack, Notion, databases, and more. Browse the full registry and connect your first server in minutes.