Phase 05 · GenAI & LLM ApplicationsLesson 2 of 3
MCP (Model Context Protocol) for Beginners
The open standard for plugging tools and data into AI apps and agents.
The problem
An AI assistant becomes far more useful when it can reach your real tools: read a database, search your files, create a ticket, check a calendar. Before MCP, every AI app needed custom code for every tool. The Model Context Protocol (MCP) is an open standard that gives AI applications one common way to connect to tools and data.
The concept
The problem MCP solves#
Imagine 5 AI apps (Claude, an IDE assistant, your own agent…) and 10 tools (GitHub, Postgres, Slack, Google Drive…). Without a standard, that's up to 50 custom integrations. With MCP, each tool is wrapped once as an MCP server, and any MCP client can use it.
The pieces#
| Piece | Role | Example |
|---|---|---|
| Host / client | The AI application that wants to use tools | Claude Desktop, Claude Code, an IDE, your agent |
| MCP server | A small program that exposes capabilities in the MCP format | A GitHub server, a Postgres server, your own server |
| Tools | Actions the model can call, with typed inputs | create_issue(title, body), run_query(sql) |
| Resources | Data the client can read | Files, database records, documents |
| Prompts | Reusable prompt templates the server offers | "Summarise this pull request" |
How a tool call flows#
- The client connects to an MCP server and asks: "What tools do you have?"
- The server answers with each tool's name, description and input schema.
- When the user asks something, the model decides a tool would help and requests a call, for example
get_weather(city="Pune"). - The client sends the call to the server, the server runs it and returns the result.
- The model uses the result to write its answer.
A tiny MCP server (Python)#
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("notes")
@mcp.tool()
def add_note(title: str, body: str) -> str:
"""Save a note with a title and body."""
save_to_db(title, body) # your own storage function
return f"Saved note '{title}'"
if __name__ == "__main__":
mcp.run()
Notice how much this resembles a normal Python function. The type hints and docstring become the description the model reads when deciding whether to call the tool.
Why it matters#
MCP turns the tool-integration problem into a reusable ecosystem. As an AI engineer you'll both use existing MCP servers (to give agents capabilities quickly) and build your own to expose your company's systems safely to AI assistants.
Try it
Your task · about 10 minutes
Connect one ready-made MCP server (for example the filesystem server) to Claude Desktop and ask Claude to list and summarise the files in a folder.
Use the interactive visual above to explore it step by stepRecap & next
Key takeaways
- MCP is an open protocol that standardises how AI applications connect to tools and data sources.
- An MCP server exposes tools, resources and prompts; an MCP client (Claude, IDEs, agents) connects to it.
- Build an integration once as an MCP server and any MCP-compatible client can use it.
- Agents use MCP tools to take real actions: query databases, call APIs, read files.
Quick check
2 questions · instant feedback
Go deeper
The full course on GenAI & LLMs
Udemy course
Claude Ecosystem - AI, Code, Cowork, M365 & Certification
View course (opens Udemy in a new tab)
Finished this lesson?
Mark it complete to track your progress and keep your streak going.