Build an MCP Server in 30 Minutes is a lesson from the MCP Masterclass course that walks through building a Python MCP server with one tool, read_note, and connecting it to Claude Desktop so Claude can read local files. It uses the same server structure found in every MCP server, from simple file readers to database connectors.
What you will be able to do
- Set up a Python virtual environment and install the official MCP SDK with pip install mcp.
- Write an MCP server in Python that defines a tool using @server.list_tools() and @server.call_tool().
- Configure Claude Desktop's claude_desktop_config.json with the correct Python and script paths so it can find your server.
- Verify a server connection in Claude Desktop's Search and tools menu before testing it.
- Ask Claude to call your custom tool inside a real conversation and see it read a local file.
Before you start
- Python 3.8 or newer installed (check with python3 --version).
- A code editor such as VS Code, Cursor, or PyCharm.
- Claude Desktop installed and signed in with a free or paid Claude account.
- About 30 minutes and basic comfort copying code and running terminal commands.
Reference
| Step | Command / Setting | Purpose |
|---|---|---|
| Create virtual env (macOS/Linux) | python3 -m venv .venv then source .venv/bin/activate |
Isolates project dependencies |
| Create virtual env (Windows) | py -m venv .venv then .venv\Scripts\activate |
Isolates project dependencies |
| Install SDK | pip install mcp |
Installs the official Python MCP SDK |
| Verify install | python check_setup.py |
Confirms the MCP imports load without error |
| Find Python path | which python (macOS/Linux) or where python (Windows) |
Gets the path to put in the config command field |
| Open config | Claude Desktop > profile icon > Settings > Developer tab > Edit Config | Opens claude_desktop_config.json |
| Config keys | command (full path to venv python), args (full path to server.py) |
Tells Claude Desktop how to launch your server |
| Confirm connection | Message box > bottom-right Search and tools icon | Shows note-reader and its read_note tool if connected |
Common errors and fixes
| What goes wrong | The fix |
|---|---|
pip command not found |
Reinstall Python from python.org and check "Add Python to PATH" during install |
check_setup.py prints an ImportError |
Run pip install mcp again while the virtual environment is active |
| Windows config path uses single backslashes | JSON needs double backslashes (\\) in Windows paths inside claude_desktop_config.json |
read_note tool returns "File not found in the server directory" |
Make sure the file sits directly in the project folder and the filename you send matches it exactly |
Claude Desktop doesn't show the note-reader tool after editing the config |
Completely quit and restart Claude Desktop, and confirm both the Python path and server.py path in the config are correct |
Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of MCP Masterclass: Connect AI to Everything.
More in this section
- Lesson 4: The Three Superpowers of MCP - Tools, Resources, and Prompts
- Lesson 6: Multi-Agent AI Collaboration Tutorial
Continue the course
Browse all lessons in the MCP Masterclass: Connect AI to Everything course, or subscribe to the GenAI Unplugged newsletter to get new lessons in your inbox.