Answer
What is MCP (Model Context Protocol)?
MCP (Model Context Protocol) is an open standard developed by Anthropic that defines how AI models connect to external tools, data sources, and services. It's the "USB standard for AI" ā a universal interface for LLMs to interact with the world.
Core Problem MCP Solves
textBefore MCP: Claude ā Custom code ā Tool A Claude ā Custom code ā Tool B GPT-4 ā Custom code ā Tool A (different custom code!) With MCP: Any AI client ā MCP Protocol ā [Tool A, Tool B, Tool N...]
Architecture
textāāāāāāāāāāāāāāā MCP (JSON-RPC) āāāāāāāāāāāāāāāāāāā ā MCP Client ā āāāāāāāāāāāāāāāāāāāā ā MCP Server ā ā (Claude, ā ā (Tool provider) ā ā Cursor, ā ā - File system ā ā IDE...) ā ā - Database ā āāāāāāāāāāāāāāā ā - APIs ā āāāāāāāāāāāāāāāāāāā
What MCP Servers Expose
| Capability | Description | Example |
|---|---|---|
| Tools | Functions AI can call | text text text |
| Resources | Data AI can read | Files, database records, API responses |
| Prompts | Reusable prompt templates | text |
Simple MCP Server
pythonfrom mcp.server import Server from mcp.server.stdio import stdio_server import mcp.types as types app = Server("weather-server") @app.list_tools() async def list_tools(): return [types.Tool( name="get_weather", description="Get weather for a city", inputSchema={ "type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"] } )] @app.call_tool() async def call_tool(name: str, arguments: dict): if name == "get_weather": return [types.TextContent(type="text", text=f"Weather in {arguments['city']}: 22°C, sunny")] async def main(): async with stdio_server() as (read, write): await app.run(read, write, app.create_initialization_options())
Configure Claude to Use MCP Servers
json{ "mcpServers": { "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/projects"] }, "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": {"GITHUB_TOKEN": "ghp_..."} } } }
Popular MCP Servers
| Server | Capability |
|---|---|
| Filesystem | Read/write local files |
| GitHub | Repos, PRs, issues |
| Postgres | SQL queries |
| Brave Search | Web search |
| Context7 | Live library docs |
| Playwright | Browser automation |
| Slack | Send/read messages |
Key Benefits
- Security ā AI only accesses what MCP servers explicitly expose
- Standardization ā one protocol works across Claude, Cursor, and other clients
- Composability ā combine multiple MCP servers for rich tool access
- Open source ā anyone can publish MCP servers