LEARN BUILD GROW TOGETHER
DEVELOPER LEARNING HUB
Learn. Build. Grow Together.

Practical tutorials, real-world examples and interview preparation.

.NETC#SQL SERVERANGULAR
Home /.NET /Day 2: MCP Architecture – Understanding Host, Client and Server

Day 2: MCP Architecture – Understanding Host, Client and Server

Day 2: MCP Architecture — Host, Client and Server | SkillsTutorials.in
SKILLS TUTORIALS · MCP FOR .NET DEVELOPERS

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.

MCP ArchitectureHostClient Server.NET 11C# 15

Learning Roadmap

Series project: We use one completed reference application—the AI-Powered Developer Assistant, built with Angular, ASP.NET Core, C#, SQL Server and MCP. The articles progressively explain its architecture and implementation; they do not imply that the complete application is being built from scratch during the 20 days.

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.

Remember the distinction: The Host is the application that coordinates the AI experience. The Client is the protocol component that communicates with one MCP Server. The Server is the program that makes selected context and capabilities available to that Client.

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.

MCP HOST · AI APPLICATION User experience · model orchestration · policy and consent · context coordination MCP Client 1 Dedicated server connection MCP Client 2 Dedicated server connection MCP Client 3 Dedicated server connection MCP protocol messages over a supported transport MCP Server A Project / file context Tools · Resources · Prompts Local or remote process MCP Server B Database context Tools · Resources · Prompts Local or remote process MCP Server C External service context Tools · Resources · Prompts Local or remote process MCP HOST · AI APPLICATION Coordinates the AI experience MCP Client 1 MCP Client 2 MCP Client 3 Protocol communication MCP Server ATools · Resources · PromptsLocal or remote MCP Server BTools · Resources · PromptsLocal or remote MCP Server CTools · Resources · PromptsLocal or remote Each client maintains a connection to its corresponding server.

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.

ROLE 01

Coordinates the AI experience

Manages the user interaction, model provider, conversation flow and response presentation.

ROLE 02

Manages MCP clients

Creates and manages Client instances and their corresponding server connections.

ROLE 03

Enforces application policy

Controls which connections and operations are available and when user consent is required.

Example: In our reference application, the backend AI orchestration is part of the Host responsibility. The Angular UI is the user-facing frontend, but it is not the MCP Client and does not speak MCP directly in the primary application workflow.

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.
Important: A Client is not the AI model. The model may decide that a tool is useful, but the Host and its Client are responsible for validating the choice against available capabilities and carrying out the MCP protocol interaction.

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.

TOOLS

Expose operations

Offer named, described operations that a Client can discover and request, subject to validation and authorization.

RESOURCES

Expose context

Make application data or contextual content available through resource identifiers.

PROMPTS

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

AspectHostClientServer
Main purposeCoordinates the AI applicationCommunicates with one ServerProvides context and capabilities
Owns user experienceYesNoNo
Manages model interactionYesNo; it transports protocol messagesNo; it responds to protocol requests
Protocol communicationCoordinates through ClientsPrimary protocol endpoint on the Host sidePrimary protocol endpoint on the Server side
Capability discoveryUses results to coordinate the experienceRequests and processes capability informationAdvertises its supported capabilities
Typical countOne Host applicationOne per connected ServerOne or more
Example in our projectBackend AI application / orchestrationDeveloperAssistant.McpClientApplication 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.

  1. The user interacts with the Host.
    The Host receives the question and supplies the relevant conversation context to the configured AI model.
  2. 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.
  3. 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.
  4. The Client sends the MCP request.
    The corresponding Client sends the protocol request to its Server over the configured transport.
  5. 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.
  6. The Server returns a protocol response.
    The Client receives the result and passes it to the Host.
  7. 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.
UserQuestion HostAI orchestration MCP ClientProtocol request MCP ServerCapability execution App servicesData / rules Solid arrows: request path · Dashed arrows: result returns toward the Host and user 1 · UserAsks a question 2 · HostCoordinates model and policy 3 · MCP ClientSends protocol request 4 · MCP ServerValidates and handles request 5 · Application servicesBusiness rules and data access The result returns through Server → Client → Host → User.
Do not confuse this with the full protocol lifecycle. This article explains the architectural roles and a high-level request path. JSON-RPC message structure is covered on Day 4, and initialization and lifecycle details are covered on Day 5.

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.

Design principle: Keep Servers focused and composable. Keep cross-server coordination in the Host, and preserve the isolation of each Client–Server relationship.

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.

Angular FrontendDashboard · Projects · Tasks · AI chat · Conversations ASP.NET Core Backend · AI Host API ControllersHTTP endpoints · authvalidation · conversations AI OrchestrationAiAssistant · model providertool-call coordination DeveloperAssistant.McpClientConnect · discover · invokeconfigured MCP servers Application + InfrastructureProject · Task · Activity servicesEF Core · SQL Server MCP Server endpointsAPI-hosted application MCP endpoint+ independently hosted MCP Server project Conceptual mapping of the supplied source snapshot and approved target architecture Angular FrontendUI and HTTP API calls ASP.NET Core Backend · AI Host API ControllersHTTP · auth · validation AI OrchestrationAiAssistant · model · tool calls DeveloperAssistant.McpClientConnect · discover · invoke Application + InfrastructureServices · EF Core · SQL Server MCP Server endpointsAPI-hosted + separate server project Conceptual source mapping; details are explained below.

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.Api is the backend entry point for the Angular application. Its Program.cs configures the API, authentication, application services and AI/MCP dependencies.
  • DeveloperAssistant.AI/Orchestration/AiAssistant.cs coordinates chat-provider responses and calls the MCP capability service when tool, resource or prompt operations are needed.
  • DeveloperAssistant.McpClient/McpCapabilityService.cs is the client-side integration service. It discovers configured server capabilities and performs tool calls, resource reads and prompt retrieval.
  • DeveloperAssistant.Api also maps an authenticated MCP endpoint at /mcp and registers application tools, resources and prompts.
  • DeveloperAssistant.McpServer is a separate ASP.NET Core MCP server project. Its supplied snapshot registers sample tools, resources and prompts and uses HTTP transport.
Source-verification note: The supplied standalone 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:

  1. An IDE manages the AI chat, user approval and several MCP connections. Which role is it?
  2. A .NET component sends MCP requests to a project-management Server and processes its responses. Which role is it?
  3. A service exposes a list_projects operation and project resources to connected Clients. Which role is it?
  4. Your application connects to three independent MCP Servers. How many Client instances does the Host manage in the standard one-client-per-server arrangement?
Check your understanding: 1) Host. 2) Client. 3) Server. 4) Three Client instances—one for each Server connection.

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.

Coming next — Day 3: MCP vs REST API vs Function Calling. We will compare their responsibilities, use cases and trade-offs, and understand why MCP complements rather than replaces APIs and model function-calling features.