LyraLearn AI Learning Platform
Exams
← Module 8 Β· MCP Architecture
🎧 Listen

MCP Servers and Clients

MCP defines three roles, and keeping them straight is the key to reasoning about any MCP system. The host application, the MCP client, and one or more MCP servers each have a distinct job, and the boundaries between them are where security and governance live.

Architecture diagram of an MCP host application containing multiple clients, each connected to a separate MCP server that wraps a real system.

The three roles

A single host commonly connects to several servers simultaneously β€” a database server, a documents server, a ticketing server β€” composing their capabilities into one assistant.

How a request flows

When a user asks the assistant to do something, the sequence is:

  1. The client discovers capabilities at connection time (tools/list, resources/list) and advertises them to the model.
  2. The model decides to call a tool and emits a structured call; the host mediates β€” applying policy, and often a human-approval step for sensitive actions.
  3. The client sends tools/call to the server; the server executes against the real system and returns a typed result.
  4. The host feeds the result back to the model as context for its next turn.

The model never holds a database connection or an API key. It only ever names a tool and reads a result β€” the server is the only thing touching the real system.

Transports and where servers run

MCP runs over two main transports: stdio, where the host launches a local server as a child process (ideal for local files or developer tooling), and HTTP/SSE, where the server is a network service (ideal for shared enterprise systems). In a .NET shop you'll typically build the latter as an ASP.NET Core service, hosted on Azure behind the same auth, networking, and observability you give any internal API.

This separation is the architectural payoff: the team that owns the SQL database can own and secure its MCP server, while AI-app teams consume it as clients β€” without ever sharing raw credentials or coupling their release cycles.

🧠 Quiz yourself on this lesson →

Ask the AI Tutor

Grounded in the course lessons β€” it cites its sources and says when it doesn't know.