Guide · Architect Prep

MCP Server Guide

A pragmatic walk-through for building a Model Context Protocol (MCP) server — the standard interface that lets LLM clients like Claude, ChatGPT and Cursor call your tools, read your resources, and run your prompts.

What is MCP?

The Model Context Protocol is an open JSON-RPC spec that standardises how AI clients talk to external capabilities. A server exposes three primitives: tools (invokable functions), resources (readable content), and prompts (reusable prompt templates).

Transports

Pick a transport based on where the server runs: stdio for local processes, Streamable HTTP for remote servers (the current default), and SSE as the legacy remote transport. Remote clients POST JSON-RPC and must send Accept: application/json, text/event-stream — servers reject requests without it with HTTP 406.

Auth & security

Default to OAuth 2.1 when tools read or write per-user data. Validate every input at the tool boundary and treat the model as untrusted. Never take user_id from tool input — derive identity from the verified token so row-level security runs as that user. Keep handlers fast; long-running work belongs in your app, not inside a tool.

Tool design checklist

Clear title and one-sentence description — clients pick tools by these. Accurate annotations (readOnlyHint, destructiveHint, idempotentHint). Narrow, orthogonal tools beat one god-tool with a mode flag. Return structured content when the client can consume it. Surface provider errors verbatim.

Deploy

Bundle the server as a single edge function (Supabase, Cloudflare Workers, Vercel, Deno Deploy). Publish a stable HTTPS URL and, if you offer OAuth, expose /.well-known/oauth-protected-resource. Register the URL in your target client.

Where this fits the architect exam

MCP shows up under Integration & Tool Use and Agentic Systems in the Claude Certified Architect syllabus. Expect scenario questions on transport choice, per-user auth, tool granularity, and when to prefer MCP over an app-specific API.

Independent study material. Not affiliated with Anthropic. Part of the Global AI Architect Network.