We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

MCP

MCP, or Model Context Protocol, is an open standard for systems (usually web APIs, but not necessarily) to expose tools, prompts, and data to AI agents.

That means an MCP server can give your agent access to things like:

  • Issue trackers
  • External docs
  • Databases
  • Internal APIs

While yes, you could just expose a REST API and a publicly hosted SKILL file and call it a day, MCP was actually released before SKILLs, and it's a more tight-knit integration than just "here's some docs and an API, good luck with curl."

An MCP server is not just a prompt. It's more like an external tool provider. So instead of having to write 17 custom tools to integrate with the Stripe API, Stripe exposes a publicly hosted MCP server. You connect to it once, and you get all those tools through a standardized interface.

Architecture

MCP's architecture is pretty interesting. It certainly got rolled out in a big hurry and it hasn't been without its critiques. However, it was revised and has gained a lot of adoption and, as such, is likely here to stay.

There are three main components to an MCP system:

  • MCP Host: The AI application that coordinates and manages one or multiple MCP clients
  • MCP Client: A component that maintains a connection to an MCP server and obtains context from the server for the MCP host to use
  • MCP Server: A program that provides context to MCP clients

As a user, the "MCP Host" and "MCP Client" kinda feel like the same thing. For example, in OpenCode, OpenCode itself is the "MCP Host", and as you add new MCP server connections, OpenCode creates a new dedicated "MCP Client" for each one.

Communication Protocol

MCP servers can run locally or remotely. For local connections, stdio direct process transport is used for maximum performance. For remote connections, streamable HTTP is used.

As far as the actual data format being sent on those transports, MCP uses JSON-RPC 2.0. It's a simple JSON-based protocol that feels more like function calls than an HTTP "REST" API.