Objective: Build core understanding of what MCP is, how to set it up, and how we can leverage it in real-time use cases.
The Model Context Protocol (MCP) is an open-source standard introduced by Anthropic in November 2024 that provides a universal way for AI applications (like Claude, ChatGPT, and others) to connect with external data sources, tools, and services.
Think of it as a "USB-C port for AI" — just as USB-C standardizes how devices connect to peripherals, MCP standardizes how AI models connect to external systems.
By late 2025, MCP SDK downloads grew from ~100K to over 97 million per month, with 13,000+ public servers available.
LLMs are powerful but isolated — their knowledge is frozen at training time, and they can't natively interact with real-world systems.
Before MCP, every integration between an AI model and an external system (database, API, file system) required custom code, creating an N×M problem:
N AI models × M external systems = countless custom integrations
MCP replaces this fragmentation with a single universal protocol, reducing it to:
N + M connections (each side implements MCP once)
MCP uses a client-server architecture with these key components:
| Component | Role |
|---|---|
| MCP Host | The AI application (e.g., Claude Desktop, an IDE) where the user interacts |
| MCP Client | Lives inside the host; manages communication between the LLM and MCP servers |
| MCP Server | A lightweight program that exposes specific data, tools, or capabilities |
| Transport Layer | Uses JSON-RPC 2.0 messages via stdio (local) or SSE (remote) |
┌─────────────────────────────────────────┐
│ MCP HOST (e.g. Claude) │
│ │
│ ┌───────────┐ ┌───────────┐ │
│ │MCP Client │ │MCP Client │ │
│ └─────┬─────┘ └─────┬─────┘ │
└────────┼─────────────────┼──────────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ MCP Server A │ │ MCP Server B │
│ (e.g. GitHub) │ │ (e.g. Postgres)│
└─────────────────┘ └─────────────────┘
MCP servers expose capabilities through three primitives:
Functions the AI can invoke autonomously.
Examples: Query a database, send an email, create a GitHub issue, execute code.
Read-only data the application can access on behalf of the user.
Examples: File contents, database records, API responses, configuration data.
Pre-crafted instruction templates for common workflows.
Examples: "Summarize this PR", "Generate a migration script for this schema change".
This is the fastest way to get started.
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory"]
}
}
}
Available pre-built servers: Google Drive, Slack, GitHub, Git, Postgres, Puppeteer, Filesystem, and many more.
Install dependencies:
uv init mcp-server-demo
cd mcp-server-demo
uv add "mcp[cli]"
Create server.py:
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("Demo")
@mcp.tool()
def add(a: int, b: int) -> int:
"""Add two numbers"""
return a + b
@mcp.tool()
def search_database(query: str) -> str:
"""Search the company database for relevant records."""
# Your implementation here
results = db.execute(query)
return str(results)
@mcp.resource("greeting://{name}")
def get_greeting(name: str) -> str:
"""Return a personalized greeting."""
return f"Hello, {name}!"
if __name__ == "__main__":
mcp.run()
Connect to Claude Desktop:
{
"mcpServers": {
"demo": {
"command": "uv",
"args": ["run", "path/to/your/server.py"]
}
}
}
Initialize project:
mkdir mcp-server && cd mcp-server
npm init -y
npm install @modelcontextprotocol/sdk
Create src/index.ts:
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import {
CallToolRequestSchema,
ListToolsRequestSchema,
} from "@modelcontextprotocol/sdk/types.js";
const server = new Server(
{ name: "mcp-server", version: "1.0.0" },
{ capabilities: { tools: {} } }
);
// List available tools
server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: [
{
name: "hello",
description: "Say hello to someone",
inputSchema: {
type: "object",
properties: { name: { type: "string" } },
required: ["name"],
},
},
],
};
});
// Handle tool calls
server.setRequestHandler(CallToolRequestSchema, async (request) => {
if (request.params.name === "hello") {
return {
content: [
{ type: "text", text: `Hello, ${request.params.arguments?.name}!` },
],
};
}
throw new Error("Unknown tool");
});
const transport = new StdioServerTransport();
await server.connect(transport);
Connect to Claude Desktop:
{
"mcpServers": {
"mcp-server": {
"command": "node",
"args": ["path/to/build/index.js"]
}
}
}
Use the MCP Inspector for debugging before wiring to a client:
npx @modelcontextprotocol/inspector build/index.js
This provides a browser-based UI with full request/response visibility.
| Client | Type |
|---|---|
| Claude Desktop | AI Assistant |
| ChatGPT | AI Assistant |
| VS Code (Copilot) | IDE |
| Cursor | IDE |
| Zed | IDE |
| Replit | IDE |
| Sourcegraph | Code Search |
| Codeium | Code Completion |
| Feature | Description |
|---|---|
| OAuth 2.1 | Standard authentication for remote servers |
| PKCE | Authorization code flow protection |
| Least-Privilege Access | Servers only expose what's necessary |
| Human-in-the-Loop | Users approve sensitive actions |
| Scoped Permissions | Granular control over what tools can do |
| Challenge | Details |
|---|---|
| Initial Complexity | Setting up custom servers requires development effort |
| Context Window Pressure | Many tool definitions can overload the LLM's context |
| Token Consumption | Large numbers of connected tools increase costs |
| Ecosystem Dependency | Value grows with adoption — early stages still maturing |
| Performance at Scale | Latency considerations with many concurrent server connections |
| Opportunity | Action |
|---|---|
| Internal tooling | Build MCP servers for our databases, APIs, and services |
| Developer productivity | Connect our repos, docs, and project management tools to AI assistants |
| Customer-facing AI | Use MCP to give our AI products access to real-time data |
| Workflow automation | Chain multiple internal systems through MCP for zero-code automation |
| Competitive advantage | Early adoption positions us ahead as MCP becomes industry standard |