All video notes
Video notes · MCP

Build Anything With a CUSTOM MCP Server - Python Tutorial

Video by Tech With Tim on YouTube · 26 min · uploaded April 2025

Notes and analysis by BrainTube, written from the video. Not affiliated with Tech With Tim. Watch on YouTube

In short

The video builds a small MCP server in Python with the official SDK's FastMCP class: two tools that add and read notes, a resource for the latest note and a prompt that summarises them, all tested in Claude Desktop. The steps are correct and the troubleshooting is honest. It skips the faster test loop, the stdout trap in stdio servers, and what a notes server needs before it is useful as real memory.

The argument

The point is that a custom MCP server is a short Python file, not a large project. You decorate ordinary functions as tools, resources or prompts, give them type hints and a docstring, and the SDK turns them into something any MCP client can discover and call. Claude Desktop launches the server as a local process and talks to it over standard input and output. To make that concrete, Tim builds an "AI sticky notes" server that writes lines to a text file and reads them back, and argues that the same pattern can wrap anything, such as a tool that fills a test database with fake users.

Key ideas, with timestamps

  1. 1:05

    Setup with uv and the MCP SDK

    He uses the MCP Python SDK and the uv package manager, and warns against installing with pip because it complicates the Claude Desktop config later. At 3:17 he runs uv init in a fresh folder and adds the mcp package with its CLI extra, which creates the virtual environment and a main.py.

  2. 4:23

    The quick-start server

    The first version is copied from the SDK readme: create a FastMCP server named demo, add an add tool that sums two numbers and a greeting resource. At 5:00 the command mcp install main.py, run through uv, writes the entry into Claude Desktop's config file so the app knows how to start the server.

  3. 6:40

    When the server does not show up

    The config entry tells Claude Desktop to run uv with the MCP CLI and the run command. The server did not appear at first. His fixes are to force-quit Claude Desktop from Task Manager and reopen it, and if that fails, to put the absolute path to the uv executable in the config, with doubled backslashes on Windows. After the restart, asking for 1 + 7 triggers the add tool and returns 8.

  4. 10:34

    Resources, tools and prompts

    He explains the three server capabilities with web terms. A resource is like an HTTP GET that exposes data. A tool performs an action such as scraping a page or adding a user. A prompt is a reusable template. Each gets its own decorator: mcp.resource, mcp.tool and mcp.prompt.

  5. 13:52

    Typed parameters and docstrings

    The add_note tool takes a message typed as a string and returns a string. At 15:32 he stresses the docstring: the SDK reads it as the tool's description, and it decides how well and how often the model calls the tool. This is the most important line in the tutorial for anyone writing real tools.

  6. 17:48

    The relative path bug

    After the first test the notes file was nowhere in the project, because Claude Desktop starts the server from a different working directory. He fixes it by building the path from the folder of main.py. It is a common first bug with local MCP servers and worth knowing before you write any file-based tool.

  7. 19:25

    A resource URI and a prompt

    The latest note is exposed as a resource at a notes://latest address, and he shows that resource URIs can carry parameters such as a user ID. The prompt function reads every note and returns a request to summarise them. At 23:16 both appear in Claude Desktop's attach menu, separate from the tools.

  8. 24:22

    The model does something unplanned

    After he makes 10 notes on monkeys and runs the summary prompt, Claude writes the summary back into the file with add_note instead of only answering. He takes it as a sign that you need to be more specific. It is a small, real example of tool choice going sideways.

What it gets right

The tutorial is short and honest. It shows the failures, not just the happy path: a server that does not appear, a config that needs an absolute path, a file saved in the wrong place. Those are the problems beginners actually hit, and seeing them fixed on screen is worth more than a clean demo.

The emphasis on docstrings is correct. With FastMCP, the function name, type hints and docstring become the tool's name, input schema and description. A clear description is the main lever you have over whether the model calls a tool at the right time.

The attach menu at 23:16 also shows something many explainers miss. Resources and prompts are surfaced to the user to pick, while tools are called by the model. That split is how the protocol intends the three capabilities to work.

What it leaves out

  • A faster test loop. Every change in the video means force-quitting Claude Desktop. The SDK's CLI also has a development mode that opens the MCP Inspector, where you can list and call tools directly. Use that while building and switch to a real client at the end.
  • The stdout trap. A stdio server uses standard output for protocol messages. A stray print statement can corrupt the stream and break the connection. Log to standard error or a file instead.
  • Tool boundaries. The summary mishap at 24:22 is fixable in the descriptions. Say in add_note's docstring that it should only be used when the user asks to save something. Models follow negative guidance in descriptions better than they guess intent.
  • Safety for write tools. His closing idea, a tool that writes 100 fake users into a database, is exactly where you want limits: a test database only, narrow inputs and the client's confirmation prompt left on.
  • Version drift. Install commands, the config location and the SDK's API are as of the video's April 2025 upload. Check the current SDK readme before copying the steps.

How this applies to memory across AI tools

The sticky notes server is a toy MCP memory server, and it shows both the idea and its limits. Saving and reading text through MCP takes a few lines. Making it useful takes much more: search instead of reading the whole file, stable IDs, a way to delete or correct an entry, and a note of where each item came from. The summary prompt that pastes every note into context stops working after a few hundred lines.

If what you want to remember is mostly things you read and watch, you may not need to build this yourself. BrainTube saves YouTube videos with their transcripts, articles, PDFs and podcasts into one compiled knowledge base and exposes it as an MCP server, so Claude, ChatGPT, Cursor and other MCP clients can search it. Building the tutorial server is still worth an hour, because it shows what any memory server is doing underneath. For the client side, see give your AI memory with MCP.

Who should watch it

Watch it if you know basic Python and want your first working MCP server in under half an hour. Start at 3:17 if uv is already installed. The most useful stretches are 6:40 to 10:01 for getting Claude Desktop to load the server, 15:32 on docstrings, and 17:48 on the working directory bug. Skip it if you need remote servers over HTTP, authentication or TypeScript, since the video covers only a local stdio server in Python. Note the sponsored segment on PyCharm at 2:12; any editor works.

Frequently asked

How do I add a custom MCP server to Claude Desktop?
With the Python SDK's CLI you can run mcp install on your server file through uv, which writes an entry into Claude Desktop's config. You can also edit the config from Settings, Developer, Edit Config. Fully quit and reopen Claude Desktop afterwards, and use the absolute path to uv if the server still does not appear.
What is the difference between an MCP tool and an MCP resource?
A tool is a function the model calls to do something, such as saving a note or calling an API. A resource exposes data at an address, like a read-only endpoint, and the client or user decides when to load it as context. In the Python SDK they use the mcp.tool and mcp.resource decorators.
Why does my MCP server save files in the wrong folder?
The client starts the server from its own working directory, not your project folder, so relative paths point somewhere unexpected. Build file paths from the location of your server script instead. In Python, join the directory of the current file with the file name.

Keep videos like this one searchable

BrainTube saves YouTube videos with their transcripts into one compiled knowledge base that Claude, ChatGPT, Cursor and other MCP clients can search.

Start free

Go deeper

More video notes

Are you the creator and want this page changed or removed? Contact us and we will act within 48 hours.