Lessons · Coding · intermediate · Tech With Tim

Build ANYTHING With an Advanced MCP Server (Python, Authentication, Databases & More)

The video “Build ANYTHING With an Advanced MCP Server (Python, Authentication, Databases & More)” by Tech With Tim as 9 lessons, with the idea explained, the code from the screen, steps to try in the practice terminal, practice problems with solutions and a quiz that leads back to the moment.

9lessons
11pieces of code
27exercises
30questions
70min of video
Open the lessons →Lesson 1 is free · Beyond Pass opens all
Build ANYTHING With an Advanced MCP Server (Python, Authentication, Databases & More), video by Tech With Tim▶ 1:09:46 · Tech With Tim
123456789
0:009 lessons across the whole video1:09:46

You will be able to

  • Explain the roles of hosts, clients, servers, and transports in the Model Context Protocol
  • Build a Python MCP server with tools using FastMCP and expose it over HTTP
  • Expose a local MCP server publicly with ngrok and connect it to Claude
  • Add OAuth-based authentication to an MCP server using Stitch and bearer token validation
  • Persist per-user data with SQLAlchemy and tie tool calls to the authenticated user's identity from the JWT

Good to know first

  • Intermediate Python, including classes, decorators, and functions
  • Basic use of the terminal and installing packages (uv or pip)
  • Basic React and npm familiarity
  • General understanding of HTTP requests and APIs

Syllabus

9 lessons and a final project

  1. 1

    MCP architecture: hosts, clients, servers, and transports Free

    0:00–5:105 min of video

    This lesson explains the parts of an MCP setup: the host, the clients inside it, the servers they connect to, and the protocol that carries messages between them. It also introduces transports, the ways those messages travel, including stdio and HTTP.

    2 code3 exercises3 questions
  2. 2

    How OAuth authentication fits into MCP Beyond Pass

    5:10–14:009 min of video

    This lesson explains why an MCP server needs real authentication, how the OAuth sign-in flow works between the browser, the MCP client and the MCP server, and where an authorization server fits. It also shows the two architectures for building that authorization server.

    2 exercises3 questions
  3. 3

    Setting up the project and writing first MCP tools Beyond Pass

    14:00–21:107 min of video

    You will create a Python project with uv, install FastMCP and its helper libraries, and write a small MCP server in main.py. You will define two tools with decorators, then configure and run the server over HTTP on localhost.

    1 code4 build steps3 exercises3 questions
  4. 4

    Exposing your MCP server with ngrok and connecting Claude Beyond Pass

    21:10–26:406 min of video

    You learn why a local MCP server needs a public tunnel, how to create one with ngrok, and how to register that tunnel's URL with Claude Code. You also learn to check the connection and call a tool from Claude.

    6 build steps2 exercises4 questions
  5. 5

    Configuring Stitch and bearer auth in the server Beyond Pass

    26:40–36:009 min of video

    You create a free Stytch project, store its project ID, secret and domain in a .env file, and wire a BearerAuthProvider into a FastMCP server so every request must carry a valid access token. You also add the first OAuth discovery route so a client that gets a 401 knows where to sign in.

    1 code5 build steps4 exercises4 questions
  6. 6

    Protected resource route and registering the OAuth client Beyond Pass

    36:00–42:507 min of video

    You add a well-known route to your MCP server that tells clients where the login (authorization) server is and which scopes and token locations it accepts. You then turn on dynamic client registration in Stytch and set the authorization URL so the client can open a sign-in page.

    1 code4 build steps4 exercises3 questions
  7. 7

    Building the React login frontend with the Stitch SDK Beyond Pass

    42:50–52:2010 min of video

    You will set up a React (Vite) front end, install the Stytch SDK packages, wrap your app in the Stytch provider, and render a login screen that switches to an identity provider view once a user is signed in. You will also learn how to run the front end next to your MCP server and read the first error you hit.

    3 code8 build steps3 exercises3 questions
  8. 8

    Adding a SQLAlchemy notes database and repository Beyond Pass

    52:20–1:03:2011 min of video

    You will build a database.py file that stores notes in a local SQLite database using SQLAlchemy, with a Note table and a NoteRepository that can create and fetch notes per user. You will then connect these to the MCP tools so each signed-in user only sees their own notes.

    2 code5 build steps3 exercises4 questions
  9. 9

    Scoping Notes Per User with JWT Tokens, and Testing It Beyond Pass

    1:03:20–1:09:466 min of video

    You will learn why every user must get their own notes, how the user ID is read from the JWT token's sub claim instead of the client ID, and how to test that two different users see different notes. The chapter also shows how to install a package with uv and inspect a token in Python.

    1 code5 build steps3 exercises3 questions

Final project

Ship a multi-user Notes MCP server with OAuth

Build the full Notes MCP server from the course: a FastMCP server with tools, exposed through ngrok, protected by Stytch OAuth bearer authentication and storing notes per user in SQLite. This shows that a public MCP server can safely serve several people, each with private data.

Its 7 tasks open with Beyond Pass.

Free preview · Lesson 1 in full

MCP architecture: hosts, clients, servers, and transports

This lesson explains the parts of an MCP setup: the host, the clients inside it, the servers they connect to, and the protocol that carries messages between them. It also introduces transports, the ways those messages travel, including stdio and HTTP.

0:00 to 5:10 in the video

Scratchpad

Draw and write next to the video.

The idea

MCP stands for Model Context Protocol. It is a standard way for AI agents to talk to outside tools, such as a file system, a cloud service, or a web search. Before MCP, every AI tool needed its own custom connection. With MCP, one standard lets any AI app talk to any MCP server.

