MCP Challenge
Back to Learn
beginner5 min read

What is MCP?

An introduction to the Model Context Protocol and why it matters for AI applications.

The Problem MCP Solves

AI assistants like Claude are powerful, but they're isolated by default. They can't access your files, query your databases, or interact with your tools. Every integration requires custom code.

Without MCP
  • • Custom integration for each tool
  • • No standardized communication
  • • Security concerns with each connection
  • • Difficult to maintain and scale
With MCP
  • • One protocol for all integrations
  • • Standardized tool/resource format
  • • Built-in security model
  • • Easy to extend and maintain

MCP Architecture

MCP uses a client-server architecture. Click on each layer to learn more:

What MCP Servers Can Expose

MCP servers can expose three types of capabilities:

Tools
Functions the AI can call to perform actions
Examples: weather.get, files.read, database.query

Simple Example

Here's what a simple MCP tool looks like:

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

const server = new McpServer({
  name: "my-first-server",
  version: "1.0.0",
});

// Define a tool
server.tool(
  "greet",                              // Tool name
  "Say hello to someone",               // Description
  { name: z.string() },                 // Input schema
  async ({ name }) => ({                // Handler
    content: [{ type: "text", text: `Hello, ${name}!` }],
  })
);

Key Points: Tools have a name, description, input schema (using Zod), and a handler function that returns content.

Try It Live

Experiment with MCP server code right in your browser:

Interactive MCP Playground

Edit the code and click 'Test Tools' to try calling the tool

Loading...

Quick Quiz

Test your understanding:

1. What does MCP stand for?
2. Who created MCP?
3. What can MCP servers expose?

Ready to build?

Now that you understand what MCP is, let's create your first MCP server!