Web Dev Tools

MCP (Model Context Protocol)

The open standard for plugging tools and data sources into AI assistants.

Model Context Protocol is Anthropic's open standard for how LLM hosts (Claude Desktop, Claude Code, Cursor, IDE plugins, agents) talk to external tools and data sources. By 2026 it's the default — every major coding assistant, agent framework, and AI gateway speaks MCP.

Concepts

  • MCP server — exposes tools, resources, and prompts to a host. You write these.
  • MCP host — the LLM-side runtime that consumes servers (Claude Code, Claude Desktop, Cursor, Windsurf, Zed, JetBrains AI, the Anthropic / OpenAI / Mastra / Vercel AI SDKs, etc.).
  • Transport — stdio (local subprocess) or HTTP/SSE (remote, increasingly the default).
  • Tools — function calls the LLM can invoke.
  • Resources — readable data the LLM can request.
  • Prompts — pre-written prompt templates / slash commands.

Building MCP servers

  • @modelcontextprotocol/sdk — official TS SDK from Anthropic. Default.
  • mcp-go — the Go SDK.
  • mcp (Python) — the official Python SDK.
  • FastMCP (Python) — ergonomic Python wrapper.
  • @cloudflare/mcp-agent-api — build remote MCP servers on Cloudflare Workers.
  • Vercel @vercel/mcp-adapter — Vercel-friendly handlers.
  • Mastra MCP server helpers — bundled with Mastra.

Hosting remote MCP servers

  • Cloudflare Workers — first-class remote MCP support; free tier; built-in auth.
  • Vercel — Functions + the MCP adapter.
  • Render / Fly / Railway — anywhere you can host an HTTP service.
  • Smithery — managed MCP-server hosting / registry.

Consuming MCP from an agent / app

  • Anthropic Agent SDK / Claude Agent SDK — first-class MCP client.
  • OpenAI Agents SDK — supports MCP servers.
  • Vercel AI SDK@ai-sdk/mcp integration.
  • Mastra — MCP servers register as agent tools.
  • mcp-use — LangChain.js MCP adapter.
  • LangGraph / LangChain — MCP nodes.

Registries / catalogs

  • Smithery — search + deploy MCP servers.
  • mcp.so, Glama.ai, PulseMCP, MCP Hub — directories.
  • Anthropic's MCP servers repo on GitHub — official reference servers (filesystem, git, GitHub, Slack, Postgres, Sentry, etc.).

Auth for remote MCP

  • OAuth 2.1 with PKCE — the standard pattern; hosts redirect users for consent.
  • API key — simpler; pass in the request; for trusted internal use.
  • Better Auth + Cloudflare — common combo for OAuth-flavored MCP servers in 2026.

Patterns to know

  • Tool descriptions are prompts — LLMs decide whether to call your tool from the description; write them like prompts, not docstrings.
  • Idempotent + retry-safe tools — agents call tools twice sometimes; handle gracefully.
  • Read-only first — start with resources / read tools; add write tools only with confirmation flows.
  • Pagination — most MCP tools should support cursor-based pagination; LLMs blow context with full lists.
  • Sandboxing for codegen — if the LLM writes code that runs, use a sandbox (E2B, Daytona, Replit Sandboxes, Modal, Stainless's, etc.).

When MCP isn't the right answer

  • Internal tools your own agent calls in-process — just use the agent framework's tool registration; MCP adds a transport you don't need.
  • One-off scripts — direct API calls are simpler.
  • High-throughput batch jobs — MCP is a request/response protocol, not a streaming pipeline.

Pick this if…

  • Default new MCP server: TS SDK + deploy to Cloudflare Workers.
  • Want to publish for others to install: list on Smithery / mcp.so.
  • Adding existing tools to Claude Desktop / Cursor / Claude Code: check if a community MCP server exists first.
  • Internal-only agent tools: skip MCP; register tools directly with your agent framework.

On this page