MCP servers explained for developers (2026).
The Model Context Protocol is the standard way AI assistants call tools as of 2026. Every major assistant adopted it. Here is what MCP actually is, what it isn't, and how to build a server in 50 lines.
What is an MCP server in plain terms?
An MCP server is a small program that exposes a set of tool calls (and optionally resources and prompts) over a standard protocol — the Model Context Protocol. AI assistants speak that protocol the same way browsers speak HTTP, which means any MCP-compatible client (Claude Code, Cursor, Codex, Claude.ai, Continue, Cline) can call any MCP-compatible server. You write the server once; every assistant gets the tools.
The shape of MCP
MCP has three concepts:
- Tools. Functions the assistant can call. Each has a name, a JSON-Schema input, and a structured output. This is the most-used MCP feature in 2026.
- Resources. Read-only data the assistant can request by URI: files, database rows, config. The client pulls them; the server serves them.
- Prompts. Server-defined prompt templates the assistant can use directly. Less common in practice; mostly used by domain-specific helpers.
For a deeper breakdown of which primitive to reach for, see resources vs tools vs prompts.
Transports
Two transports, picked by the client:
- stdio: the client spawns the server as a child process and communicates over stdin/stdout. Used by CLI assistants (Claude Code, Codex, Cursor). Auth comes from the parent process.
- Streamable HTTP: the client POSTs to the server over HTTPS and reads responses as Server-Sent Events. Used by hosted assistants (Claude.ai, ChatGPT custom connectors). Auth is OAuth 2.1 with Dynamic Client Registration (RFC 7591).
Why every assistant adopted it
Pre-MCP, each AI assistant had its own tool-call shape: OpenAI's function calling, Anthropic's tool_use, Google's function-declarations, etc. Tool authors had to ship N integrations to reach N assistants, and rewrite each when the host changed its calling convention. MCP collapses that into one tool surface that every assistant agrees to read.
The adoption curve in 2025–2026 was steep because the alternative was unsustainable. Anthropic open-sourced the spec, OpenAI integrated it into Codex CLI, Cursor adopted it natively, Microsoft added it to GitHub Copilot, and the community shipped ~500 servers in the first year.
A minimal MCP server in 50 lines
// server.ts: TypeScript SDK
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({
name: "my-server",
version: "1.0.0",
});
server.tool(
"say_hello",
"Greet someone by name",
{ name: z.string() },
async ({ name }) => ({
content: [{ type: "text", text: "Hello, " + name + "!" }],
}),
);
await server.connect(new StdioServerTransport()); Ship it on npm; users add it to their assistant of choice via one line of config.
Where MCP is in 2026
- Server registry. modelcontextprotocol/servers on GitHub catalogues the official + community list.
- Spec maturity. The protocol has settled and breaking changes are rare, though the 2026-07 release candidate is the largest revision yet: a stateless core, response caching, and a formal deprecation policy. Recent additions include authorization (OAuth 2.1) and elicitation, where a server can prompt the user mid-call.
- Discovery. Most clients now have a UI for browsing and installing MCP servers, including OAuth-protected hosted ones.
- Production usage. Real teams ship internal MCP servers for their custom systems, which is where the protocol stops being a curiosity and starts being infrastructure.
Where Stacktree fits
stacktree-mcp is the MCP server behind Stacktree. The easiest way to wire it into any coding agent is npx stacktree-install. Pick Claude Code, Cursor, Codex, OpenCode or Amp during the prompts and you get seven tool calls in that agent: publish HTML, replace HTML in place, gate by password or email domain, set expiry, list, delete. The protocol is the whole story: there's no separate API to learn, no separate auth model, no separate transport. If your assistant speaks MCP, it speaks Stacktree.
Frequent questions
What is the Model Context Protocol? +
How does MCP compare to OpenAI function calling? +
What transports does MCP use? +
Do I need to build an MCP server to use existing ones? +
How do I build my own MCP server? +
Related guides
- The MCP publish tool Stacktree's seven verbs in detail.
- What changed in the 2026-07 MCP spec The stateless core, MCP Apps, Tasks, and more.
- Resources vs tools vs prompts The three server primitives and when to use each.
- Why agents need a publish primitive The motivation post that frames why MCP matters.
Sources and further reading
- Model Context Protocol — official spec ↗ Authoritative reference for the protocol described in this post.
- MCP servers — official registry ↗ Catalogue of public MCP servers.
- Anthropic — MCP announcement ↗ The original launch post from Anthropic in late 2024.
- TypeScript SDK ↗ The SDK the minimal example uses.
Try a real MCP server.
Install Stacktree in Claude Code, Codex, or Cursor. See the protocol in action.
Sign up free →