There are three main pieces. The MCP host is the software you actually use, such as Claude Desktop, Cursor or Windsurf. Inside the host live one or more MCP clients. Each client is a small connector that keeps one conversation open with one MCP server. The MCP server is the program that exposes tools and does the real work, such as reading files or calling an API.

The rule to remember is one client for every server. If the host wants to use three servers, it runs three clients. Each client speaks the MCP protocol to its own server. The protocol is the shared set of messages and rules that both sides agree on, so the client and server understand each other.

Behind the server you can connect to anything: a file system, Slack, GitHub, or a database. The server translates an MCP request, such as createToDo, into a call to the right third-party API. Authentication, which proves who is asking, can also be added in the server.

The transport is the channel that carries the protocol messages. The video names three. Stdio (standard input and output) uses the input and output streams of your own computer, so it suits local tools and command-line programs. Server-Sent Events (SSE) streams messages over HTTP. The standard HTTP transport works like a normal web API, with requests sent to an endpoint such as /mcp. This video uses the HTTP transport, and Claude Code is the host because it makes that transport easy to set up.

Key points

  • Host: the app you use (Claude Desktop, Cursor, Windsurf). It can run many clients. 0:26
  • Client: runs inside the host and talks to exactly one MCP server. 0:43
  • Server: exposes tools and does the work, locally or remotely. 0:58
  • Protocol: the shared language of messages between client and server. 3:18
  • Transport decides how messages travel: stdio for local tools, SSE or HTTP for remote servers. 3:54

Words to know

MCP (Model Context Protocol)
A standard way for AI apps to talk to outside tools such as files, cloud services or web search.
Host
The app you use, such as Claude Desktop, Cursor or Windsurf. It runs one or more clients.
Client
A small connector inside the host that keeps one conversation open with one MCP server.
Server
The program that exposes tools and does the real work, such as reading files or calling an API.
Protocol
The shared set of messages and rules that the client and server both understand.
Transport
The channel that carries the protocol messages, for example stdio or HTTP.

Code from the screen

Minimal stdio server (TypeScript, from the docs shown on screen)typescript 4:10 on screen
const server = new Server(
  {
    name: "example-server",
    version: "1.0.0",
  },
  {
    capabilities: {},
  },
);

const transport = new StdioServerTransport();
await server.connect(transport);

This is TypeScript shown on screen from the docs; it needs the MCP TypeScript SDK and is not run in this lesson.

HTTP transport server with Express (from the docs shown on screen)typescript 4:50 on screen
import express from "express";

const app = express();

const server = new Server(
  {
    name: "example-server",
    version: "1.0.0",
  },
  {
    capabilities: {},
  },
);

// MCP endpoint handles both POST and GET
app.post("/mcp", async (req, res) => {
  // Handle JSON-RPC request
  const response = await server.handleRequest(req.body);

  // Return single response or SSE stream
  if (needsStreaming) {

This is an incomplete excerpt shown on screen; it is only for reading, not for running.

Practice

Explain Solution checked

Explain in your own words the difference between an MCP host and an MCP client, and give one example of each.

Solution
  1. The host is the application the user works in, for example Claude Desktop or Cursor.
  2. The client is a connector that lives inside the host and speaks the MCP protocol to one server.
  3. Example: Cursor is the host; inside it, one client connects to a file-system server and another connects to a GitHub server.

The host is the whole app you use; the clients are small connectors inside it, one per server. A good model answer names Cursor (or Claude) as host and a separate client for each server it connects to.

Calculate Solution checked

A host such as Claude Desktop connects to 4 different MCP servers. Using the rule from the video (one client per server), how many MCP clients does the host run?

Hint

One client for every server.

Solution
  1. Each server needs its own client.
  2. 4 servers need 4 clients.

4

Explain Solution checked

You write a small MCP server that only reads files on your own computer and is used from a command-line program. Which transport fits best, stdio or HTTP? Give one reason.

Hint

Think about where the server runs.

Solution
  1. The server and the host both run on the same computer.
  2. Stdio uses the local input and output streams, so no web address is needed.
  3. So stdio fits best.

Stdio, because the server is local and stdio uses your computer's own input and output streams.

On your scratchpad

Draw three boxes labelled Host, Client and Server, with arrows between them. Under the arrows write MCP protocol, and beside the arrow write the transport you would choose (stdio or HTTP) for a local tool and for a remote service.

Quiz

  1. What is the MCP host?

    1. The remote server that runs the tool logic
    2. The software you use, such as Claude Desktop, Cursor or Windsurf, which can connect to MCP servers
    3. The transport that sends HTTP requests
    4. A database that stores the tool results
    Show the answer

    B. The software you use, such as Claude Desktop, Cursor or Windsurf, which can connect to MCP servers · The video says the host is the software you're using, like Claude, Cursor or Windsurf.

    0:26 watch the moment
  2. How many MCP servers does each MCP client talk to?

    1. All servers at once
    2. Exactly one server
    3. Ten servers
    4. It depends on the transport
    Show the answer

    B. Exactly one server · The speaker says for every single MCP client there is one MCP server they talk to, so three servers need three clients.

    0:58 watch the moment
  3. Which transport uses the input and output streams of your local computer?

    1. HTTP
    2. SSE
    3. Stdio
    4. Custom
    Show the answer

    C. Stdio · Stdio, standard input/output, uses local streams and suits command-line tools and local integrations.

    3:54 watch the moment

Open lesson 1, with the video →

Lessons 2–9 and the final project

They open with Beyond Pass: every lesson of every course, in full. One payment: $14.99 for 90 days or $29 for a year. No subscription.

Made by Beyond from the video “Build ANYTHING With an Advanced MCP Server (Python, Authentication, Databases & More)” by Tech With Tim. The video plays in YouTube's own player. Watch it on YouTube · All lessons