Most Model Context Protocol examples expose a toy: an echo tool, a dice roller, a weather lookup against a public API. Those teach the wiring but skip the part that makes MCP useful, which is handing an AI agent a controlled door into systems you already run. This tutorial builds that door. By the end you will have a typed MCP server that lets an agent look up a customer in Supabase, list that customer's recent Stripe charges, and create a Stripe payment link, all over standard input and output so it plugs straight into Claude Desktop.

MCP is a protocol that standardizes how an AI application talks to external tools and data. Your server advertises a set of tools, each with a name, a description, and an input schema. The client (an agent) reads those schemas, decides when to call a tool, and gets a structured result back. Typed tools matter here because the schema is the contract the model reads. A vague schema produces vague calls and bad arguments. A tight zod schema means the model knows exactly what a customer email looks like, and your handler never has to defend against a string where it expected a number.

What you will build

Three tools, each backed by a real system:

lookup_customer reads a row from a Supabase table by email. Read only.