Getting Started with Model Context Protocol By the end of this lesson, students should be able to: 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. Configuration. MCP servers are configured in the host's configuration file. In Claude Code: 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. 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.
Lesson 2: MCP Architecture – Servers, Clients, Hosts, and Transports
Lesson Objectives
Lesson Content
.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
Safety Notes