At a Glance
- Problem: Without a protocol boundary, every pairing of an AI host and a tool needs a custom adapter with its own schemas, lifecycle code, discovery, error handling, and authentication, and those integrations cannot move between compatible hosts.
- Forces: Reuse across hosts versus the extra deployment and debugging work of another protocol layer; remote shared servers versus the authentication, isolation, and monitoring they demand; exposing many tools versus the context they consume and the selection quality they reduce.
- Solution: Wrap each capability in an MCP server that exposes tools, resources, and prompts. The host creates a client per server, which negotiates capabilities, discovers what the server offers, and carries requests over stdio or Streamable HTTP.
- Consequences: Gains: a capability built once works in multiple compatible hosts and can be owned by a separate team. Costs: MCP does not make tools safe, so authorization, validation, and approval stay your job, and remote servers add distributed-systems failures.
What is MCP?
Model Context Protocol (MCP) is an open protocol for connecting an AI application to tools, resources, and reusable prompts. A host creates an MCP client for each configured server; the client negotiates capabilities, discovers what the server exposes, and carries protocol messages between the host and server.
MCP standardizes the integration boundary. It does not decide when a model should call a tool, provide agent-to-agent delegation, or make an unsafe tool trustworthy. Those responsibilities remain with the host, model orchestration, authorization layer, and tool implementation.
Current version status
Verified October 24, 2026. The latest MCP specification is 2026-07-28, released on July 28, 2026. The release announcement quotes David Soria Parra calling it the most important release since remote MCP first launched, and it changes the transport model rather than the primitives:
- The protocol went stateless. The initialize handshake and the protocol-level session are gone. Requests are self-contained, and capability negotiation happens per request. A remote server can now sit behind a plain round-robin load balancer with no sticky sessions and no server-side session state.
- One HTTP request per call. The legacy flow (initialize to obtain an
Mcp-Session-Id, then invoke) collapses into a single POST carryingMCP-Protocol-Version: 2026-07-28,Mcp-Method, andMcp-Nameheaders. The payload remains JSON-RPC 2.0; client information moves into a_metafield within params. - Multi Round-Trip Requests (MRTR) are a new pattern for server-to-client interaction within a request.
- The Enterprise-Managed Authorization extension is stable, letting organizations centrally manage authorization so end users reach all connected servers through a single login.
- Optional extensions now cover Tasks (durable long-running operations), MCP Apps (inline interactive UI), and a Skills over MCP working group.
SDK status: the redesigned v2 TypeScript packages (split @modelcontextprotocol/server, @modelcontextprotocol/client, and @modelcontextprotocol/core) were released as stable 2.0.0 on July 27, 2026 and implement the 2026-07-28 revision; the maintainers call v2 the stable release line. The v1 line (@modelcontextprotocol/sdk, latest 1.32.2) continues to receive bug fixes and security updates for at least six months after the v2 release.
In practice, existing v1 applications can stay pinned to a v1 release for now, but put the v2 migration on the schedule, because v1 support is time-limited and the specification v2 targets is already the current one. New remote servers are the strongest candidates to start on v2, because statelessness removes most of the deployment complexity that the v1 Streamable HTTP transport carried.
What problem does MCP solve?
Without a protocol boundary, every host-to-tool combination needs a custom adapter:
- provider-specific function schemas;
- bespoke process or HTTP lifecycle code;
- inconsistent discovery and error handling;
- duplicated authentication and configuration;
- integrations that cannot move between compatible hosts.
MCP turns those adapters into reusable servers. A database team can expose a constrained query tool once; multiple compatible hosts can discover and invoke it without rewriting the database integration for each host.
Architecture
MCP Host (AI application)
└── MCP Client (one connection per configured server)
└── MCP Server
├── Tools callable operations
├── Resources readable context
└── Prompts reusable prompt templates
Host: the user-facing AI application. It owns model access, consent, server configuration, and the final decision to expose a server capability to the model.
Client: the protocol participant inside the host. It negotiates capabilities, lists server primitives, sends requests, and handles responses or notifications. Under the 2025-11-25 specification this starts with an initialize handshake and a session; under 2026-07-28, negotiation is carried per request and there is no protocol-level session.
Server: a local process or remote service that exposes bounded capabilities. Servers should keep authorization and domain rules close to the underlying system rather than trusting model-generated arguments.
For local integrations, stdio gives the host direct process ownership and a simple trust boundary. For remote shared services, Streamable HTTP supports network deployment but adds authentication, tenant isolation, origin validation, rate limiting, and operational monitoring. The 2026-07-28 revision removes one large piece of that operational work. With no protocol-level session, remote servers no longer need sticky routing or shared session storage to scale horizontally.
When should you use MCP?
Use MCP when:
- the same capability must work in more than one compatible host;
- a team owns a reusable tool or context service independently from the AI application;
- discovery and capability negotiation are more maintainable than a hard-coded function list;
- local tools need a standard subprocess contract;
- remote tools need an explicit protocol boundary and lifecycle.
Prefer direct Tool Calling when:
- one application owns one or two stable functions;
- portability is not a requirement;
- the provider’s native tool API is already the simplest boundary;
- another protocol layer would add more deployment and debugging work than reuse.
MCP is not a replacement for Multi-Agent Collaboration. MCP connects a host to capabilities. Agent-to-agent protocols and orchestration define delegation, task state, artifacts, and collaboration between autonomous agents.
Implementation workflow
- Keep business logic independent from the protocol adapter.
- Define narrow input and output schemas.
- Register the tool, resource, or prompt with an MCP server.
- Choose stdio for host-managed local processes or Streamable HTTP for remote service deployment.
- Configure the host with the minimum required environment and permissions.
- Test discovery, valid calls, invalid inputs, downstream failures, cancellation, and authorization separately.
Executed core handler
The repository includes examples/mcp/search-docs.mjs, which keeps searchable document logic separate from MCP transport code. It was executed on July 23, 2026 with:
node --test tests/mcp-search-docs.test.mjs
The test covers a successful match and rejection of an empty query. This verifies the tool’s domain handler, not MCP protocol interoperability.
export function searchDocs(query, documents) {
const normalized = query.trim().toLowerCase();
if (!normalized) throw new Error("query must not be empty");
return documents
.filter((document) => document.text.toLowerCase().includes(normalized))
.map(({ id, title }) => ({ id, title }));
}
TypeScript SDK adapter (illustrative)
The following adapter targets @modelcontextprotocol/sdk@1.30.0, a v1 release. It is illustrative and was not executed in this repository, because the SDK is not a project dependency.
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
import { searchDocs } from "./search-docs.js";
const documents = [
{ id: "mcp", title: "Model Context Protocol", text: "MCP connects hosts to tools." },
];
const server = new McpServer({ name: "docs-server", version: "1.0.0" });
server.tool(
"search_docs",
"Search the approved documentation corpus",
{ query: z.string().min(1) },
async ({ query }) => ({
content: [
{
type: "text",
text: JSON.stringify(searchDocs(query, documents)),
},
],
}),
);
await server.connect(new StdioServerTransport());
Pin the SDK version in a real application and validate the API against the v1 documentation. The v2 packages targeting the 2026-07-28 specification are the stable release line; plan the migration deliberately, starting with servers, and review the specification migration notes rather than translating v1 code line by line.
Security and operational boundaries
Treat MCP server installation and tool invocation as privileged operations.
- Validate every argument at the protocol boundary and again where domain invariants require it.
- Enforce authorization in the server or downstream system; never infer permission from the model’s request.
- Require explicit user approval for destructive, financial, or externally visible operations.
- Apply least privilege to local process credentials and remote service tokens.
- For Streamable HTTP, validate origins, authenticate clients, isolate tenants, rate-limit requests, and log tool outcomes without storing secrets.
- Treat tool descriptions, resource content, and tool results as untrusted input that can contain prompt-injection instructions.
- Trace initialization, discovery, calls, latency, errors, cancellations, and downstream side effects.
Worked Example: Cost and Latency
A coding assistant connected to five MCP servers exposing 80 tools handles 3,000 agent turns a day on the large model.
| Setup | Tool-definition tokens per call | Input tokens per turn | Cost per 1,000 turns | Latency per turn |
|---|---|---|---|---|
| All 80 tools exposed on every call | 12,000 | 60,000 | $192.00 | 15.3 s |
| Routed to one server's 12 relevant tools | 1,800 | 19,200 | $69.60 | 15.3 s |
| All 80 tools, definitions served from cache | 12,000 (at 10% price) | 60,000 | $62.40 | 15.3 s |
Assumptions: 150 tokens per tool definition, 3,000 tokens of conversation and task per call, 4 model calls per turn, and 200 output tokens per call. The cached row assumes the definitions stay cached across turns.
With all tools exposed, each call reads 12,000 + 3,000 = 15,000 tokens, so a turn reads 60,000 × $3.00 per million = $0.18 and writes 800 × $15.00 per million = $0.012, or $192.00 per 1,000 turns. Routing cuts input to 4 × 4,800 = 19,200 tokens ($0.0576), so $69.60. Caching charges 48,000 definition tokens at $0.30 per million ($0.0144) plus 12,000 at full price ($0.036), so $62.40. Latency is 4 × (0.5 + 200 / 60) ≈ 15.3 s in every row, because this model ignores the extra time spent reading long prompts.
Tool definitions are 80% of the input in the first row; once servers expose more than a few dozen tools, routing or caching cuts cost by about two thirds, and only routing also shrinks the set the model must choose from.
Failure modes
Tool overload: exposing hundreds of tools can consume context and reduce selection quality. Publish smaller capability sets or route to specialized servers.
Protocol/version drift: copying examples from an unreleased SDK branch can break production imports. Pin stable packages and record the specification version.
Hidden authorization gaps: a correct schema does not prove that the caller may perform the operation. Preserve user and tenant identity through the call chain.
Remote-server ambiguity: network MCP adds normal distributed-systems failures. Define timeouts, idempotency, retry behavior, and cancellation semantics.
Conflating MCP with agent delegation: an MCP tool call is not a stateful remote-agent task. Use an agent-to-agent protocol when the remote party owns planning, task lifecycle, and artifacts.
Frequently asked questions
What is the difference between MCP and tool calling?
Tool calling is the model-facing mechanism for requesting a structured operation. MCP standardizes how a host discovers and communicates with an external capability provider. A host may expose MCP tools through its model provider’s native tool-calling API.
Do I need MCP for a simple chatbot?
Usually not. Direct tool calling is simpler when one application owns a small, stable function set. MCP pays off when capabilities must be reusable across hosts or independently deployed.
Which transport should I use?
Use stdio for local tools whose process lifecycle is owned by the host. Use Streamable HTTP for remote or shared services, accepting the additional authentication, isolation, networking, and observability work. If you are building a new remote server, evaluate the stateless 2026-07-28 transport first, since it removes session affinity from the deployment entirely.
Does MCP make tools safe?
No. MCP provides protocol structure; it does not authorize business operations or make a tool behave safely. Safety depends on schemas, permissions, user confirmation, sandboxing, downstream controls, and audit logs.
Primary references
- Model Context Protocol specification
2026-07-28 - Official MCP blog:
2026-07-28release and stateless transport - Official MCP specification and documentation repository
- Official TypeScript SDK and v1/v2 status
- MCP security best practices