Students learn to build the server side of the Model Context Protocol — the side that exposes real capabilities to any agent. Starting from a conceptual understanding of MCP, they stand up a working server in Python with FastMCP, define a tool the agent can invoke, and expose read-only resources and reusable prompts. Security is treated as a first-class topic: students learn why an unauthenticated server is a genuine vulnerability, how to apply least privilege, and how to add validation and permission guards so unsafe calls fail safely instead of executing. By the end, a student can author a small, well-scoped, defensible MCP server that an agent could safely use.
This exercise includes
Technical SkillsTry this exercise
Create an account and get immediate access to this exercise
Already have an account?
Access
Free
Prerequisites
None
See the content included in this exercise
Get an overview of what an MCP server is, how it exposes capabilities to agents, and what you will build throughout this course.
Explore the core job of an MCP server as a capability provider, the discovery contract, and why each server should have one clear responsibility.
Learn how to install FastMCP, create a server instance, define tools with type hints and docstrings, and run the server using stdio.
Learn how to secure your MCP server with authentication, least privilege, and guardrails to protect against unauthorized access and data loss.
Test your knowledge of MCP server security and best practices by answering these assessment questions.

