Architecture Published Last updated 5 min read

MCP Server Architecture: Hosts, Clients, Servers, and Transports

MCP server architecture in one picture: the host opens one client per server. Stdio for a local process, Streamable HTTP for a remote one, and three things a server can expose.

Tayyab JavedFreelance AI agent developer
MCP Server Architecture: Hosts, Clients, Servers, and Transports
On this page 5 sections
  1. What are the pieces of an MCP server architecture?
  2. Which transport should the server use?
  3. What can a server expose?
  4. In practice
  5. Frequently Asked Questions

MCP server architecture is three roles and two transports. The host is the AI app. It opens one client per server. The server is the process that offers tools, resources, and prompts. Stdio is for a process on the same machine. Streamable HTTP is for a process somewhere else.

By Tayyab Javed, AI agent developer

Quick answer

That split is the architecture page on modelcontextprotocol.io, read October 19, 2026. A host such as Cursor or Claude Desktop is not the server. The server is the smaller program it launches or calls. The file below exposes one of each primitive. An in-process client listed ping, status://app, and summarize, and the tool returned pong.

What are the pieces of an MCP server architecture?

The host coordinates. Visual Studio Code, Claude Desktop, and Cursor are hosts. For each server the host wants, it creates a client that holds that one connection. A second server gets a second client. The server does not call the model. It answers tools/list, resources/list, and prompts/list, then runs the call the client sends. The guides that follow from this picture are on the MCP servers hub.

Two layers sit under that. The data layer is JSON-RPC: discovery, then the primitives. The transport layer is how the bytes move, and where authorization lives. Current protocol revision on that page is 2026-07-28. Discovery is a server/discover request. I did not print the raw JSON-RPC from a socket. I did list the three primitives through the Python SDK, which speaks that protocol.

Which transport should the server use?

Use stdio when the host starts the process. There is no port, so there is no network auth. Use Streamable HTTP when the server is remote and more than one client will call it. HTTP POST carries the client messages. Authorization on that transport is a bearer token, and the spec page says to prefer OAuth to get the token. The production shape of that choice is the MCP production guide. The smallest server you can run on stdio is how to build an MCP server.

What can a server expose?

Three primitives. A tool is a function the model invokes. A resource is data the host reads by URI. A prompt is a template the host can fill. This is mcp 2.3.0, Python 3.11 or newer, installed with pip install "mcp[cli]==2.3.0". I connected mcp.Client to the object in-process.

Python
from mcp.server import MCPServer

mcp = MCPServer("architecture-demo")

@mcp.tool()
def ping() -> str:
    """Return pong."""
    return "pong"

@mcp.resource("status://app")
def status() -> str:
    """Current status."""
    return "ok"

@mcp.prompt()
def summarize() -> str:
    """Ask for a one-line summary."""
    return "Summarize the user's last message in one sentence."

if __name__ == "__main__":
    mcp.run()

list_tools returned ping. list_resources returned status://app. list_prompts returned summarize. Calling ping with no arguments returned the text pong. mcp.run() serves that same object over stdio. Sampling, where a server used to ask the host for a model completion, is marked deprecated on the architecture page as of protocol 2026-07-28. New servers should call a model API themselves if they need one.

In practice

I name the three roles before I write a tool. The host is the app a person is using. The client is the one connection that host opens for one server. The server answers a list call and then runs it, and it does not call the model. The mistake is folding the model, the credential, and the tool into one process and calling that an MCP server. My default is stdio when the host starts the process on the same machine, because there is no port to protect. I use Streamable HTTP only when the server sits somewhere else, and the first check is a bearer token, not a public bind. A second server gets a second client.

Frequently Asked Questions

Is the MCP host the same thing as the MCP server?

No. The host is the application the person is using. The server is a program that host connects to, one client per connection. One host often talks to several servers at once.

What are the MCP transports?

Stdio for a local process the host launches, and Streamable HTTP for a remote process. The official architecture page lists those two. Stdio does not use the HTTP bearer-token flow.

Want the boundary drawn for your stack?

Free 30-minute scoping call. We will decide which process is the server, and which calls stay inside the host.

Book a Scoping Call
Share