Skip to content
AdsxGrowth
All articles
mcpclaude-codetutorialadvanced

MCP servers, explained for builders

The Model Context Protocol lets Claude talk to your tools and data safely. What MCP is, when to reach for it, and how to wire your first server.

BuildWithPromptsJune 2, 20262 min read

MCP — the Model Context Protocol — is how Claude connects to the outside world without you pasting context by hand. A database, a ticketing system, a docs folder, an internal API: wrap it in an MCP server and Claude can read from and act on it with your permission.

The mental model

Think of MCP as USB for AI tools. The protocol is the port; each server is a device. Claude is the host that discovers what's plugged in and uses it.

  • Resources — data Claude can read (files, rows, records).
  • Tools — actions Claude can take (create ticket, run query).
  • Prompts — reusable templates a server exposes.

Note

You don't have to build servers to benefit. Dozens already exist for common tools. You only build one when you have a proprietary system Claude should reach.

When to reach for it

Use MCP when the friction is getting context in and actions out. If you find yourself copy-pasting the same data into Claude every session, that data wants to be an MCP resource.

A minimal server

import { Server } from "@modelcontextprotocol/sdk/server";
 
const server = new Server({ name: "orders", version: "1.0.0" });
 
server.tool("get_order", { id: "string" }, async ({ id }) => {
  const order = await db.order.findUnique({ where: { id } });
  return { content: [{ type: "text", text: JSON.stringify(order) }] };
});
 
server.listen();

That's the whole shape: declare a tool, validate its input, return content. Claude handles discovery and routing.

The safety rule

Scope every tool to the minimum it needs. A read-only reporting server should never expose a delete. MCP makes capabilities explicit — use that to your advantage.

Keep reading