Latest AI Techniques: RAG, Tool Use, Agents & MCPThe Model Context Protocol (MCP) and open agent standards · Lesson 14 of 20

MCP concepts: hosts, clients, servers and primitives

Article · 12 min · 9 min lecture

Video lecture

MCP concepts: hosts, clients, servers and primitives

15 chapters · about 9 min · full transcript

Coming soon

Chapter 1 of 15

The Model Context Protocol (MCP)

  • One standard connector for AI apps
  • Hosts, clients, servers
  • Tools, resources, prompts

The narrated lecture is in production

Every chapter is scripted and ready. Browse the chapters and read the full transcript now — the video will appear here when it’s published.

Chapters

The problem MCP solves

Before a common standard, every AI application needed custom integrations for every tool or data source: one connector for a CRM in one assistant, another for the same CRM in a different assistant, and so on. The Model Context Protocol (MCP) is an open protocol that standardises how AI applications connect to external tools, data and prompts. Build an MCP server for your system once, and any MCP-compatible application can use it.

A common analogy is a universal port: one standard connector instead of a drawer of adapters. MCP was introduced by Anthropic in late 2024, was adopted across AI applications, developer tools and platforms from many vendors, and in December 2025 became a founding project of the Agentic AI Foundation under the Linux Foundation. The specification is open, versioned by date (the current revision at the time of writing is dated 2026-07-28) and continues to evolve, so always check the current version at the official MCP site.

Architecture

MCP describes three roles:

  • Host: the AI application the user interacts with (a chat app, an IDE, an agent platform). The host manages connections and user consent.
  • Client: the connector inside the host that maintains a connection to one server.
  • Server: a program that exposes capabilities (tools, data, prompts) for a particular system, such as a file store, database, CRM or internal API.

Messages use JSON-RPC 2.0. Servers can run locally (the host launches them as a subprocess and talks over standard input/output, the stdio transport) or remotely (over Streamable HTTP, with OAuth-based authorisation for protected servers). The older HTTP+SSE transport is deprecated. The 2026-07-28 revision also made the protocol core stateless: the old initialise handshake and session ID header were removed, and each request carries its protocol version, client identity and capabilities, so remote servers can sit behind ordinary load balancers. Details like these change between versions, which is one reason to build on maintained SDKs rather than hand-rolling the protocol.

Server primitives

MCP servers can offer three main kinds of capability:

  1. Tools: functions the model can call to take actions or fetch information (for example create_invoice, search_tickets). These work like the tool calling you learned in module 3, with names, descriptions and JSON Schema inputs. Tools are generally model-controlled: the model decides when to call them, with the host responsible for consent.
  2. Resources: data the server makes available as context, identified by URIs (for example a file, a database record or a document). Resources are typically application-controlled: the host decides how to present or include them.
  3. Prompts: reusable, parameterised prompt templates or workflows the server offers (for example "summarise this ticket thread"), typically user-controlled, often surfaced as commands the user picks.

The specification also defines ways for a server to involve the user or the client. Elicitation lets a server ask the user for missing information (a confirmation, a date, a choice) during an operation; in the 2026-07-28 revision this happens through multi round-trip requests, where the server returns an "input required" result and the client retries the call with the answers attached, instead of the server opening a request back to the client. Earlier revisions also defined sampling (servers requesting model completions through the client), roots (clients telling servers which locations they may use) and logging; the 2026-07-28 revision deprecates these, with at least twelve months before any removal. New capabilities now arrive as opt-in extensions, for example Tasks for long-running work and MCP Apps for server-rendered user interfaces. This is exactly the kind of detail that changes, so check the current specification before depending on a particular feature.

What an MCP tool looks like

Conceptually, a server advertises tools with the same ingredients you already know:

{
  "name": "search_tickets",
  "description": "Search support tickets by text, status and date range. Returns up to 20 tickets with id, subject, status and last_updated.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "query": {"type": "string"},
      "status": {"type": "string", "enum": ["open", "pending", "closed"]}
    },
    "required": ["query"]
  }
}

