Build a Model Context Protocol server by writing one. Start from the host/client/server architecture, then create tools, resources, and prompts with the official Python SDK, test with the Inspector, connect it to a real host, and deploy it locally or remotely.
Before you start
You will build a running server in Python. You need Python 3.10+ and the MCP Python SDK (pip install "mcp[cli]"). To connect your server end to end you will want an MCP host such as Claude Desktop or Claude Code. The first lessons set this up.
What Is MCP?
MCP is the USB-C for AI apps — one open protocol that lets any model host plug into any tool or data source. Learn the host/client/server model and the two layers underneath.
Your First Server
Install the SDK and stand up a running MCP server in a dozen lines. Understand the entry point, the stdio transport, and how a host will launch it.
Tools
Tools are the actions a model can take through your server. Define them from typed functions, write descriptions a model can act on, and return errors as data.
Resources & Prompts
Not everything is an action. Expose read-only data as resources with a stable URI scheme, and package reusable workflows as prompts the user can trigger.
Connecting & Testing
Never wire an untested server into a real host. Exercise it with the MCP Inspector, then connect it to Claude Desktop or Claude Code and verify end to end.
Transports: Local & Remote
The same server runs on your laptop or in the cloud — the difference is the transport. Compare stdio and streamable HTTP, and know when each is the right choice.