daBongo LMS AI Training Courses

Getting Started with Model Context Protocol

Lesson 2: MCP Architecture – Servers, Clients, Hosts, and Transports

Lesson Objectives

By the end of this lesson, students should be able to:

  • Describe the roles of host, client, and server in an MCP deployment
  • Explain the two primary transport mechanisms (stdio and HTTP/SSE)
  • Trace a tool call from user request to tool execution to Claude response
  • Map the MCP architecture to a concrete integration scenario

Lesson Content

The three roles.

Host: The application that contains or manages the Claude integration – Claude Code, Claude Desktop, or a custom application that embeds Claude. The host manages one or more MCP clients.

Client: Lives inside the host. Maintains a connection to one MCP server. Passes tool calls from Claude to the server and returns results. One client per server.

Server: A separate process that exposes capabilities (tools, resources, prompts) via the MCP protocol. The server has access to the real resources – the file system, database, API.

In Claude Code: Claude Code is the host; it manages clients for each connected MCP server. When Claude needs a file system tool, the client connected to the file system server handles the call.

Transport mechanisms.

MCP servers communicate with clients via two transports (verify current transport specification at modelcontextprotocol.io):

stdio (Standard I/O): The server runs as a child process of the host; communication happens via stdin/stdout. Simple, low-overhead, appropriate for local servers running on the same machine. The most common transport for development and personal tools.

HTTP with SSE (Server-Sent Events): The server runs as an independent HTTP service; clients connect via HTTP. Appropriate for servers running on remote infrastructure, shared servers accessed by multiple clients, and production deployments.

Tracing a tool call.

  1. User asks Claude a question that requires external data
  2. Claude generates a tool call (function name + parameters)
  3. Host receives the tool call from Claude
  4. Host passes it to the appropriate client (matched by tool name)
  5. Client sends the call to the server via the transport
  6. Server executes the tool and returns the result
  7. Client returns the result to the host
  8. Host adds the result to the conversation and sends back to Claude
  9. Claude generates the final response using the tool result

Configuration.

MCP servers are configured in the host's configuration file. In Claude Code: .claude/mcp_servers.json (verify current configuration path at docs.anthropic.com/en/docs/claude-code/mcp). Each entry specifies the server's launch command (for stdio) or URL (for HTTP).

Practical Example

A developer sets up a PostgreSQL MCP server for Claude Code.

She installs the MCP Postgres server package, adds it to her .claude/mcp_servers.json with the database connection string, restarts Claude Code.

Claude Code (the host) launches the Postgres server as a child process (stdio transport), creates a client for it.

She now asks Claude "what are the top 10 orders by value?" – Claude calls the query_database tool, the client sends it to the Postgres server, the server runs the query, returns the results, Claude presents them.

Zero custom integration code.

Safety Notes

MCP servers configured with database connections, file system access, or API credentials carry those credentials in their configuration. Store MCP server configuration files securely – they contain the same sensitive information as environment files. For production MCP deployments, use secrets management for credentials passed to server processes rather than plaintext in config files.

Log in and enroll to access lesson quizzes.

Scroll to Top