Architecture — AI to External Tool via MCP
The Model Context Protocol defines a standardized communication layer between AI models and external tools. An MCP server exposes a set of tools — functions the AI can call — and resources — data the AI can read. When you ask the AI to "write a query that joins users and orders," the AI calls the MCP database server to read the actual schema, then generates a query with correct table names, column types, and join conditions. No hallucinated column names, no guessed data types.
MCP uses two transport protocols: stdio (standard input/output) for local processes and SSE (Server-Sent Events) for remote servers. Local MCP servers run as child processes of Cursor — they start when Cursor launches and stop when it closes. Remote servers run on your infrastructure and connect over HTTP. According to the Model Context Protocol specification, the protocol supports tool invocation, resource reading, prompt templates, and bi-directional communication between client and server.