The host lists available tools from connected servers, provides them to the model, and routes the model's tool calls to the right server.

Why it matters for business

  • Reuse: one integration serves many AI applications.
  • Ecosystem: many ready-made servers exist for common software. Evaluate them carefully (next lesson).
  • Separation of concerns: the team that owns a system can own its MCP server, controlling exactly what is exposed.
  • Portability: switching AI applications or models does not mean rebuilding integrations.

Worked example

An operations team wants their AI assistant to answer "Which enterprise customers have open high-priority tickets and renewals this quarter?" They connect two MCP servers: one for the ticketing system (tool: search_tickets) and one for the CRM (tools: find_accounts, resource: account records). The model calls both, joins the results in its reasoning, and cites ticket IDs and account names. When the team later adopts a different AI application that supports MCP, both servers work without changes.

Hands-on: connect a remote MCP server to a model call

You can see MCP working without writing a server: many hosts (desktop chat apps, IDEs, agent platforms and no-code tools such as n8n) let you add a server by URL or command. Developers can also connect remote MCP servers directly in an API call. With Anthropic's Messages API, the MCP connector (a beta feature at the time of writing) needs two halves: the server in mcp_servers and a matching mcp_toolset entry in tools.

import os
import anthropic

client = anthropic.Anthropic()
resp = client.beta.messages.create(
    model=os.environ.get("ANTHROPIC_MODEL", "claude-opus-5"),
    max_tokens=4000,
    betas=["mcp-client-2025-11-20"],                 # check the docs for the current beta name
    mcp_servers=[{"type": "url", "name": "tickets",
                  "url": "https://mcp.example.com/mcp",   # your remote MCP server
                  "authorization_token": os.environ["TICKETS_MCP_TOKEN"]}],
    tools=[{"type": "mcp_toolset", "mcp_server_name": "tickets"}],
    messages=[{"role": "user", "content": "Which high-priority tickets are still open for enterprise customers?"}],
)
for block in resp.content:
    print(block.type, getattr(block, "text", ""))

For local servers, prompts, resources or finer control, use an MCP client library in your own application (the official Python SDK's Client, for example) and pass the tools to the model yourself. You will build a small server in the lesson "Building an MCP server".

A mental model to keep

Host (chat app / IDE / agent)  --manages consent, shows tools-->  User
   |-- MCP client --> Server A (tickets): tools, resources, prompts
   |-- MCP client --> Server B (CRM):     tools, resources, prompts
Model sees: tool definitions + resource content chosen by the host

The host decides what the model sees and what needs the user's approval. That is why the choice of host, and its settings, matters as much as the servers you connect. The flagship Model Context Protocol (MCP) course covers transports, authorisation, extensions and production deployment in depth.

Going further

Official SDKs exist for several programming languages, along with tools for testing and inspecting servers. When building a server, apply everything from the tool design lesson: task-level tools, clear descriptions, concise results and informative errors. MCP standardises the plumbing; it does not make a badly designed tool good.

Key takeaways

  • MCP is an open, versioned protocol standardising how AI applications connect to tools, data and prompts.
  • Hosts manage user-facing apps and consent, clients connect to servers, servers expose capabilities; messages use JSON-RPC 2.0.
  • Server primitives: tools (model-controlled), resources (application-controlled data) and prompts (user-selected templates).
  • The specification evolves; check the current version and use maintained SDKs.

Check your understanding

Quick questions to lock in the lesson. They don’t count towards your certificate.

  1. In MCP, which role is the AI application the user interacts with?
  2. Which MCP primitive is best suited to exposing a document as context identified by a URI?
  3. What is a key business benefit of MCP?

Put it into practice

List three internal systems you would expose via MCP. For each, name two tools, one resource and one prompt template you would offer.

Enrol for free to save your progress

Reading is always free. Enrol to keep your place, take the final assessment and earn a verifiable certificate.