Back to Codex
Getting Started·
beginner
·8 min read·Apr 4, 2026

What Is the Model Context Protocol (MCP)? A Complete Introduction

Learn the fundamentals of MCP — what it is, why it matters, and how it enables AI agents to connect with external tools and data sources through a standardized protocol.

MCPintroductionbasicsAI agentsprotocol

What Is the Model Context Protocol?

The Model Context Protocol (MCP) is an open standard that defines how AI models and agents communicate with external tools, data sources, and services. Think of it as USB for AI — a universal connector that lets any AI model talk to any compatible server.

Why MCP Matters

Before MCP, every AI integration was custom-built. Each tool, each database, each API required its own bespoke connector. MCP changes this by providing:

  • A standardized interface between AI models and external resources
  • Plug-and-play compatibility across different AI frameworks
  • Security boundaries that control what data an AI can access
  • Bi-directional communication allowing both queries and actions

Core Architecture

MCP follows a client-server architecture:

code
AI Model (Client) ←→ MCP Protocol ←→ MCP Server ←→ External Resource

MCP Hosts are applications like Claude Desktop, IDE extensions, or custom AI tools that want to access external data.

MCP Clients maintain 1:1 connections with MCP servers, handling the protocol communication.

MCP Servers are lightweight programs that expose specific capabilities through the standardized protocol.

The Three Primitives

MCP defines three core primitives:

  1. Resources — Structured data the server exposes (like files, database records, API responses)
  2. Tools — Functions the AI can call to perform actions (like writing files, querying databases)
  3. Prompts — Reusable prompt templates the server provides

Getting Started

To start using MCP, you need:

  1. An MCP-compatible host (like Claude Desktop)
  2. One or more MCP servers
  3. Configuration to connect them

The configuration is typically a JSON file:

json
{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-name"]
    }
  }
}

What's Next?

Explore our guides to set up specific MCP servers for databases, APIs, file systems, and more. Each guide walks you through installation, configuration, and real-world usage patterns.