MCP protocol Anthropic Open Source
Model Context Protocol — "USB-C" for AI
🔌 What is MCP?
MCP(Model Context Protocol) is an open source protocol released by Anthropic in November 2024, aiming to provide a standard interface for AI models to connect to external data sources and tools. Just like USB-C unified device charging interfaces, MCP is unifying how AI connects to the outside world.
🔗 Standardized connection
Unified protocol specification, implemented once and available everywhere
🔒 Safe and controllable
User authorization mechanism, AI cannot access resources without authorization
🛠️ Enrich the ecology
100+ open source MCP Server, continuing to grow
📖 Open source protocol
Open source under MIT license, anyone can use and contribute
🏗️ MCP architecture
MCP communication architecture
(Claude/Cursor)
(JSON-RPC)
(File/DB/API)
📱 MCP Client
The party that initiated the request, such as Claude Desktop, Cursor, Claude Code, etc.
🖥️ MCP Server
The party providing services, connecting specific resources such as file systems, databases, etc. All products and services provided by
📚 Core Concept
🔧 Tools
Functions that AI can call, such as "Read File", "Perform Search"
📄 Resources
Data that AI can access, such as file contents and database records
💬 Prompts
Predefined prompt word templates to simplify common tasks
🔔 Notifications
Real-time updates pushed by Server to Client
🌟 Popular MCP Servers
📁 filesystem
Read and write the local file system, supporting file search, creation, editing, deletion and other operations.
🐙 github
Interact with GitHub, manage warehouses, issues, PRs, conduct code searches, etc.
🌐 puppeteer
Control the browser and perform web page automation, screenshots, crawling and other tasks.
🗃️ sqlite
Query and operate SQLite database, execute SQL statements.
🔍 brave-search
Search the web using the Brave search engine.
📧 gmail
Read and send Gmail messages, manage mailboxes.
⚙️ Configuration example
MCP configuration file for Claude Desktop (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/yourname/Documents"
]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here"
}
},
"sqlite": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sqlite",
"--db-path",
"/path/to/your/database.db"
]
}
}
}
📱 MCP-compatible clients
🧠 Claude Desktop
Anthropic official desktop application, natively supports MCP
🖱️ Cursor
AI code editor, supports MCP to connect external tools
💻 Claude Code
Command line AI assistant, deeply integrated with MCP
🔧 More...
VS Code plug-ins, Zed, etc. continue to be added
🛠️ Develop MCP Server
Develop a simple MCP Server using TypeScript:
import { Server } from "@modelcontextprotocol/sdk/server";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio";
const server = new Server({
name: "my-mcp-server",
version: "1.0.0"
}, {
capabilities: {
tools: {}
}
});
// 注册工具
server.setRequestHandler("tools/list", async () => ({
tools: [{
name: "hello",
description: "Say hello to someone",
inputSchema: {
type: "object",
properties: {
name: { type: "string", description: "Name to greet" }
},
required: ["name"]
}
}]
}));
// 处理工具调用
server.setRequestHandler("tools/call", async (request) => {
if (request.params.name === "hello") {
const name = request.params.arguments.name;
return { content: [{ type: "text", text: `Hello, ${name}!` }] };
}
});
// 启动服务器
const transport = new StdioServerTransport();
server.connect(transport);
🔗 Related Resources
- MCP official document - Complete protocol specification and tutorial
- GitHub Organization - Open source code and SDK
- Official Servers - Officially maintained MCP Server collection
- MCP Server Directory - Community MCP Server Encyclopedia