What if Claude could use a tool that YOU wrote? In this beginner tutorial I build my first MCP server in Python: a calculator with four tools (add, subtract, multiply, divide). I test it in MCP Inspector, connect it to Claude Desktop on Windows, and ask Claude to use it for real calculations.
MCP (Model Context Protocol) is a standard that lets AI apps like Claude connect to external tools and data. Your Python functions become tools, and Claude decides when to call them.
What you'll learn:
✅ What the host, the MCP client and the MCP server each do
✅ How to install the official MCP Python SDK
✅ How to turn plain Python functions into MCP tools with @mcp.tool()
✅ How to test your server with MCP Inspector (including a divide-by-zero error)
✅ How to register the server with Claude Desktop and check it says "Running"
✅ How to ask Claude to use your calculator
✅ A safety reminder: validate inputs and limit what your tools can access
Commands used in the video (VS Code terminal, Windows):
python -m pip install "mcp[cli]"
pip install uv
mcp dev server.py
mcp install server.py --name "My Calculator"
You need: Python 3.11+, VS Code, Node.js (MCP Inspector runs through npx; check with: node --version), and uv (both mcp dev and mcp install use it).
server.py (full code):
[the full calculator code, as in the file]
Tested with mcp 2.3.0 and Claude Desktop on Windows 11. Older SDK versions use a different import (FastMCP), so if the import fails, update with: python -m pip install -U "mcp[cli]"
Chapters:
0:00 Build your own tool for Claude
0:41 What we're building: host, client, server
1:25 Set up Python and install the MCP SDK
2:00 Write the calculator server
3:19 Test it in MCP Inspector
4:23 Connect it to Claude Desktop
5:15 What you just built
6:09 Recap + what to build next
Links:
MCP documentation: https://modelcontextprotocol.io
MCP Python SDK: https://github.com/modelcontextprotocol/python-sdk
MCP Inspector: https://github.com/modelcontextprotocol/inspector
Python: https://www.python.org/downloads/
Node.js: https://nodejs.org
VS Code: https://code.visualstudio.com
uv: https://docs.astral.sh/uv/
Only run MCP servers you trust, and give your tools access to only what they need.
Subscribe for more practical AI tutorials. Not sponsored.