What is MCP?
The Model Context Protocol (MCP) is an open standard by Anthropic that defines how AI applications (clients) connect to external data sources and tools (servers). It standardizes the interface between LLMs and the outside world — similar to how HTTP standardized web communication. MCP enables AI agents to use tools, access resources, and receive prompts from any compliant server.
Answer-Ready: MCP (Model Context Protocol) is Anthropic's open standard for connecting AI to external tools and data. Defines tools (actions), resources (data), and prompts (templates). JSON-RPC over stdio or HTTP. Used by Claude Code, Cursor, and 200+ servers. The USB-C of AI integrations.
Best for: Developers building MCP servers or understanding the protocol. Works with: Claude Code, Cursor, Claude Desktop, any MCP client.
Protocol Architecture
Client-Server Model
AI Application (Client) MCP Server
┌─────────────────┐ ┌─────────────────┐
│ Claude Code │ ←JSON→ │ GitHub MCP │
│ Cursor │ RPC │ Database MCP │
│ Claude Desktop │ │ Custom Server │
└─────────────────┘ └─────────────────┘Three Primitives
| Primitive | Direction | Purpose |
|---|---|---|
| Tools | Client → Server | Actions the AI can perform (search, create, delete) |
| Resources | Client ← Server | Data the AI can read (files, DB records, API responses) |
| Prompts | Client ← Server | Reusable prompt templates with parameters |
Tool Definition
server.tool(
"search_issues",
{
query: { type: "string", description: "Search query" },
state: { type: "string", enum: ["open", "closed", "all"], default: "open" },
limit: { type: "number", default: 10 },
},
async ({ query, state, limit }) => {
const results = await github.searchIssues(query, state, limit);
return {
content: [{ type: "text", text: JSON.stringify(results) }],
};
}
);Resource Definition
server.resource(
"file://{path}",
async ({ path }) => ({
contents: [{ uri: `file://${path}`, text: await readFile(path, "utf-8") }],
})
);Transport Protocols
| Transport | Use Case | How |
|---|---|---|
| stdio | Local servers | Spawn as child process, communicate via stdin/stdout |
| HTTP+SSE | Remote servers | HTTP POST for requests, SSE for notifications |
| Streamable HTTP | Modern remote | Full-duplex over HTTP |
stdio Configuration
{
"mcpServers": {
"my-server": {
"command": "node",
"args": ["server.js"],
"env": { "API_KEY": "..." }
}
}
}HTTP Configuration
{
"mcpServers": {
"remote-server": {
"transport": "http",
"url": "https://api.example.com/mcp"
}
}
}Message Format (JSON-RPC 2.0)
// Request
{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "search_issues", "arguments": {"query": "bug"}}}
// Response
{"jsonrpc": "2.0", "id": 1, "result": {"content": [{"type": "text", "text": "..."}]}}SDK Languages
| Language | Package |
|---|---|
| TypeScript | @modelcontextprotocol/sdk |
| Python | mcp |
| Kotlin | io.modelcontextprotocol:kotlin-sdk |
| C# | ModelContextProtocol |
FAQ
Q: Is MCP only for Anthropic/Claude? A: No, MCP is an open standard. Cursor, Codex, and other tools support it.
Q: How many MCP servers exist? A: 200+ and growing. Browse at smithery.ai or the official MCP servers repo.
Q: Can I build a server in Python?
A: Yes, use the mcp Python package. Same capabilities as TypeScript SDK.