CS 212, AI Programming 1

Model Context Protocol (MCP)

Contents

[TOC]

Introduction

An LLM on its own can only produce text. It can’t read your files or create an issue on GitHub. The Model Context Protocol (MCP) is an open standard, introduced by Anthropic in 20241, that lets AI apps connect an LLM to tools: functions provided by other programs and services. The diagram below shows the parts of an MCP system and how they connect.

McpArchitectureDiagram

The Parts

The Connections

Putting It Together

Suppose you ask an AI app to “Summarize the notes in my ideas.txt file.”

  1. When it starts, the host asks each MCP server which tools it has and gets back a list that includes read_file.
  2. The host sends your prompt and the tool list to the LLM.
  3. The LLM replies with a tool call: use read_file with the path ideas.txt.
  4. The host (usually after asking your permission) sends that request to MCP Server 1, which reads the file and returns its contents.
  5. The host sends the file contents back to the LLM, which writes the summary you see.

The LLM never touches your files directly. The host is in charge of every step, which is why MCP apps can ask you to approve each tool call.

Examples of MCP Hosts

These are freely available applications that incorporate MCP client code so that they can use MCP servers.

Reference

What is the Model Context Protocol (MCP)?—Model Context Protocol Project web site.

Use MCP Servers—LM Studio documentation.

Parts of this document were drafted using Gemini 3.0 and revised using Claude Opus 5.5.


Creative Commons License AI Programming 1 lecture notes by Brian Bird, written in 2025, revised in , are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

  1. The project was started by Anthropic but has since moved to the Linux Foundation ↩