--- title: "Protocol Overview" description: "Learn about the core concepts and architecture of the Model Context Protocol (MCP)" --- The Model Context Protocol (MCP) is a standardized protocol that enables AI applications to securely access external data sources and tools. MCP follows a client-server architecture where AI applications act as clients that can connect to one or more MCP servers. ## Key features Connect AI models to any data source or tool through a unified protocol Control what data and capabilities are exposed to AI systems Combine multiple servers together for enhanced functionality Build integrations that work consistently across AI applications # Core concepts MCP defines several key primitives that form the foundation of the protocol: Data that can be loaded as context for the AI model. Resources have URIs and can contain text or binary data. Functions that the AI can invoke to perform actions, like writing files or calling APIs. Pre-defined prompt templates that help guide AI interactions in specific ways. Allows servers to request completions from the AI model through the client. # Protocol flow ## Connection and initialization When a client connects to an MCP server, they go through the following initialization sequence: The client establishes a connection to the server using one of the supported transports. The client sends an initialize request containing its capabilities and protocol version. The server responds with its own capabilities and supported protocol version. The client sends an initialized notification to indicate setup is complete. After initialization, the client can begin using the server's resources, tools, and other capabilities. ## Transport options MCP supports multiple transport mechanisms for client-server communication: - Server process reads from stdin and writes to stdout - Messages are newline-terminated JSON - Client manages server process lifetime - State is lost when process exits - Bidirectional communication over WebSocket protocol - Client and server negotiate using 'mcp' subprotocol - Can connect to remote servers - State persists until disconnect - Server pushes messages via SSE - Client sends messages via HTTP POST - Supports cross-origin restrictions - State persists until SSE connection closes