MCP (Model Context Protocol): What It Is and How to Use It in 2026
Anthropic announced MCP in November 2024. By 2026, it has become the standard interface for connecting AI models to the real world — databases, APIs, file systems, developer tools. Here is the complete guide to what it is, how it works, and how to use it.
TL;DR
- • MCP = universal standard for connecting AI models to external tools and data
- • "USB for AI" — build once, works with any MCP-compatible model
- • Adopted by Claude, OpenAI, Gemini, and 1,000+ community servers
- • Install via Claude Desktop settings or .claude/settings.json
- • Build your own server with the Python or TypeScript SDK in <100 lines
Why MCP Exists: The Problem Before It
Before MCP, connecting an AI model to an external tool required a custom integration for every combination: Claude + GitHub needed one integration, GPT + GitHub needed a separate one. Connecting Claude to your internal database required writing a custom tool definition in your application code. Each AI application reinvented the same wheel.
MCP solves this with a standardized client-server protocol. An MCP server exposes tools, resources, and prompts following the MCP specification. Any MCP-compatible AI client (Claude Desktop, Claude Code, Cursor, or a custom application) can connect to any MCP server without additional integration work.
The analogy that stuck: MCP is to AI tools what USB is to hardware peripherals. Before USB, every device needed a custom port. After USB, one standard worked everywhere. MCP aims to be that standard for AI integrations.
How MCP Works: The Architecture
MCP uses a client-server architecture with three components:
- MCP Host: The AI application that wants to use tools — Claude Desktop, Claude Code, Cursor, or a custom app built with the Anthropic SDK. The host manages connections to MCP servers and passes tool calls between the AI model and servers.
- MCP Client: Built into the host application. Maintains a 1:1 connection with each MCP server. Handles the protocol communication (JSON-RPC over stdio or SSE).
- MCP Server: A lightweight program that exposes specific capabilities — tools (functions the AI can call), resources (data the AI can read), and prompts (template instructions). Runs as a local process or remote service.
When you ask Claude to "search my Notion workspace for notes about Project X," the flow is: Claude decides to use the Notion MCP tool → calls the tool via the MCP client → the Notion MCP server executes the API call → returns results → Claude incorporates them into its response. The AI model never directly touches the Notion API; the MCP server handles it.
Popular MCP Servers in 2026
| MCP Server | What It Connects | Key Tools | Source |
|---|---|---|---|
| filesystem | Local file system | read_file, write_file, list_directory, search_files | Anthropic (official) |
| github | GitHub repos, PRs, issues | search_repos, create_pr, read_file, create_issue | Anthropic (official) |
| postgres | PostgreSQL database | query (read-only), list_tables, describe_table | Anthropic (official) |
| brave-search | Brave Search API (web search) | brave_web_search, brave_local_search | Anthropic (official) |
| playwright | Browser automation | navigate, click, fill, screenshot, extract_content | Community |
| notion | Notion workspace | search_pages, create_page, append_block | Community |
| slack | Slack workspace | post_message, list_channels, get_thread | Community |
| memory | Knowledge graph persistent memory | create_entities, add_observations, search_nodes | Anthropic (official) |
Setting Up MCP in Claude Desktop
Adding an MCP server to Claude Desktop takes under 5 minutes:
- Open Claude Desktop → Settings → Developer → Edit Config
- This opens
claude_desktop_config.json - Add your MCP server to the
mcpServersobject - Restart Claude Desktop
// claude_desktop_config.json example
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/your/files"]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "your-token-here"
}
}
}
}
After restart, Claude will see the connected tools and can use them automatically when relevant, or when you explicitly ask it to use them.
Building Your Own MCP Server (Python)
A minimal MCP server in Python takes under 50 lines. Here is a simple example that exposes a weather lookup tool:
# pip install mcp
from mcp.server import Server
from mcp.server.stdio import stdio_server
from mcp import types
server = Server("my-weather-server")
@server.list_tools()
async def list_tools() -> list[types.Tool]:
return [types.Tool(
name="get_weather",
description="Get current weather for a city",
inputSchema={"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}
)]
@server.call_tool()
async def call_tool(name: str, arguments: dict) -> list[types.TextContent]:
if name == "get_weather":
city = arguments["city"]
# your actual API call here
result = fetch_weather(city)
return [types.TextContent(type="text", text=result)]
if __name__ == "__main__":
import asyncio
asyncio.run(stdio_server(server))
MCP vs. Direct Tool Use: When to Use Each
| Approach | Use When | Advantage |
|---|---|---|
| MCP Server | Reusable tool across multiple AI apps; standardized integration; sharing with others | Build once, use with any MCP client; community ecosystem |
| Direct API tool use | Single-app integration; tightly coupled tool logic; proprietary workflow | Simpler for one-off integrations; no protocol overhead |
| Claude Desktop MCP | Personal productivity; connecting Claude to your own tools and files | No code required to use; GUI configuration |
| Claude Code MCP | Development workflows; project-specific tool integration | Per-project configuration; integrates with agent coding workflows |
Frequently Asked Questions
What is MCP (Model Context Protocol)?
MCP is an open standard from Anthropic (announced Nov 2024) that provides a universal interface for connecting AI models to external tools, databases, and services. Like USB for hardware, MCP means any compliant tool works with any compliant AI model. By 2026, it has been adopted by Claude, OpenAI, Gemini, and 1,000+ community servers.
How do I add MCP servers to Claude?
In Claude Desktop: Settings → Developer → Edit Config → add server tomcpServers inclaude_desktop_config.json→ restart. In Claude Code: configure in.claude/settings.json. Most servers install via npx with no additional setup.
Is MCP safe to use?
Safety depends on which servers you install. Only install from trusted sources — MCP servers run with the permissions you grant. Use environment variables for API keys, never hardcode credentials. Be aware of prompt injection risks from external data sources. Official Anthropic servers and well-known community servers are generally safe.
Build AI agents with MCP-powered tool access
HappyCapy supports MCP server integration — connect your agents to any MCP-compatible tool, database, or service without writing integration code.
Try HappyCapy Free