Model Context Protocol (MCP)

How AI assistants connect to tools and data

The Model Context Protocol (MCP) is an open standard that lets an AI app (the host) plug into external tools and data through MCP servers. The host discovers what tools a server offers, the model decides when to use them, and the host makes the calls. Here is one remote MCP connection from handshake to tool call.

Intermediate · 5 steps

Message formatJSON-RPC 2.0
Transportsstdio (local), Streamable HTTP (remote)
Server offersTools, resources, prompts
Remote authOAuth 2.1 + PKCE
Key riskLLM06:2025 Excessive Agency
RuleTokens are bound to one server

Step by step

  1. Initialize Agreeing on version and capabilities

    Alice adds the ticketing MCP server to her assistant. The host connects and sends initialize with the protocol version it speaks and what it supports. The server answers with its own capabilities, here that it offers tools, and the host confirms it is ready.

  2. Authorize OAuth for remote servers

    The server answers the first real request with 401 and points to its authorization server. The host runs a standard OAuth flow with PKCE in Alice's browser and gets an access token meant only for this MCP server.

  3. Discover tools What can this server do?

    The host calls tools/list. Each tool comes with a name, a description written for the model, and a JSON schema for its inputs. The host passes these descriptions to the model, which is why they must be trusted text.

  4. Call a tool The model asks, the host decides

    Alice asks: "Any open tickets about the VPN?" The model replies with a request to use search_tickets. The host shows Alice what will be called, then sends tools/call. The server calls the ticketing API with its own credentials and returns the result, which goes back to the model to write the answer.

  5. Write actions need consent Keep a human in the loop

    When the model wants to create_ticket, the host pauses and asks Alice to approve the exact title and text. If the server tried to use Alice's token against some other API, that API would reject it, because the token's audience is only this MCP server.

Security notes

More in AI & LLM Security.