Day 2: MCP Architecture: Host, Client and Server
Understand the three participants that make MCP communication possible. Learn what the Host coordinates, what an MCP Client manages, what an MCP Server exposes, and how these responsibilities fit into our AI-Powered Developer Assistant.
Learning Roadmap
1. Why does MCP separate Host, Client and Server?
Day 1 introduced the integration problem: an AI application needs a consistent way to obtain context from external systems and, when appropriate, invoke their capabilities. Day 2 moves from that problem to the architecture that organizes the communication.
MCP does not treat the AI application, the protocol connection and the system that provides capabilities as one undifferentiated component. Instead, it defines three cooperating roles: the Host, the Client and the Server. Each role has a focused responsibility. This separation helps an application manage model interaction, protocol communication and access to external capabilities without giving every component unrestricted responsibility.
2. The MCP Host–Client–Server architecture
An MCP Host can manage multiple MCP Client instances. Each Client communicates with one corresponding Server. A Server may run locally as a process or remotely as a service; the communication transport determines how the two endpoints exchange protocol messages. The transport choices are the subject of Day 6, so here we focus on the roles and their boundaries.
Conceptual MCP architecture. One Host can create multiple Clients; each Client communicates with one Server.
3. What is an MCP Host?
The Host is the AI application that the user interacts with. It is the top-level application responsible for coordinating the AI experience and managing MCP connections. A Host may be a desktop AI application, an IDE, or a custom application such as our Developer Assistant.
The Host does more than open a network connection. It owns the user experience and the model interaction. It decides which configured servers the application may use, creates and manages the corresponding Client instances, applies application policy, and coordinates how information returned by servers is made available to the model or user.
Coordinates the AI experience
Manages the user interaction, model provider, conversation flow and response presentation.
Manages MCP clients
Creates and manages Client instances and their corresponding server connections.
Enforces application policy
Controls which connections and operations are available and when user consent is required.
4. What is an MCP Client?
An MCP Client is the protocol component that connects a Host to a particular MCP Server. It handles MCP communication: sending protocol requests, receiving responses, discovering the Server's available capabilities, and invoking supported operations.
A Host that connects to three MCP Servers normally manages three Client instances—one for each Server. This one-client-to-one-server relationship keeps each connection distinct. The Host coordinates across Clients; an individual Client does not become a universal connection to every Server.
What does the Client do?
- Establishes communication with its configured MCP Server using a supported transport.
- Performs protocol-level communication and handles messages.
- Discovers the Server's supported capabilities.
- Requests available tools, resources or prompts where supported.
- Invokes tools, reads resources or retrieves prompts on behalf of the Host.
- Reports results and protocol errors back to the Host.
5. What is an MCP Server?
An MCP Server is a program that exposes selected context and capabilities to MCP Clients. It acts as the protocol-facing boundary around a data source, service or application capability. A Server may expose tools for operations, resources for context, and prompts for reusable instructions.
The Server is not necessarily a database server, web server or physical machine. “Server” describes its role in the MCP relationship: it serves MCP requests from a Client. It can run as a local child process or as a remote service, depending on the deployment and transport.
Expose operations
Offer named, described operations that a Client can discover and request, subject to validation and authorization.
Expose context
Make application data or contextual content available through resource identifiers.
Expose reusable instructions
Provide prompt templates that a Client can discover and retrieve with the required arguments.
A well-designed Server focuses on a clear responsibility and exposes only the capabilities that its users are permitted to access. It should not assume that a connected Host will automatically trust every input or authorize every operation.
6. Host vs Client vs Server: responsibilities compared
| Aspect | Host | Client | Server |
|---|---|---|---|
| Main purpose | Coordinates the AI application | Communicates with one Server | Provides context and capabilities |
| Owns user experience | Yes | No | No |
| Manages model interaction | Yes | No; it transports protocol messages | No; it responds to protocol requests |
| Protocol communication | Coordinates through Clients | Primary protocol endpoint on the Host side | Primary protocol endpoint on the Server side |
| Capability discovery | Uses results to coordinate the experience | Requests and processes capability information | Advertises its supported capabilities |
| Typical count | One Host application | One per connected Server | One or more |
| Example in our project | Backend AI application / orchestration | DeveloperAssistant.McpClient | Application MCP endpoint and separately hosted MCP Server |
7. How does a request travel through MCP?
Consider a developer asking: “Show me the projects I can access.” The following is a conceptual walkthrough of the roles. It is not a claim that every MCP interaction follows this exact tool-call sequence; the selected capability and Host's model orchestration determine the concrete flow.
- The user interacts with the Host.
The Host receives the question and supplies the relevant conversation context to the configured AI model. - The Host makes available capabilities known to it.
The Host uses information obtained through its MCP Clients to understand which server capabilities can be considered. - The model or application selects an appropriate action.
If a project-listing operation is suitable, the Host checks that the requested capability is available and permitted. - The Client sends the MCP request.
The corresponding Client sends the protocol request to its Server over the configured transport. - The Server validates and executes the operation.
The Server applies its input checks and access rules, then obtains the required data through its application or data layer. - The Server returns a protocol response.
The Client receives the result and passes it to the Host. - The Host continues the AI interaction.
The Host decides how the result is used in the conversation and presents the final response to the user.
8. Why can one Host connect to multiple MCP Servers?
A developer workflow may need capabilities from different systems. One Server might expose project information, another might provide source repository context, and a third might expose a deployment platform. MCP allows a Host to compose these integrations while retaining a separate Client connection for each Server.
The Host is responsible for coordinating the combined experience. It should not assume that one Server can inspect another Server's data or read the Host's entire conversation. The Host controls what context is sent to each connection and how returned information is combined.
9. How these roles fit into our AI-Powered Developer Assistant
Our reference project uses a backend-centered design. Angular communicates with the ASP.NET Core Web API through HTTP. The MCP Client is not placed in the browser; it belongs to the backend AI Host. This keeps protocol connections, configured server access and sensitive operations on the server side of the application boundary.
Project mapping: Angular → ASP.NET Core backend AI Host → MCP Client → MCP Server(s). The API also exposes an authenticated application MCP endpoint.
What the supplied source snapshot shows
DeveloperAssistant.Apiis the backend entry point for the Angular application. ItsProgram.csconfigures the API, authentication, application services and AI/MCP dependencies.DeveloperAssistant.AI/Orchestration/AiAssistant.cscoordinates chat-provider responses and calls the MCP capability service when tool, resource or prompt operations are needed.DeveloperAssistant.McpClient/McpCapabilityService.csis the client-side integration service. It discovers configured server capabilities and performs tool calls, resource reads and prompt retrieval.DeveloperAssistant.Apialso maps an authenticated MCP endpoint at/mcpand registers application tools, resources and prompts.DeveloperAssistant.McpServeris a separate ASP.NET Core MCP server project. Its supplied snapshot registers sample tools, resources and prompts and uses HTTP transport.
DeveloperAssistant.McpServer snapshot currently contains sample server capabilities and its project file does not reference DeveloperAssistant.Application. The approved target architecture calls for the independently deployable Server to reuse shared Application-layer services. Treat that as an architectural requirement to verify in the latest repository—not as proof that this particular source snapshot already implements the full integration.
This illustrates an important point: an application can participate in
more than one MCP role. Our backend AI application acts as the Host and
uses DeveloperAssistant.McpClient to connect outward. At the
same time, the API also exposes its own MCP endpoint for compatible
Clients. The separately hosted DeveloperAssistant.McpServer
is another server process. Roles describe what a component does in a
particular communication relationship; they are not simply labels for
an entire solution.
10. Security boundaries: why the separation matters
Separating the roles improves clarity, but it does not automatically make an MCP integration secure. The Host must control which Servers can be connected and which capabilities can be used. The Client must communicate with the intended Server and handle protocol results safely. The Server must validate every request and enforce access rules before exposing data or performing an operation.
- Host: Apply user consent, connection policy, model/tool policy and context minimization.
- Client: Use trusted server configuration, protect credentials, validate returned data and handle failures.
- Server: Authenticate where required, authorize the current user, validate arguments and restrict access to permitted application operations.
A Server should receive only the context required for its operation. It should not be treated as automatically trusted with the Host's complete conversation or with data exposed by other Servers. The Host remains the coordinator for combining information from separate connections.
11. Common architecture mistakes
- Calling the AI model the MCP Client: The model may select a capability, but the Client is the protocol component managed by the Host.
- Putting MCP protocol code in Angular: In our primary application workflow, Angular calls the Web API; the MCP Client belongs in the backend AI Host.
- Assuming one Client talks to every Server: The Host manages multiple Client instances, with a dedicated Client–Server relationship.
- Assuming the Server is always remote: A Server can run locally or remotely. Transport details are covered on Day 6.
- Giving the Server the whole conversation: Keep conversation orchestration in the Host and pass only necessary context.
- Assuming MCP guarantees authorization: Protocol compatibility does not replace application authentication, authorization, validation or user consent.
- Duplicating business rules in a Server: Follow the approved architecture and reuse the shared Application-layer services.
12. Key takeaways
- The Host is the AI application that coordinates the user experience, model interaction and MCP connections.
- The Client is managed by the Host and communicates with one corresponding MCP Server.
- The Server exposes focused context and capabilities through MCP.
- A Host can manage multiple Clients to connect to multiple Servers.
- Servers can be local processes or remote services.
- Security and consent remain responsibilities of the application and the connected systems; MCP does not remove them.
- In our Developer Assistant, the MCP Client is a backend component—not an Angular/browser component.
13. Practical exercise
Use the following scenarios to check whether you can identify each role:
- An IDE manages the AI chat, user approval and several MCP connections. Which role is it?
- A .NET component sends MCP requests to a project-management Server and processes its responses. Which role is it?
- A service exposes a
list_projectsoperation and project resources to connected Clients. Which role is it? - Your application connects to three independent MCP Servers. How many Client instances does the Host manage in the standard one-client-per-server arrangement?
14. Conclusion
The Host, Client and Server are the foundation of MCP architecture. The Host coordinates the AI experience, each Client manages communication with its corresponding Server, and each Server exposes selected context and capabilities. Once these responsibilities are clear, the protocol's message format and lifecycle become much easier to understand.
In our AI-Powered Developer Assistant, this separation keeps Angular focused on the user experience, the ASP.NET Core backend responsible for application and AI orchestration, the MCP Client responsible for protocol communication, and MCP Servers responsible for exposing capabilities.