NEWn1n v2.0.1 is live! Enterprise Unified LLM API Gateway with 500+ AI Models, up to 90% off, Try now

Model Context Protocol MCP Explained Architecture and Transports

Authors
  • avatar
    Name
    Nino
    Occupation
    Senior Tech Editor

The Model Context Protocol (MCP) has rapidly transformed from a late 2024 specification by Anthropic into the de facto standard gateway connecting large language models to the broader IT ecosystem. Instead of building custom point-to-point integrations for every assistant and system pair, engineering teams can expose capabilities once behind an MCP server, allowing any compatible client—such as a coding assistant, conversational agent, or internal automation tool—to seamlessly consume them.

At its core, MCP functions as a message exchange protocol built on JSON-RPC 2.0. It remains entirely agnostic to the underlying model or its reasoning engine. Rather than dictating how intelligence works, it standardizes the communication contract between the application hosting the model and the services supplying context or actuation. Think of it as the USB-C port for AI: a universal, interchangeable connector for diverse peripherals.

Understanding MCP Architecture and Core Roles

Navigating the MCP specification requires a firm grasp of its three primary roles. Misidentifying these boundaries is the most common source of design and security errors in distributed agent architectures.

  1. Host: The user-facing application, such as an Integrated Development Environment (IDE), a chat application, or a custom internal agent. The host holds the language model, governs user consent, and enforces authorization boundaries regarding which servers are permitted to connect.
  2. Client: A sub-component running inside the host that maintains an active, dedicated connection with a single MCP server. If a host connects to three distinct servers, it simultaneously manages three distinct client instances.
  3. Server: A lightweight program that exposes concrete capabilities, such as querying an observability platform, reading a corporate knowledge base, or generating support tickets.

An essential security and architectural property of this separation is that the server never inspects the full conversation history. It receives discrete, scoped requests and returns precise results. The host acts as the orchestrator, assembling these context fragments before presenting them to the model.

Primitives: Tools, Resources, and Prompts

The protocol standardizes three primary capabilities that servers can expose to clients:

  • Tools: Executable functions that the language model can autonomously decide to invoke. Every tool requires a unique name, a natural-language description, and a JSON schema defining expected arguments. Discovered via tools/list and executed via tools/call, tools grant agents their agency—and consequently represent the highest security surface area.
  • Resources: Static or dynamic data identified by a URI (e.g., a file, an incident runbook, a database schema, or documentation extracts). Driven primarily by the application layer, resources are explicitly injected into the model context via resources/list and resources/read.
  • Prompts: Reusable message templates typically triggered intentionally by the end-user (e.g., an /analyze-incident command). These templates prepare structured queries and are discovered through prompts/list and retrieved via prompts/get.

Advanced capabilities like sampling (where the server prompts the host's model directly for generation) or eliciting user input are also supported, though implementation varies depending on the specific host revision.

Transport Layers: Stdio vs. HTTP

MCP defines two standardized transport mechanisms tailored for different deployment topologies:

TransportDescriptionIdeal Use CaseSecurity & Logging Trade-offs
stdioHost spawns the server as a local child process, exchanging JSON-RPC via standard input and output.Local developer workstations, personal coding assistants.Network-free simplicity. Crucial restriction: stdout is strictly reserved for protocol messages; all application logs must route to stderr.
HTTP ("Streamable HTTP")Remote microservice communicating over HTTP with response streaming capabilities (superseding early HTTP + SSE designs).Shared enterprise servers, team-wide agent deployments.Requires OAuth-based authentication, standard network monitoring, and proper scaling policies.

Production Implementation Guide

When scaling MCP for enterprise platforms, integration requires careful configuration. For example, local execution environments configure servers via JSON blocks:

\{
  "mcpServers": \{
    "runbooks": \{
      "command": "python