What is MCP?

The Model Context Protocol is an open standard for connecting Claude to tools and data sources.

MCP (Model Context Protocol) is an open standard for connecting AI models like Claude to external tools, data, and services in a consistent way.

The problem it solves

Without a standard, every integration is custom: connecting Claude to your database, then to GitHub, then to a calendar, means writing bespoke glue each time. MCP defines a common protocol so tools plug in the same way.

MCP servers

An MCP server exposes a set of tools or data (for example, a GitHub server or a database server). Claude connects to the server and can use whatever it exposes — no custom wiring per integration.

Claude connecting to multiple MCP servers for tools and dataClaudeDatabase MCPGitHub MCPCalendar MCP
One protocol, many integrations: Claude connects to any MCP server the same way.

Example

Example · json
{
  "what_mcp_gives_you": [
    "A standard protocol to expose tools and data to Claude",
    "Reusable MCP servers (databases, GitHub, calendars, and more)",
    "Less custom glue code per integration"
  ]
}

When to use it

  • Connect Claude to your company's internal database through an MCP server so it can answer questions about live records.
  • Use a pre-built GitHub MCP server to let Claude read pull requests and create issues directly from a chat interface.
  • Expose your CMS content via an MCP server so Claude can fetch, draft, and update articles without custom glue code.

More examples

MCP architecture in a config file

Registers an MCP server in Claude's config so it can discover and call the tools that server exposes.

Example · json
{
  "mcpServers": {
    "my-database": {
      "command": "node",
      "args": ["./mcp-servers/database/index.js"],
      "env": { "DB_URL": "postgres://localhost/myapp" }
    }
  }
}

Minimal MCP server that exposes a tool

A complete minimal MCP server that registers one tool and handles tool/call requests over stdio.

Example · javascript
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

const server = new Server({ name: "db-server", version: "1.0.0" }, { capabilities: { tools: {} } });

server.setRequestHandler("tools/list", async () => ({
  tools: [{ name: "query_users", description: "Query users by status",
    inputSchema: { type: "object", properties: { status: { type: "string" } }, required: ["status"] } }]
}));

server.setRequestHandler("tools/call", async ({ params }) => {
  const rows = await db.query("SELECT * FROM users WHERE status=$1", [params.arguments.status]);
  return { content: [{ type: "text", text: JSON.stringify(rows.rows) }] };
});

await server.connect(new StdioServerTransport());

MCP vs. custom tool comparison

Highlights the reusability advantage of MCP — write the server once, connect any compatible AI client to it.

Example · bash
# Without MCP: write a tool handler for every app
# Tool def in app code + HTTP handler + auth = lots of glue

# With MCP: one server, many clients
# Any MCP-compatible host (Claude, other LLMs) can use it
# No per-app integration code needed

Discussion

  • Be the first to comment on this lesson.